mirror of https://git.kore.io/kore.git
Bring net_recv_expand() in line with others.
This commit is contained in:
parent
a4298206a7
commit
a4a86494b8
|
@ -510,7 +510,7 @@ void net_recv_reset(struct connection *, u_int32_t,
|
|||
void net_remove_netbuf(struct netbuf_head *, struct netbuf *);
|
||||
void net_recv_queue(struct connection *, u_int32_t, int,
|
||||
int (*cb)(struct netbuf *));
|
||||
void net_recv_expand(struct connection *c, u_int32_t, void *,
|
||||
void net_recv_expand(struct connection *c, u_int32_t,
|
||||
int (*cb)(struct netbuf *));
|
||||
void net_send_queue(struct connection *, void *,
|
||||
u_int32_t, struct spdy_stream *, int);
|
||||
|
|
|
@ -166,17 +166,15 @@ net_recv_queue(struct connection *c, u_int32_t len, int flags,
|
|||
}
|
||||
|
||||
void
|
||||
net_recv_expand(struct connection *c, u_int32_t len, void *extra,
|
||||
int (*cb)(struct netbuf *))
|
||||
net_recv_expand(struct connection *c, u_int32_t len, int (*cb)(struct netbuf *))
|
||||
{
|
||||
kore_debug("net_recv_expand(): %p %d %p", c, len, extra);
|
||||
kore_debug("net_recv_expand(): %p %d", c, len);
|
||||
|
||||
if (c->rnb->type != NETBUF_RECV)
|
||||
fatal("net_recv_expand(): wrong netbuf type");
|
||||
|
||||
c->rnb->cb = cb;
|
||||
c->rnb->b_len += len;
|
||||
c->rnb->extra = extra;
|
||||
c->rnb->m_len = c->rnb->b_len;
|
||||
c->rnb->buf = kore_realloc(c->rnb->buf, c->rnb->b_len);
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ spdy_frame_recv(struct netbuf *nb)
|
|||
r = KORE_RESULT_OK;
|
||||
|
||||
if (cb != NULL) {
|
||||
net_recv_expand(c, ctrl.length, NULL, cb);
|
||||
net_recv_expand(c, ctrl.length, cb);
|
||||
} else {
|
||||
kore_debug("no callback for type %u", ctrl.type);
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ spdy_frame_recv(struct netbuf *nb)
|
|||
r = KORE_RESULT_ERROR;
|
||||
} else {
|
||||
r = KORE_RESULT_OK;
|
||||
net_recv_expand(c, data.length, NULL,
|
||||
net_recv_expand(c, data.length,
|
||||
spdy_data_frame_recv);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -237,7 +237,7 @@ websocket_recv_opcode(struct netbuf *nb)
|
|||
}
|
||||
|
||||
len += WEBSOCKET_MASK_LEN;
|
||||
net_recv_expand(c, len, NULL, websocket_recv_frame);
|
||||
net_recv_expand(c, len, websocket_recv_frame);
|
||||
|
||||
return (KORE_RESULT_OK);
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ websocket_recv_frame(struct netbuf *nb)
|
|||
total = len + extra + WEBSOCKET_MASK_LEN;
|
||||
if (total > nb->b_len) {
|
||||
total -= nb->b_len;
|
||||
net_recv_expand(c, total, NULL, websocket_recv_frame);
|
||||
net_recv_expand(c, total, websocket_recv_frame);
|
||||
return (KORE_RESULT_OK);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue