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

Function addbuffer

src/icqpr.c:93–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91};
92
93static void addbuffer(int increment, struct clientparam * param, unsigned char ** buf_p, int * bufsize_p, int * length_p){
94 int bufsize = *length_p + increment + 40;
95 unsigned char *newbuf;
96 int len = 0;
97
98
99 if(bufsize > *bufsize_p){
100 newbuf = myalloc(bufsize);
101 if(!newbuf) return;
102 memcpy(newbuf, *buf_p, *length_p);
103 myfree(*buf_p);
104 *buf_p = newbuf;
105 *bufsize_p = bufsize;
106 }
107 if(increment) len = sockrecvfrom(param->remsock, (struct sockaddr *)&param->sinsr, *buf_p + *length_p, increment, conf.timeouts[STRING_S]*1000);
108 if(len > 0) {
109 *length_p += len;
110 param->nreads++;
111 param->statssrv64 += len;
112 }
113 return;
114}
115
116
117

Callers 1

icq_srvFunction · 0.85

Calls 3

myallocFunction · 0.85
myfreeFunction · 0.85
sockrecvfromFunction · 0.85

Tested by

no test coverage detected