ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/lowlevel.C
(Generate patch)

Comparing deliantra/server/socket/lowlevel.C (file contents):
Revision 1.6 by root, Thu Sep 14 22:34:06 2006 UTC vs.
Revision 1.7 by root, Sun Nov 26 19:48:50 2006 UTC

308 308
309 end = ns->outputbuffer.start + ns->outputbuffer.len; 309 end = ns->outputbuffer.start + ns->outputbuffer.len;
310 /* The buffer is already in a wrapped state, so adjust end */ 310 /* The buffer is already in a wrapped state, so adjust end */
311 if (end >= SOCKETBUFSIZE) 311 if (end >= SOCKETBUFSIZE)
312 end -= SOCKETBUFSIZE; 312 end -= SOCKETBUFSIZE;
313
313 avail = SOCKETBUFSIZE - end; 314 avail = SOCKETBUFSIZE - end;
314 315
315 /* We can all fit it behind the current data without wrapping */ 316 /* We can all fit it behind the current data without wrapping */
316 if (avail >= len) 317 if (avail >= len)
317 {
318 memcpy (ns->outputbuffer.data + end, buf, len); 318 memcpy (ns->outputbuffer.data + end, buf, len);
319 }
320 else 319 else
321 { 320 {
322 memcpy (ns->outputbuffer.data + end, buf, avail); 321 memcpy (ns->outputbuffer.data + end, buf, avail);
323 memcpy (ns->outputbuffer.data, buf + avail, len - avail); 322 memcpy (ns->outputbuffer.data, buf + avail, len - avail);
324 } 323 }
324
325 ns->outputbuffer.len += len; 325 ns->outputbuffer.len += len;
326#if 0 326#if 0
327 LOG (llevDebug, "Added %d to output buffer, total length now %d, start=%d\n", len, ns->outputbuffer.len, ns->outputbuffer.start); 327 LOG (llevDebug, "Added %d to output buffer, total length now %d, start=%d\n", len, ns->outputbuffer.len, ns->outputbuffer.start);
328#endif 328#endif
329} 329}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines