aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-05-11 15:10:21 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-05-18 09:33:47 +0200
commit522ca8c035e487801253f0349906160515389f7e (patch)
tree8d980d2721f92e75150dcd4d8a5a6a8b14a55a16
parenta66ed407d2ba40d95d1a68603b20bcd3bf036802 (diff)
http2: rename s/data/pausedata
-rw-r--r--lib/http.c4
-rw-r--r--lib/http.h4
-rw-r--r--lib/http2.c29
3 files changed, 19 insertions, 18 deletions
diff --git a/lib/http.c b/lib/http.c
index c3d72b759..4966f13b1 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -166,8 +166,8 @@ CURLcode Curl_http_setup_conn(struct connectdata *conn)
http->nread_header_recvbuf = 0;
http->bodystarted = FALSE;
http->status_code = -1;
- http->data = NULL;
- http->datalen = 0;
+ http->pausedata = NULL;
+ http->pauselen = 0;
http->error_code = NGHTTP2_NO_ERROR;
http->closed = FALSE;
diff --git a/lib/http.h b/lib/http.h
index 67426d2b0..e8014409b 100644
--- a/lib/http.h
+++ b/lib/http.h
@@ -163,8 +163,8 @@ struct HTTP {
size_t nread_header_recvbuf; /* number of bytes in header_recvbuf fed into
upper layer */
int status_code; /* HTTP status code */
- const uint8_t *data; /* pointer to data chunk, received in on_data_chunk */
- size_t datalen; /* the number of bytes left in data */
+ const uint8_t *pausedata; /* pointer to data received in on_data_chunk */
+ size_t pauselen; /* the number of bytes left in data */
bool closed; /* TRUE on HTTP2 stream close */
uint32_t error_code; /* HTTP/2 error code */
diff --git a/lib/http2.c b/lib/http2.c
index 9e782a5aa..c2e90613a 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -386,8 +386,8 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
stream->memlen));
if(nread < len) {
- stream->data = data + nread;
- stream->datalen = len - nread;
+ stream->pausedata = data + nread;
+ stream->pauselen = len - nread;
DEBUGF(infof(data_s, "NGHTTP2_ERR_PAUSE - out of buffer\n"));
conn->proto.httpc.pause_stream_id = stream_id;
return NGHTTP2_ERR_PAUSE;
@@ -865,24 +865,24 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
stream->mem = mem;
}
}
- else if(stream->data) {
- nread = MIN(len, stream->datalen);
- memcpy(mem, stream->data, nread);
+ else if(stream->pausedata) {
+ nread = MIN(len, stream->pauselen);
+ memcpy(mem, stream->pausedata, nread);
- stream->data += nread;
- stream->datalen -= nread;
+ stream->pausedata += nread;
+ stream->pauselen -= nread;
infof(data, "%zu data bytes written\n", nread);
- if(stream->datalen == 0) {
+ if(stream->pauselen == 0) {
DEBUGF(infof(data, "Unpaused by stream %x\n", stream->stream_id));
assert(httpc->pause_stream_id == stream->stream_id);
httpc->pause_stream_id = 0;
- stream->data = NULL;
- stream->datalen = 0;
+ stream->pausedata = NULL;
+ stream->pauselen = 0;
}
- infof(data, "http2_recv: Got %d bytes from stream->data\n",
- (int)nread);
+ infof(data, "http2_recv: returns %zd bytes from stream->data\n",
+ nread);
return nread;
}
else if(httpc->pause_stream_id) {
@@ -967,7 +967,7 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
}
if(stream->memlen) {
ssize_t retlen = stream->memlen;
- infof(data, "http2_recv: returns %d for stream %x (%zu/%zu)\n",
+ infof(data, "http2_recv: returns %zd for stream %x (%zu/%zu)\n",
retlen, stream->stream_id,
len, stream->len);
data->state.drain = 0; /* this stream is hereby drained */
@@ -981,7 +981,8 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
return http2_handle_stream_close(httpc, data, stream, err);
}
*err = CURLE_AGAIN;
- DEBUGF(infof(data, "http2_recv returns -1, AGAIN\n"));
+ DEBUGF(infof(data, "http2_recv returns AGAIN for stream %x\n",
+ stream->stream_id));
return -1;
}