Merge pull request #18 from kezhuw/bugfix

bugfix: mistake when linking write_buffer to existing list in socket ser...
This commit is contained in:
云风
2013-06-21 10:06:21 -07:00

View File

@@ -318,10 +318,13 @@ try_send(struct skynet_context *ctx, struct socket_pool *p, uint32_t source, con
}
if (s->head) {
struct write_buffer * buf = malloc(sizeof(*buf));
buf->next = s->tail;
buf->ptr = (char *)(msg+1);
buf->buffer = (void *)msg;
buf->sz = sz;
assert(s->tail != NULL);
assert(s->tail->next == NULL);
buf->next = s->tail->next;
s->tail->next = buf;
s->tail = buf;
return 1;
}