bugfix: mistake when linking write_buffer to existing list in socket service

This commit is contained in:
Kezhu Wang
2013-06-21 22:55:50 +08:00
parent b6f94e5adc
commit 33ec39a21f

View File

@@ -318,10 +318,11 @@ 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->next = NULL;
buf->ptr = (char *)(msg+1);
buf->buffer = (void *)msg;
buf->sz = sz;
s->tail->next = buf;
s->tail = buf;
return 1;
}