This commit is contained in:
Cloud Wu
2021-02-03 16:04:01 +08:00
parent 4534fb5269
commit e23ad8fc6b
2 changed files with 3 additions and 3 deletions

View File

@@ -62,7 +62,7 @@ _return_message(struct databuffer *db, struct messagepool *mp) {
}
static void
databuffer_read(struct databuffer *db, struct messagepool *mp, void * buffer, int sz) {
databuffer_read(struct databuffer *db, struct messagepool *mp, char * buffer, int sz) {
assert(db->size >= sz);
db->size -= sz;
for (;;) {

View File

@@ -175,13 +175,13 @@ _forward(struct gate *g, struct connection * c, int size) {
}
if (g->broker) {
void * temp = skynet_malloc(size);
databuffer_read(&c->buffer,&g->mp,temp, size);
databuffer_read(&c->buffer,&g->mp,(char *)temp, size);
skynet_send(ctx, 0, g->broker, g->client_tag | PTYPE_TAG_DONTCOPY, fd, temp, size);
return;
}
if (c->agent) {
void * temp = skynet_malloc(size);
databuffer_read(&c->buffer,&g->mp,temp, size);
databuffer_read(&c->buffer,&g->mp,(char *)temp, size);
skynet_send(ctx, c->client, c->agent, g->client_tag | PTYPE_TAG_DONTCOPY, fd , temp, size);
} else if (g->watchdog) {
char * tmp = skynet_malloc(size + 32);