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:
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;
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue