2003-02-27 Joe Shaw <joe@ximian.com>
+ Try to apply some order to the iochannel refcounting...
+
+ * configure.in: Bump up to 1.99.11.
+
+ * soup-context.c (soup_connection_get_iochannel): The connections
+ needs to own a reference to the iochannel! If we're using HTTPS,
+ release the ref we get from soup_socket_get_iochannel and replace
+ it with the ref we get from soup_ssl_get_iochannel(). Then,
+ always ref the channel that we return (ugh, but that's the soup
+ way).
+ (connection_free): Release the connection's ref to the iochannel.
+
+ * soup-ssl.c (soup_ssl_get_iochannel_real): Ref the iochannel.
+ The reference we pass back will be owned by the connection.
+ (soup_ssl_hup_waitpid): Release our ref.
+
+2003-02-27 Joe Shaw <joe@ximian.com>
+
* configure.in: Bump up to 1.99.10.
* soup-ssl.c (soup_ssl_get_iochannel_real): Ref the iochannel,
AC_INIT(libsoup/soup.h)
-AM_INIT_AUTOMAKE(libsoup, 1.99.10)
+AM_INIT_AUTOMAKE(libsoup, 1.99.11)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_PROG_MAKE_SET
conn->server->connections =
g_slist_remove (conn->server->connections, conn);
+ g_io_channel_unref (conn->channel);
soup_context_unref (conn->context);
soup_socket_unref (conn->socket);
g_source_remove (conn->death_tag);
soup_connection_setup_socket (conn->channel);
- if (conn->context->uri->protocol == SOUP_PROTOCOL_HTTPS)
- conn->channel = soup_ssl_get_iochannel (conn->channel);
- } else
- g_io_channel_ref (conn->channel);
+ if (conn->context->uri->protocol == SOUP_PROTOCOL_HTTPS) {
+ GIOChannel *ssl_chan;
+
+ ssl_chan = soup_ssl_get_iochannel (conn->channel);
+ g_io_channel_unref (conn->channel);
+ conn->channel = ssl_chan;
+ }
+ }
+
+ g_io_channel_ref (conn->channel);
return conn->channel;
}
waitpid (ssl_info->ppid, NULL, 0);
- /*
- * FIXME: The refcounting for these iochannels is totally
- * broken. If we have this unref below, it causes crashes
- * when using HTTPS with a proxy. Sigh. It's better to
- * just leak.
- */
- /* g_io_channel_unref (ssl_info->real_sock); */
+ g_io_channel_unref (ssl_info->real_sock);
g_free (ssl_info);
return FALSE;
g_return_val_if_fail (sock != NULL, NULL);
g_io_channel_ref (sock);
-
if (!(sock_fd = g_io_channel_unix_get_fd (sock))) goto ERROR_ARGS;
flags = fcntl(sock_fd, F_GETFD, 0);
fcntl (sock_fd, F_SETFD, flags & ~FD_CLOEXEC);