- cp();
-
- if(FD_ISSET(device_fd, f)) {
- if(!read_packet(&packet))
- route_outgoing(&packet);
- }
-
- for(node = connection_tree->head; node; node = node->next) {
- c = (connection_t *) node->data;
-
- if(c->status.remove)
- continue;
-
- if(FD_ISSET(c->socket, f)) {
- if(c->status.connecting) {
- c->status.connecting = 0;
- getsockopt(c->socket, SOL_SOCKET, SO_ERROR, &result, &len);
-
- if(!result)
- finish_connecting(c);
- else {
- if(debug_lvl >= DEBUG_CONNECTIONS)
- syslog(LOG_DEBUG,
- _("Error while connecting to %s (%s): %s"),
- c->name, c->hostname, strerror(result));
- close(c->socket);
- do_outgoing_connection(c);
- continue;
- }
- }