summaryrefslogtreecommitdiff
path: root/lib
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 22:44:02 +0200
commitb259baabfeca71e46132435e5498513538515c11 (patch)
treea2519f9219043ece732c10c480e4de688cee6f60 /lib
parentf91b82e688e7a9f2b843a121748d4b5b4f1180b6 (diff)
downloadcurl-b259baabfeca71e46132435e5498513538515c11.tar.gz
http2: Expression 'stream->stream_id != - 1' is always true
PVS-Studio warning Fixes #4402
Diffstat (limited to 'lib')
-rw-r--r--lib/http2.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 1481d1425..98ea90358 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -2140,17 +2140,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;