]> granicus.if.org Git - curl/commitdiff
http2: Expression 'stream->stream_id != - 1' is always true
authorDaniel Stenberg <daniel@haxx.se>
Mon, 23 Sep 2019 09:05:37 +0000 (11:05 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 23 Sep 2019 20:44:02 +0000 (22:44 +0200)
PVS-Studio warning
Fixes #4402

lib/http2.c

index 1481d142531540da6f4dc9bae6b16e8c6578dffc..98ea9035832872e1779ccc0d260706e5ae552ef8 100644 (file)
@@ -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;