Make null hook use SSL connection driver and pop3s port by default.
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Fri, 3 Jul 2009 04:49:54 +0000 (01:49 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Fri, 3 Jul 2009 04:49:54 +0000 (01:49 -0300)
This null hook should get parameters for both the port and SSL support.
Using URIs would be the best way to do it.

null.c

diff --git a/null.c b/null.c
index a543af8..2e3e265 100644 (file)
--- a/null.c
+++ b/null.c
@@ -50,6 +50,7 @@ static net_hook_t* null_server_hook_new (net_hook_t* client_hook, char *server)
 {
   net_hook_t* hook;
   int fd;
+  HCConn *conn;
   hook = g_slice_new (net_hook_t);
   hook->peer = client_hook;
   hook->server = TRUE;
@@ -57,9 +58,11 @@ static net_hook_t* null_server_hook_new (net_hook_t* client_hook, char *server)
   hook->close = null_close;
   hook->read = null_read;
   hook->data = NULL;
+  conn = hc_conn_new (NULL, NULL);
   hook->conn = hc_conn_new (nethook_event, hook);
-  fd = hc_tcp_connect (server, "110");
-  hc_conn_set_driver_channel (hook->conn, fd);
+  fd = hc_tcp_connect (server, "995");
+  hc_conn_set_driver_channel (conn, fd);
+  hc_conn_set_driver_ssl (hook->conn, conn);
   return hook;
 }