diff options
author | Anders Bakken <agbakken@gmail.com> | 2016-11-14 15:32:00 -0800 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-11-28 15:06:17 +0100 |
commit | 421f740164cf53ef9dfb6bc96d0b6a8321b32fd5 (patch) | |
tree | 48163d29ba399896d614e06301cf1e559bf9df6b /lib/url.c | |
parent | a387d881ecf1cfe8def1460fdf2faa3fdef66302 (diff) |
http2: Fix crashes when parent stream gets aborted
Closes #1125
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -464,6 +464,7 @@ CURLcode Curl_close(struct Curl_easy *data) /* this destroys the channel and we cannot use it anymore after this */ Curl_resolver_cleanup(data->state.resolver); + Curl_http2_cleanup_dependencies(data); Curl_convert_close(data); /* No longer a dirty share, if it exists */ @@ -2847,9 +2848,11 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option, return CURLE_NOT_BUILT_IN; #else struct Curl_easy *dep = va_arg(param, struct Curl_easy *); - if(dep && GOOD_EASY_HANDLE(dep)) { - data->set.stream_depends_on = dep; - data->set.stream_depends_e = (option == CURLOPT_STREAM_DEPENDS_E); + if(!dep || GOOD_EASY_HANDLE(dep)) { + if(data->set.stream_depends_on) { + Curl_http2_remove_child(data->set.stream_depends_on, data); + } + Curl_http2_add_child(dep, data, (option == CURLOPT_STREAM_DEPENDS_E)); } break; #endif |