summaryrefslogtreecommitdiff
path: root/libsoup
diff options
context:
space:
mode:
authorJoe Shaw <joe@ximian.com>2004-02-10 22:52:15 +0000
committerJoe Shaw <joeshaw@src.gnome.org>2004-02-10 22:52:15 +0000
commit2908e4a9e1a13264135b74a7f392627f3ded1a45 (patch)
treeb18b494d03728e157eacee7e635dbbdb9b7cd256 /libsoup
parent4823590667b454085d8ecc773812fa55290320b5 (diff)
downloadlibsoup-2908e4a9e1a13264135b74a7f392627f3ded1a45.tar.gz
Add a workaround for SSL connections which time-out but don't close the
2004-02-10 Joe Shaw <joe@ximian.com> * libsoup/soup-connection.c (soup_connection_disconnect): Add a workaround for SSL connections which time-out but don't close the socket until we try sending data again later. * libsoup/soup-socket.c (soup_socket_connect, soup_socket_listen): Don't free the sockaddr from soup_address_get_sockaddr(); we don't own it, the SoupAddress does.
Diffstat (limited to 'libsoup')
-rw-r--r--libsoup/soup-connection.c9
-rw-r--r--libsoup/soup-socket.c5
2 files changed, 10 insertions, 4 deletions
diff --git a/libsoup/soup-connection.c b/libsoup/soup-connection.c
index d2ca4020..c38cc84d 100644
--- a/libsoup/soup-connection.c
+++ b/libsoup/soup-connection.c
@@ -554,6 +554,15 @@ soup_connection_disconnect (SoupConnection *conn)
g_object_unref (conn->priv->socket);
conn->priv->socket = NULL;
g_signal_emit (conn, signals[DISCONNECTED], 0);
+
+ /* Workaround for timed-out SSL connections. Check to see if
+ * there is a message associated with this connection and that
+ * it's not the first time this connection has been used. If met,
+ * setting the status to QUEUED will cause the connection to be
+ * restarted and the message resent.
+ */
+ if (conn->priv->cur_req && conn->priv->last_used != 0)
+ conn->priv->cur_req->status = SOUP_MESSAGE_STATUS_QUEUED;
}
/**
diff --git a/libsoup/soup-socket.c b/libsoup/soup-socket.c
index ed7afbf0..aa970c97 100644
--- a/libsoup/soup-socket.c
+++ b/libsoup/soup-socket.c
@@ -453,13 +453,11 @@ soup_socket_connect (SoupSocket *sock, SoupAddress *remote_addr)
sock->priv->sockfd = socket (sa->sa_family, SOCK_STREAM, 0);
if (sock->priv->sockfd == -1) {
- g_free (sa);
goto done;
}
update_fdflags (sock);
status = connect (sock->priv->sockfd, sa, len);
- g_free (sa);
if (status == -1) {
if (errno == EINPROGRESS) {
@@ -585,8 +583,7 @@ soup_socket_listen (SoupSocket *sock, SoupAddress *local_addr)
close (sock->priv->sockfd);
sock->priv->sockfd = -1;
}
- if (sa)
- g_free (sa);
+
return FALSE;
}