http2: basic version of receiving DATA

This commit is contained in:
Daniel Stenberg 2014-01-30 16:09:36 +01:00
parent a7affd637f
commit 83f52a455f

View File

@ -166,11 +166,22 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
const uint8_t *data, size_t len, void *userp)
{
struct connectdata *conn = (struct connectdata *)userp;
struct http_conn *c = &conn->proto.httpc;
(void)session;
(void)flags;
(void)stream_id;
(void)data;
infof(conn->data, "on_data_chunk_recv() was called with len = %u\n", len);
infof(conn->data, "on_data_chunk_recv() "
"len = %u, stream = %x\n", len, stream_id);
if(len < c->len) {
memcpy(c->mem, data, len);
c->mem += len;
c->len -= len;
}
else {
infof(conn->data, "EEEEEEK\n");
}
return 0;
}