projects
/
cascardo
/
rnetproxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove the ssl hook files, since we don't need them any more.
[cascardo/rnetproxy.git]
/
null.c
diff --git
a/null.c
b/null.c
index
fd4de84
..
2e3e265
100644
(file)
--- a/
null.c
+++ b/
null.c
@@
-18,7
+18,6
@@
**
*/
**
*/
-#include <gnet.h>
#include <glib.h>
#include "null.h"
#include <glib.h>
#include "null.h"
@@
-31,19
+30,15
@@
static void null_close (net_hook_t* hook)
if (hook->peer)
{
hook->peer->peer = NULL;
if (hook->peer)
{
hook->peer->peer = NULL;
-
gnet_conn_disconnect
(hook->peer->conn);
+
hc_conn_close
(hook->peer->conn);
}
}
-
gnet_conn_delet
e (hook->conn);
+
hc_conn_clos
e (hook->conn);
g_slice_free (net_hook_t, hook);
}
g_slice_free (net_hook_t, hook);
}
-static void null_write (net_hook_t* hook)
-{
-}
-
static void null_read (net_hook_t* hook, gchar* buffer, size_t len)
{
static void null_read (net_hook_t* hook, gchar* buffer, size_t len)
{
-
gnet
_conn_write (hook->peer->conn, buffer, len);
+
hc
_conn_write (hook->peer->conn, buffer, len);
}
static void null_error (net_hook_t* hook)
}
static void null_error (net_hook_t* hook)
@@
-54,21
+49,24
@@
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;
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 = g_slice_new (net_hook_t);
- hook->conn = gnet_conn_new (server, 110, nethook_event, hook);
hook->peer = client_hook;
hook->server = TRUE;
hook->connect = null_connect;
hook->close = null_close;
hook->peer = client_hook;
hook->server = TRUE;
hook->connect = null_connect;
hook->close = null_close;
- hook->write = null_write;
hook->read = null_read;
hook->data = NULL;
hook->read = null_read;
hook->data = NULL;
- gnet_conn_connect (hook->conn);
- gnet_conn_read (hook->conn);
+ conn = hc_conn_new (NULL, NULL);
+ hook->conn = hc_conn_new (nethook_event, hook);
+ fd = hc_tcp_connect (server, "995");
+ hc_conn_set_driver_channel (conn, fd);
+ hc_conn_set_driver_ssl (hook->conn, conn);
return hook;
}
return hook;
}
-net_hook_t* null_hook_new (
G
Conn* conn, char *server)
+net_hook_t* null_hook_new (
HC
Conn* conn, char *server)
{
net_hook_t* hook;
hook = g_slice_new (net_hook_t);
{
net_hook_t* hook;
hook = g_slice_new (net_hook_t);
@@
-77,11
+75,10
@@
net_hook_t* null_hook_new (GConn* conn, char *server)
hook->server = FALSE;
hook->connect = null_connect;
hook->close = null_close;
hook->server = FALSE;
hook->connect = null_connect;
hook->close = null_close;
- hook->write = null_write;
hook->read = null_read;
hook->data = server;
hook->peer = null_server_hook_new (hook, server);
hook->read = null_read;
hook->data = server;
hook->peer = null_server_hook_new (hook, server);
-
gnet
_conn_set_callback (hook->conn, nethook_event, hook);
+
hc
_conn_set_callback (hook->conn, nethook_event, hook);
return hook;
}
return hook;
}