aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-01-30 16:09:36 +0100
committerDaniel Stenberg <daniel@haxx.se>2014-01-30 16:09:36 +0100
commit83f52a455fde40a360238c63d9976b03f941e1d0 (patch)
tree07a02643871af65c625ac01baf035e0230049610 /lib
parenta7affd637feca1a3b63d48ae580e93be2f002938 (diff)
http2: basic version of receiving DATA
Diffstat (limited to 'lib')
-rw-r--r--lib/http2.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/http2.c b/lib/http2.c
index ebcf2c63e..c4b5a08bd 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -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;
}