Commit f9d7987f authored by Carlos Garcia Campos's avatar Carlos Garcia Campos
Browse files

io-http2: fix io source to not be always dispatched for non-paused messages

message_source_check should return FALSE unless the source was created
for a paused message that is no longer paused.
parent 3033e87b
Pipeline #285470 failed with stages
in 5 minutes and 32 seconds
......@@ -936,6 +936,12 @@ soup_client_message_io_http2_pause (SoupClientMessageIO *iface,
if (data->paused)
g_warn_if_reached ();
if (data->io_source) {
g_source_destroy (data->io_source);
g_source_unref (data->io_source);
data->io_source = NULL;
}
data->paused = TRUE;
}
......@@ -993,14 +999,15 @@ soup_client_message_io_http2_is_reusable (SoupClientMessageIO *iface)
static gboolean
message_source_check (GSource *source)
{
SoupMessageIOSource *message_source = (SoupMessageIOSource *)source;
SoupMessage *msg = SOUP_MESSAGE (message_source->msg);
SoupClientMessageIOHTTP2 *io = get_io_data (msg);
SoupHTTP2MessageData *data = get_data_for_message (io, msg);
SoupMessageIOSource *message_source = (SoupMessageIOSource *)source;
/* QUESTION: What is the point of message_source->paused */
if (message_source->paused) {
if (soup_message_is_io_paused (SOUP_MESSAGE (message_source->msg)))
return FALSE;
return TRUE;
}
return !data->paused;
return FALSE;
}
static GSource *
......
......@@ -314,7 +314,7 @@ do_post_blocked_async_test (Test *test, gconstpointer data)
soup_body_input_stream_http2_add_data (SOUP_BODY_INPUT_STREAM_HTTP2 (in_stream), (guint8*)" Part 2", 8);
soup_body_input_stream_http2_complete (SOUP_BODY_INPUT_STREAM_HTTP2 (in_stream));
}
g_main_context_iteration (async_context, TRUE);
g_main_context_iteration (async_context, FALSE);
}
g_assert_cmpstr (g_bytes_get_data (response, NULL), ==, "Part 1 - Part 2");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment