Convert to libevent.
This is a quick initial conversion that doesn't yet show much advantage: - We roll our own timeouts. - We roll our own signal handling. - We build up the meta connection fd events on each loop rather than on state changes.
This commit is contained in:
parent
834290b00f
commit
38c25d62c2
9 changed files with 129 additions and 110 deletions
|
|
@ -484,7 +484,7 @@ void flush_queue(node_t *n)
|
|||
}
|
||||
}
|
||||
|
||||
void handle_incoming_vpn_data(int sock)
|
||||
void handle_incoming_vpn_data(int sock, short events, void *data)
|
||||
{
|
||||
vpn_packet_t pkt;
|
||||
char *hostname;
|
||||
|
|
@ -515,3 +515,11 @@ void handle_incoming_vpn_data(int sock)
|
|||
|
||||
receive_udppacket(n, &pkt);
|
||||
}
|
||||
|
||||
void handle_device_data(int sock, short events, void *data)
|
||||
{
|
||||
vpn_packet_t packet;
|
||||
|
||||
if(read_packet(&packet))
|
||||
route(myself, &packet);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue