Fixed UDP bug (Congrats to Sehraf for finding this!)

This commit is contained in:
csoler 2020-01-19 20:08:58 +01:00
parent 6136ac08f5
commit 912f5de90b
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C

View File

@ -137,18 +137,18 @@ static int tou_socket_read(BIO *b, char *out, int outl)
int ret=0; int ret=0;
if (!out) if (out)
{ {
clear_tou_socket_error(BIO_get_fd(b,NULL)); clear_tou_socket_error(BIO_get_fd(b,NULL));
/* call tou library */ /* call tou library */
ret=tou_read(BIO_get_fd(b,NULL),out,outl); ret=tou_read(BIO_get_fd(b,NULL),out,outl);
BIO_clear_retry_flags(b); BIO_clear_retry_flags(b);
if (ret <= 0) if (ret <= 0)
{ {
if (BIO_tou_socket_should_retry(BIO_get_fd(b,NULL), ret)) if (BIO_tou_socket_should_retry(BIO_get_fd(b,NULL), ret))
BIO_set_retry_read(b); BIO_set_retry_read(b);
}
} }
}
#ifdef DEBUG_TOU_BIO #ifdef DEBUG_TOU_BIO
fprintf(stderr, "tou_socket_read() = %d\n", ret); fprintf(stderr, "tou_socket_read() = %d\n", ret);
#endif #endif