Report errors and close the incoming connection if socketpair fails
for ssl connections. from ircd-ratbox (r26503) (androsyn)
This commit is contained in:
parent
cef0fc6693
commit
6388eda683
1 changed files with 6 additions and 1 deletions
|
@ -552,7 +552,12 @@ accept_ssld(rb_fde_t *F, struct sockaddr *addr, struct sockaddr *laddr, struct L
|
||||||
{
|
{
|
||||||
ssl_ctl_t *ctl;
|
ssl_ctl_t *ctl;
|
||||||
rb_fde_t *xF[2];
|
rb_fde_t *xF[2];
|
||||||
rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF[0], &xF[1], "Incoming ssld Connection");
|
if(rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF[0], &xF[1], "Incoming ssld Connection") == -1)
|
||||||
|
{
|
||||||
|
ilog_error("creating SSL/TLS socket pairs");
|
||||||
|
rb_close(F);
|
||||||
|
return;
|
||||||
|
}
|
||||||
ctl = start_ssld_accept(F, xF[1], rb_get_fd(xF[0])); /* this will close F for us */
|
ctl = start_ssld_accept(F, xF[1], rb_get_fd(xF[0])); /* this will close F for us */
|
||||||
add_connection(listener, xF[0], addr, laddr, ctl);
|
add_connection(listener, xF[0], addr, laddr, ctl);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue