mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
bugfix: silly bug
This commit is contained in:
@@ -427,13 +427,13 @@ push_socket_data(struct harbor *h, const struct skynet_socket_message * message)
|
|||||||
}
|
}
|
||||||
case STATUS_HEADER: {
|
case STATUS_HEADER: {
|
||||||
// big endian 4 bytes length, the first one must be 0.
|
// big endian 4 bytes length, the first one must be 0.
|
||||||
int need = 4 - s->length;
|
int need = 4 - s->read;
|
||||||
if (size < need) {
|
if (size < need) {
|
||||||
s->length += size;
|
memcpy(s->size + s->read, buffer, size);
|
||||||
memcpy(s->size + s->length, buffer, size);
|
s->read += size;
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
memcpy(s->size + s->length, buffer, need);
|
memcpy(s->size + s->read, buffer, need);
|
||||||
buffer += need;
|
buffer += need;
|
||||||
size -= need;
|
size -= need;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user