+static void
+ssl_connected (HCConn *client_conn, HCEvent event, gpointer data)
+{
+ struct pop_address *address = data;
+ HCConn *server_conn;
+ if (event != HC_EVENT_CONNECT)
+ {
+ g_debug ("Did not get connect event when trying to handshake:"
+ " got %d", event);
+ hc_conn_close (client_conn);
+ return;
+ }
+ server_conn = server_conn_new (address->server, address->port,
+ address->ssl);
+ if (server_conn == NULL)
+ {
+ g_debug ("Failure to create connection to server.");
+ hc_conn_close (client_conn);
+ return;
+ }
+ hc_conn_set_callback (client_conn, push_other, server_conn);
+ hc_conn_set_callback (server_conn, push_other, client_conn);
+}
+