MCPcopy Create free account
hub / github.com/3proxy/3proxy / sockgetcharcli

Function sockgetcharcli

src/sockgetchar.c:74–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74int sockgetcharcli(struct clientparam * param, int timeosec, int timeousec){
75 int len;
76
77 if(!param->clibuf){
78 if(!(param->clibuf = myalloc(BUFSIZE))) return 0;
79 param->clibufsize = BUFSIZE;
80 param->clioffset = param->cliinbuf = 0;
81 }
82 if(param->cliinbuf && param->clioffset < param->cliinbuf){
83 return (int)param->clibuf[param->clioffset++];
84 }
85 param->clioffset = param->cliinbuf = 0;
86 if ((len = sockrecvfrom(param->clisock, (struct sockaddr *)&param->sincr, param->clibuf, param->clibufsize, timeosec*1000 + timeousec))<=0) return EOF;
87 param->cliinbuf = len;
88 param->clioffset = 1;
89 return (int)*param->clibuf;
90}
91
92int sockfillbuffcli(struct clientparam * param, unsigned long size, int timeosec){
93 int len;

Callers 2

socks.cFile · 0.85
sockgetlinebufFunction · 0.85

Calls 2

myallocFunction · 0.85
sockrecvfromFunction · 0.85

Tested by

no test coverage detected