src/server/util/netbuf.c

changeset 52
aced2245fb1c
parent 24
1a7853a4257e
child 211
2160585200ac
equal deleted inserted replaced
51:b28cf69f42e8 52:aced2245fb1c
159 /* ----------------------------- netbuf_grab ------------------------------ */ 159 /* ----------------------------- netbuf_grab ------------------------------ */
160 160
161 161
162 NSAPI_PUBLIC int netbuf_grab(netbuf *buf, int sz) { 162 NSAPI_PUBLIC int netbuf_grab(netbuf *buf, int sz) {
163 int n; 163 int n;
164 164
165 if(!buf->inbuf) { 165 if(!buf->inbuf) {
166 buf->inbuf = (unsigned char *) malloc(sz); 166 buf->inbuf = (unsigned char *) malloc(sz);
167 buf->maxsize = sz; 167 buf->maxsize = sz;
168 } 168 }
169 else if(sz > buf->maxsize) { 169 else if(sz > buf->maxsize) {

mercurial