summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-09-23 11:05:37 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-09-23 11:05:37 +0200
commit5609b1c1ea8e4fabae29d9655fd397ef19e6a157 (patch)
tree4d7479be87b6d2419c14edcf621ed96f57afebb3
parent722b6bdcef3cd6b47d248974b8ac8d6ade4fa0be (diff)
downloadcurl-bagder/pvs-warns-4402.tar.gz
http2: Expression 'stream->stream_id != - 1' is always truebagder/pvs-warns-4402
PVS-Studio warning Fixes #4402
-rw-r--r--lib/http2.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 57f1b951b..13663d532 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -2138,17 +2138,14 @@ static ssize_t http2_send(struct connectdata *conn, int sockindex,
return -1;
}
- if(stream->stream_id != -1) {
- /* If whole HEADERS frame was sent off to the underlying socket,
- the nghttp2 library calls data_source_read_callback. But only
- it found that no data available, so it deferred the DATA
- transmission. Which means that nghttp2_session_want_write()
- returns 0 on http2_perform_getsock(), which results that no
- writable socket check is performed. To workaround this, we
- issue nghttp2_session_resume_data() here to bring back DATA
- transmission from deferred state. */
- nghttp2_session_resume_data(h2, stream->stream_id);
- }
+ /* If whole HEADERS frame was sent off to the underlying socket, the nghttp2
+ library calls data_source_read_callback. But only it found that no data
+ available, so it deferred the DATA transmission. Which means that
+ nghttp2_session_want_write() returns 0 on http2_perform_getsock(), which
+ results that no writable socket check is performed. To workaround this,
+ we issue nghttp2_session_resume_data() here to bring back DATA
+ transmission from deferred state. */
+ nghttp2_session_resume_data(h2, stream->stream_id);
return len;