Separate iochannel implementation from HCConn interface.
[cascardo/rnetproxy.git] / null.c
diff --git a/null.c b/null.c
index 64cb074..a543af8 100644 (file)
--- a/null.c
+++ b/null.c
@@ -49,6 +49,7 @@ static void null_error (net_hook_t* hook)
 static net_hook_t* null_server_hook_new (net_hook_t* client_hook, char *server)
 {
   net_hook_t* hook;
+  int fd;
   hook = g_slice_new (net_hook_t);
   hook->peer = client_hook;
   hook->server = TRUE;
@@ -56,7 +57,9 @@ 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;
-  hook->conn = hc_conn_new (hc_tcp_connect (server, "110"), nethook_event, hook);
+  hook->conn = hc_conn_new (nethook_event, hook);
+  fd = hc_tcp_connect (server, "110");
+  hc_conn_set_driver_channel (hook->conn, fd);
   return hook;
 }