mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
Fix a possible crash with SSL connections closing early.
libratbox r25356 (jilles)
This commit is contained in:
parent
3c95b6e72f
commit
2142f6910e
1 changed files with 6 additions and 4 deletions
|
@ -82,6 +82,7 @@ rb_ssl_tryaccept(rb_fde_t * F, void *data)
|
||||||
int ssl_err;
|
int ssl_err;
|
||||||
lrb_assert(F->accept != NULL);
|
lrb_assert(F->accept != NULL);
|
||||||
int flags;
|
int flags;
|
||||||
|
struct acceptdata *ad;
|
||||||
|
|
||||||
if(!SSL_is_init_finished((SSL *) F->ssl))
|
if(!SSL_is_init_finished((SSL *) F->ssl))
|
||||||
{
|
{
|
||||||
|
@ -112,10 +113,11 @@ rb_ssl_tryaccept(rb_fde_t * F, void *data)
|
||||||
rb_settimeout(F, 0, NULL, NULL);
|
rb_settimeout(F, 0, NULL, NULL);
|
||||||
rb_setselect(F, RB_SELECT_READ | RB_SELECT_WRITE, 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,
|
ad = F->accept;
|
||||||
F->accept->data);
|
|
||||||
rb_free(F->accept);
|
|
||||||
F->accept = NULL;
|
F->accept = NULL;
|
||||||
|
ad->callback(F, RB_OK, (struct sockaddr *) &ad->S, ad->addrlen,
|
||||||
|
ad->data);
|
||||||
|
rb_free(ad);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue