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

io-http2: don't keep reading/writing if io_read/io_write return FALSE

parent 69258b57
Pipeline #286300 failed with stages
in 5 minutes and 35 seconds
......@@ -1428,8 +1428,10 @@ io_idle_read (SoupClientMessageIOHTTP2 *io)
g_clear_pointer (&io->idle_read_source, g_source_unref);
}
while (nghttp2_session_want_read (io->session) && !error)
io_read (io, FALSE, FALSE, &error);
while (nghttp2_session_want_read (io->session)) {
if (!io_read (io, FALSE, FALSE, &error))
break;
}
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK)) {
io->idle_read_source = g_pollable_input_stream_create_source (G_POLLABLE_INPUT_STREAM (io->istream), NULL);
......@@ -1578,8 +1580,10 @@ io_close (SoupClientMessageIOHTTP2 *io)
g_clear_pointer (&io->close_source, g_source_unref);
}
while (nghttp2_session_want_write (io->session) && !error)
io_write (io, FALSE, FALSE, &error);
while (nghttp2_session_want_write (io->session)) {
if (!io_write (io, FALSE, FALSE, &error))
break;
}
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK)) {
g_error_free (error);
......
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