0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

Fix a possible crash with SSL connections closing early.

libratbox r25356 (jilles)
This commit is contained in:
Jilles Tjoelker 2008-05-12 19:54:24 +02:00
parent 3c95b6e72f
commit 2142f6910e

View file

@ -82,6 +82,7 @@ rb_ssl_tryaccept(rb_fde_t * F, void *data)
int ssl_err;
lrb_assert(F->accept != NULL);
int flags;
struct acceptdata *ad;
if(!SSL_is_init_finished((SSL *) F->ssl))
{
@ -111,11 +112,12 @@ rb_ssl_tryaccept(rb_fde_t * F, void *data)
}
rb_settimeout(F, 0, NULL, NULL);
rb_setselect(F, RB_SELECT_READ | RB_SELECT_WRITE, NULL, NULL);
F->accept->callback(F, RB_OK, (struct sockaddr *) &F->accept->S, F->accept->addrlen,
F->accept->data);
rb_free(F->accept);
ad = F->accept;
F->accept = NULL;
ad->callback(F, RB_OK, (struct sockaddr *) &ad->S, ad->addrlen,
ad->data);
rb_free(ad);
}