commit - de3e5fa77ca1b726fe242d869836d3c1c71c2cfb
commit + 2cebfc54f5c450577e0a6d4f61a421ac2396e44e
blob - 3b0927872374fccddf3fd9de63ef22b8f4e6524a
blob + 324fa4219a9d204723572e1eeb8fbf8ea1badbee
--- src/ngircd/conn.c
+++ src/ngircd/conn.c
if (!ng_ipaddr_tostr_r(dest, ip_str)) {
Log(LOG_WARNING, "New_Server: Could not convert IP to string");
+ Conf_Server[Server].conn_id = NONE;
return;
}
if (new_sock < 0) {
Log(LOG_CRIT, "Can't create socket (af %d): %s!",
af_dest, strerror(errno));
+ Conf_Server[Server].conn_id = NONE;
return;
}
- if (!Init_Socket(new_sock))
+ if (!Init_Socket(new_sock)) {
+ Conf_Server[Server].conn_id = NONE;
return;
+ }
/* is a bind address configured? */
res = ng_ipaddr_af(&Conf_Server[Server].bind_addr);
if(( res != 0 ) && ( errno != EINPROGRESS )) {
Log( LOG_CRIT, "Can't connect socket: %s!", strerror( errno ));
close( new_sock );
+ Conf_Server[Server].conn_id = NONE;
return;
}
"Cannot allocate memory for server connection (socket %d)",
new_sock);
close( new_sock );
+ Conf_Server[Server].conn_id = NONE;
return;
}
if (!io_event_create( new_sock, IO_WANTWRITE, cb_connserver)) {
Log(LOG_ALERT, "io_event_create(): could not add fd %d", strerror(errno));
close(new_sock);
+ Conf_Server[Server].conn_id = NONE;
return;
}
if (!c) {
Log( LOG_ALERT, "Can't establish connection: can't create client structure!" );
io_close(new_sock);
+ Conf_Server[Server].conn_id = NONE;
return;
}