Complete moving all connection related data out of the hub_user object.

This commit is contained in:
Jan Vidar Krey
2009-08-07 00:22:30 +02:00
parent cfb450c3fc
commit 86ba3ca86f
14 changed files with 60 additions and 48 deletions

View File

@@ -104,6 +104,11 @@ static void net_con_event(int fd, short ev, void *arg)
#endif
}
const char* net_con_get_peer_address(struct net_connection* con)
{
return ip_convert_to_string(&con->ipaddr);
}
void net_con_initialize(struct net_connection* con, int sd, struct ip_addr_encap* addr, net_connection_cb callback, const void* ptr, int ev)
{
int events = net_con_convert_to_libevent_mask(ev);

View File

@@ -72,6 +72,12 @@ extern ssize_t net_con_recv(struct net_connection* con, void* buf, size_t len);
extern void net_con_set_timeout(struct net_connection* con, int seconds);
extern void net_con_clear_timeout(struct net_connection* con);
/**
* Returns a string representation of the ipaddr member.
* NOTE: Static buffer.
*/
extern const char* net_con_get_peer_address(struct net_connection* con);
#ifdef SSL_SUPPORT
/**
* Start SSL_accept()