dovecot-2.2: lib-http: client: Removed connection code that is a...

dovecot at dovecot.org dovecot at dovecot.org
Sat Nov 15 01:27:36 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/8eaaff8e2c63
changeset: 18096:8eaaff8e2c63
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Sat Nov 15 02:37:03 2014 +0200
description:
lib-http: client: Removed connection code that is already in src/lib/connection.c.

diffstat:

 src/lib-http/http-client-connection.c |  38 +----------------------------------
 1 files changed, 1 insertions(+), 37 deletions(-)

diffs (55 lines):

diff -r 7ef360d3fb09 -r 8eaaff8e2c63 src/lib-http/http-client-connection.c
--- a/src/lib-http/http-client-connection.c	Sat Nov 15 02:36:22 2014 +0200
+++ b/src/lib-http/http-client-connection.c	Sat Nov 15 02:37:03 2014 +0200
@@ -1142,42 +1142,6 @@
 	http_client_connection_close(&conn);
 }
 
-// FIXME: put something like this in lib/connection.c
-static void
-_connection_init_from_streams(struct connection_list *list,
-			    struct connection *conn, const char *name,
-			    struct istream *input, struct ostream *output)
-{
-	i_assert(name != NULL);
-
-	conn->list = list;
-	conn->name = i_strdup(name);
-	conn->fd_in = i_stream_get_fd(input);
-	conn->fd_out = o_stream_get_fd(output);
-
-	i_assert(conn->fd_in >= 0);
-	i_assert(conn->fd_out >= 0);
-	i_assert(conn->io == NULL);
-	i_assert(conn->input == NULL);
-	i_assert(conn->output == NULL);
-	i_assert(conn->to == NULL);
-
-	conn->input = input;
-	i_stream_set_name(conn->input, conn->name);
-
-	conn->output = output;
-	o_stream_set_no_error_handling(conn->output, TRUE);
-	o_stream_set_name(conn->output, conn->name);
-
-	conn->io = io_add_istream(conn->input, *list->v.input, conn);
-	
-	DLLIST_PREPEND(&list->connections, conn);
-	list->connections_count++;
-
-	if (list->v.client_connected != NULL)
-		list->v.client_connected(conn, TRUE);
-}
-
 static void
 http_client_connection_tunnel_response(const struct http_response *response,
 			       struct http_client_connection *conn)
@@ -1196,7 +1160,7 @@
 	http_client_request_start_tunnel(conn->connect_request, &tunnel);
 	conn->connect_request = NULL;
 
-	_connection_init_from_streams
+	connection_init_from_streams
 		(conn->client->conn_list, &conn->conn, name, tunnel.input, tunnel.output);
 	conn->connect_initialized = TRUE;
 }


More information about the dovecot-cvs mailing list