1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

http2: Use size_t type for data drain count

Ref: https://github.com/curl/curl/issues/659
Ref: https://github.com/curl/curl/pull/663
This commit is contained in:
Jay Satiro 2016-04-12 00:37:44 -04:00
parent 723f901195
commit 3f57880ad1
3 changed files with 6 additions and 4 deletions

View File

@ -214,7 +214,7 @@ struct http_conn {
them for both cases. */
int32_t pause_stream_id; /* stream ID which paused
nghttp2_session_mem_recv */
int drain_total; /* sum of all stream's UrlState.drain */
size_t drain_total; /* sum of all stream's UrlState.drain */
/* this is a hash of all individual streams (SessionHandle structs) */
struct h2settings settings;

View File

@ -1166,6 +1166,7 @@ static ssize_t http2_handle_stream_close(struct connectdata *conn,
httpc->pause_stream_id = 0;
}
DEBUGASSERT(httpc->drain_total >= data->state.drain);
httpc->drain_total -= data->state.drain;
data->state.drain = 0;
@ -1471,6 +1472,7 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
stream->stream_id));
}
else if(!stream->closed) {
DEBUGASSERT(httpc->drain_total >= data->state.drain);
httpc->drain_total -= data->state.drain;
data->state.drain = 0; /* this stream is hereby drained */
}

View File

@ -1314,9 +1314,9 @@ struct UrlState {
curl_off_t infilesize; /* size of file to upload, -1 means unknown.
Copied from set.filesize at start of operation */
int drain; /* Increased when this stream has data to read, even if its
socket not necessarily is readable. Decreased when
checked. */
size_t drain; /* Increased when this stream has data to read, even if its
socket is not necessarily is readable. Decreased when
checked. */
bool done; /* set to FALSE when Curl_do() is called and set to TRUE when
Curl_done() is called, to prevent Curl_done() to get invoked
twice when the multi interface is used. */