summaryrefslogtreecommitdiff
path: root/libsoup
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2022-10-13 11:12:36 +0200
committerCarlos Garcia Campos <cgarcia@igalia.com>2022-10-13 11:12:36 +0200
commit6be67842b7048060b14a7f2c1c12af6861343072 (patch)
tree4093bc38912953d57e597f5169d3f9ab2b4feadb /libsoup
parent41292465e52c00eef321baf6968dab8f9cbe6e9e (diff)
downloadlibsoup-6be67842b7048060b14a7f2c1c12af6861343072.tar.gz
http2: do not retry a message if connection never completed a request
This is what we have always done in http1.
Diffstat (limited to 'libsoup')
-rw-r--r--libsoup/http2/soup-client-message-io-http2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
index e45ce132..ca8eec5a 100644
--- a/libsoup/http2/soup-client-message-io-http2.c
+++ b/libsoup/http2/soup-client-message-io-http2.c
@@ -77,6 +77,7 @@ typedef struct {
GTask *close_task;
gboolean session_terminated;
gboolean goaway_sent;
+ gboolean ever_used;
guint in_callback;
} SoupClientMessageIOHTTP2;
@@ -234,6 +235,7 @@ soup_http2_message_data_can_be_restarted (SoupHTTP2MessageData *data,
return TRUE;
return data->state < STATE_READ_DATA_START &&
+ data->io->ever_used &&
!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_TIMED_OUT) &&
!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK) &&
!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) &&
@@ -1563,6 +1565,7 @@ client_stream_eof (SoupClientInputStream *stream,
h2_debug (io, data, "Client stream EOF");
soup_message_set_metrics_timestamp (msg, SOUP_MESSAGE_METRICS_RESPONSE_END);
advance_state_from (data, STATE_READ_DATA, STATE_READ_DONE);
+ io->ever_used = TRUE;
g_signal_handlers_disconnect_by_func (stream, client_stream_eof, msg);
soup_message_got_body (data->msg);
}