[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 96/153: http2: check nghttp2_session_set_stream_use
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 96/153: http2: check nghttp2_session_set_stream_user_data return code |
Date: |
Tue, 11 Sep 2018 12:52:47 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit ac86eabdbeef84c27f3351e1f72903552d9fb851
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue Aug 14 15:28:29 2018 +0200
http2: check nghttp2_session_set_stream_user_data return code
Might help bug #2688 debugging
Closes #2880
---
lib/http2.c | 39 ++++++++++++++++++++++++++++++++-------
1 file changed, 32 insertions(+), 7 deletions(-)
diff --git a/lib/http2.c b/lib/http2.c
index 1750dd357..e9ec73a6d 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -567,8 +567,15 @@ static int push_promise(struct Curl_easy *data,
}
httpc = &conn->proto.httpc;
- nghttp2_session_set_stream_user_data(httpc->h2,
- frame->promised_stream_id, newhandle);
+ rv = nghttp2_session_set_stream_user_data(httpc->h2,
+ frame->promised_stream_id,
+ newhandle);
+ if(rv) {
+ infof(data, "failed to set user_data for stream %u\n",
+ frame->promised_stream_id);
+ DEBUGASSERT(0);
+ goto fail;
+ }
}
else {
H2BUGF(infof(data, "Got PUSH_PROMISE, ignore it!\n"));
@@ -844,6 +851,7 @@ static int on_stream_close(nghttp2_session *session,
int32_t stream_id,
struct Curl_easy *data_s;
struct HTTP *stream;
struct connectdata *conn = (struct connectdata *)userp;
+ int rv;
(void)session;
(void)stream_id;
@@ -869,8 +877,14 @@ static int on_stream_close(nghttp2_session *session,
int32_t stream_id,
httpc->error_code = error_code;
/* remove the entry from the hash as the stream is now gone */
- nghttp2_session_set_stream_user_data(session, stream_id, 0);
+ rv = nghttp2_session_set_stream_user_data(session, stream_id, 0);
+ if(rv) {
+ infof(data_s, "http/2: failed to clear user_data for stream %u!\n",
+ stream_id);
+ DEBUGASSERT(0);
+ }
H2BUGF(infof(data_s, "Removed stream %u hash!\n", stream_id));
+ stream->stream_id = 0; /* cleared */
}
return 0;
}
@@ -1160,7 +1174,13 @@ void Curl_http2_done(struct connectdata *conn, bool
premature)
}
}
if(http->stream_id) {
- nghttp2_session_set_stream_user_data(httpc->h2, http->stream_id, 0);
+ int rv = nghttp2_session_set_stream_user_data(httpc->h2,
+ http->stream_id, 0);
+ if(rv) {
+ infof(data, "http/2: failed to clear user_data for stream %u!\n",
+ http->stream_id);
+ DEBUGASSERT(0);
+ }
http->stream_id = 0;
}
}
@@ -2175,9 +2195,14 @@ CURLcode Curl_http2_switched(struct connectdata *conn,
return CURLE_HTTP2;
}
- nghttp2_session_set_stream_user_data(httpc->h2,
- stream->stream_id,
- conn->data);
+ rv = nghttp2_session_set_stream_user_data(httpc->h2,
+ stream->stream_id,
+ data);
+ if(rv) {
+ infof(data, "http/2: failed to set user_data for stream %u!\n",
+ stream->stream_id);
+ DEBUGASSERT(0);
+ }
}
else {
populate_settings(conn, httpc);
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 99/153: test1268: check the stderr output as "text", (continued)
- [GNUnet-SVN] [gnurl] 99/153: test1268: check the stderr output as "text", gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 106/153: SSLCERTS: improve the openssl command line, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 108/153: INTERNALS: require GnuTLS >= 2.11.3, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 89/153: travis: disable h2 torture tests for "coverage", gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 93/153: CMake: CMake config files are defining CURL_STATICLIB for static builds, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 97/153: curl: warn the user if a given file name looks like an option, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 102/153: upload: allocate upload buffer on-demand, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 105/153: docs/SECURITY-PROCESS: now we name the files after the CVE id, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 104/153: RELEASE-NOTES: synced, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 103/153: upload: change default UPLOAD_BUFSIZE to 64KB, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 96/153: http2: check nghttp2_session_set_stream_user_data return code,
gnunet <=
- [GNUnet-SVN] [gnurl] 71/153: test1531: Add timeout, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 51/153: smb: don't mark it done in smb_do, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 91/153: ssh-libssh: fix infinite connect loop on invalid private key, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 101/153: vtls: reinstantiate engine on duplicated handles, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 95/153: travis: revert back to gcc-7 for coverage builds, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 86/153: docs: add disallow-username-in-url.d and haproxy-protocol.d on the list, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 98/153: urldata: remove unused pipe_broke struct field, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 92/153: TODO: host name sections in config files, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 110/153: Remove unused definitions, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 68/153: http_proxy: Remove unused macro SELECT_TIMEOUT, gnunet, 2018/09/11