[libsoup] connection: move ever used handling to message io implementation
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] connection: move ever used handling to message io implementation
- Date: Fri, 21 May 2021 10:37:21 +0000 (UTC)
commit f7575ce0ba3348083b27cb1e0f884174ad2fbb76
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Fri May 21 12:30:21 2021 +0200
connection: move ever used handling to message io implementation
libsoup/http1/soup-client-message-io-http1.c | 4 +++-
libsoup/soup-connection.c | 10 ----------
libsoup/soup-connection.h | 1 -
3 files changed, 3 insertions(+), 12 deletions(-)
---
diff --git a/libsoup/http1/soup-client-message-io-http1.c b/libsoup/http1/soup-client-message-io-http1.c
index dec32106..627348c5 100644
--- a/libsoup/http1/soup-client-message-io-http1.c
+++ b/libsoup/http1/soup-client-message-io-http1.c
@@ -51,6 +51,7 @@ typedef struct {
SoupMessageIOHTTP1 *msg_io;
gboolean is_reusable;
+ gboolean ever_used;
} SoupClientMessageIOHTTP1;
#define RESPONSE_BLOCK_SIZE 8192
@@ -653,6 +654,7 @@ io_read (SoupClientMessageIOHTTP1 *client_io,
io->read_state = SOUP_MESSAGE_IO_STATE_FINISHING;
soup_message_set_metrics_timestamp (msg, SOUP_MESSAGE_METRICS_RESPONSE_END);
client_io->is_reusable = soup_message_is_keepalive (msg);
+ client_io->ever_used = TRUE;
soup_message_got_body (msg);
break;
@@ -680,7 +682,7 @@ request_is_restartable (SoupMessage *msg, GError *error)
return (io->read_state <= SOUP_MESSAGE_IO_STATE_HEADERS &&
io->read_header_buf->len == 0 &&
- soup_connection_get_ever_used (soup_message_get_connection (client_io->msg_io->item->msg)) &&
+ client_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) &&
diff --git a/libsoup/soup-connection.c b/libsoup/soup-connection.c
index 47fea4a5..c910d9c6 100644
--- a/libsoup/soup-connection.c
+++ b/libsoup/soup-connection.c
@@ -1076,16 +1076,6 @@ soup_connection_set_in_use (SoupConnection *conn,
soup_connection_disconnect (conn);
}
-gboolean
-soup_connection_get_ever_used (SoupConnection *conn)
-{
- SoupConnectionPrivate *priv = soup_connection_get_instance_private (conn);
-
- g_return_val_if_fail (SOUP_IS_CONNECTION (conn), FALSE);
-
- return priv->unused_timeout == 0;
-}
-
SoupClientMessageIO *
soup_connection_setup_message_io (SoupConnection *conn,
SoupMessage *msg)
diff --git a/libsoup/soup-connection.h b/libsoup/soup-connection.h
index 8428e67d..399866a8 100644
--- a/libsoup/soup-connection.h
+++ b/libsoup/soup-connection.h
@@ -59,7 +59,6 @@ SoupConnectionState soup_connection_get_state (SoupConnection *conn);
void soup_connection_set_in_use (SoupConnection *conn,
gboolean in_use);
gboolean soup_connection_is_idle_open (SoupConnection *conn);
-gboolean soup_connection_get_ever_used (SoupConnection *conn);
SoupClientMessageIO *soup_connection_setup_message_io (SoupConnection *conn,
SoupMessage *msg);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]