mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
a little improvement to previous commit
This commit is contained in:
@@ -318,10 +318,12 @@ try_send(struct skynet_context *ctx, struct socket_pool *p, uint32_t source, con
|
|||||||
}
|
}
|
||||||
if (s->head) {
|
if (s->head) {
|
||||||
struct write_buffer * buf = malloc(sizeof(*buf));
|
struct write_buffer * buf = malloc(sizeof(*buf));
|
||||||
buf->next = NULL;
|
|
||||||
buf->ptr = (char *)(msg+1);
|
buf->ptr = (char *)(msg+1);
|
||||||
buf->buffer = (void *)msg;
|
buf->buffer = (void *)msg;
|
||||||
buf->sz = sz;
|
buf->sz = sz;
|
||||||
|
assert(s->tail != NULL);
|
||||||
|
assert(s->tail->next == NULL);
|
||||||
|
buf->next = s->tail->next;
|
||||||
s->tail->next = buf;
|
s->tail->next = buf;
|
||||||
s->tail = buf;
|
s->tail = buf;
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user