--- deliantra/server/socket/lowlevel.C 2006/09/14 22:34:06 1.6 +++ deliantra/server/socket/lowlevel.C 2006/11/26 19:48:50 1.7 @@ -310,18 +310,18 @@ /* The buffer is already in a wrapped state, so adjust end */ if (end >= SOCKETBUFSIZE) end -= SOCKETBUFSIZE; + avail = SOCKETBUFSIZE - end; /* We can all fit it behind the current data without wrapping */ if (avail >= len) - { - memcpy (ns->outputbuffer.data + end, buf, len); - } + memcpy (ns->outputbuffer.data + end, buf, len); else { memcpy (ns->outputbuffer.data + end, buf, avail); memcpy (ns->outputbuffer.data, buf + avail, len - avail); } + ns->outputbuffer.len += len; #if 0 LOG (llevDebug, "Added %d to output buffer, total length now %d, start=%d\n", len, ns->outputbuffer.len, ns->outputbuffer.start);