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.5 by root, Sun Sep 10 13:43:33 2006 UTC vs.
Revision 1.7 by root, Sun Nov 26 19:48:50 2006 UTC

1
2/*
3 * static char *rcsid_sockets_c =
4 * "$Id: lowlevel.C,v 1.5 2006/09/10 13:43:33 root Exp $";
5 */
6
7/* 1/*
8 CrossFire, A Multiplayer game for X-windows 2 CrossFire, A Multiplayer game for X-windows
9 3
10 Copyright (C) 1992 Frank Tore Johansen 4 Copyright (C) 1992 Frank Tore Johansen
11 5
314 308
315 end = ns->outputbuffer.start + ns->outputbuffer.len; 309 end = ns->outputbuffer.start + ns->outputbuffer.len;
316 /* The buffer is already in a wrapped state, so adjust end */ 310 /* The buffer is already in a wrapped state, so adjust end */
317 if (end >= SOCKETBUFSIZE) 311 if (end >= SOCKETBUFSIZE)
318 end -= SOCKETBUFSIZE; 312 end -= SOCKETBUFSIZE;
313
319 avail = SOCKETBUFSIZE - end; 314 avail = SOCKETBUFSIZE - end;
320 315
321 /* We can all fit it behind the current data without wrapping */ 316 /* We can all fit it behind the current data without wrapping */
322 if (avail >= len) 317 if (avail >= len)
323 {
324 memcpy (ns->outputbuffer.data + end, buf, len); 318 memcpy (ns->outputbuffer.data + end, buf, len);
325 }
326 else 319 else
327 { 320 {
328 memcpy (ns->outputbuffer.data + end, buf, avail); 321 memcpy (ns->outputbuffer.data + end, buf, avail);
329 memcpy (ns->outputbuffer.data, buf + avail, len - avail); 322 memcpy (ns->outputbuffer.data, buf + avail, len - avail);
330 } 323 }
324
331 ns->outputbuffer.len += len; 325 ns->outputbuffer.len += len;
332#if 0 326#if 0
333 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);
334#endif 328#endif
335} 329}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines