projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
294ce72
)
Configure events after obtaining a socket.
author
Guus Sliepen
<guus@tinc-vpn.org>
Thu, 17 May 2007 21:47:27 +0000
(21:47 +0000)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Thu, 17 May 2007 21:47:27 +0000
(21:47 +0000)
src/net_socket.c
patch
|
blob
|
history
diff --git
a/src/net_socket.c
b/src/net_socket.c
index
7fe80b2
..
9cb2ecd
100644
(file)
--- a/
src/net_socket.c
+++ b/
src/net_socket.c
@@
-395,17
+395,16
@@
void setup_outgoing_connection(outgoing_t *outgoing)
c->outgoing = outgoing;
c->last_ping_time = now;
c->outgoing = outgoing;
c->last_ping_time = now;
+ connection_add(c);
+
+ do_outgoing_connection(c);
+
event_set(&c->ev, c->socket, EV_READ | EV_PERSIST, handle_meta_connection_data, c);
event_set(&c->outev, c->socket, EV_WRITE | EV_PERSIST, flush_meta, c);
if(event_add(&c->ev, NULL) < 0) {
event_set(&c->ev, c->socket, EV_READ | EV_PERSIST, handle_meta_connection_data, c);
event_set(&c->outev, c->socket, EV_WRITE | EV_PERSIST, flush_meta, c);
if(event_add(&c->ev, NULL) < 0) {
- logger(LOG_ERR, _("event_add failed: %s"), strerror(errno));
- connection_del(c);
- return;
+ logger(LOG_EMERG, _("event_add failed: %s"), strerror(errno));
+ abort();
}
}
-
- connection_add(c);
-
- do_outgoing_connection(c);
}
/*
}
/*