Fix compilation for ubuntu 18.04 LTS

Ubuntu 18.04 still ships OpenSSL 1.1.0g which has bugs in BIO API, this
commit work around those bugs
This commit is contained in:
Gioacchino Mazzurco 2018-11-06 13:02:56 +01:00
parent d00d0816ff
commit a3c81e163d
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051

View File

@ -267,17 +267,16 @@ static long tou_socket_ctrl(BIO *b, int cmd, long num, void *ptr)
break;
case BIO_C_SET_FD:
tou_socket_free(b);
ret = BIO_meth_get_ctrl(BIO_s_fd())(b,cmd,num,ptr);
ret = BIO_meth_get_ctrl((BIO_METHOD*)BIO_s_fd())(b,cmd,num,ptr);
break;
case BIO_C_GET_FD:
ret = BIO_meth_get_ctrl(BIO_s_fd())(b,cmd,num,ptr);
ret = BIO_meth_get_ctrl((BIO_METHOD*)BIO_s_fd())(b,cmd,num,ptr);
break;
case BIO_CTRL_GET_CLOSE:
ret = BIO_meth_get_ctrl(BIO_s_fd())(b,cmd,num,ptr);
ret = BIO_meth_get_ctrl((BIO_METHOD*)BIO_s_fd())(b,cmd,num,ptr);
break;
case BIO_CTRL_SET_CLOSE:
ret = BIO_meth_get_ctrl(BIO_s_fd())(b,cmd,num,ptr);
ret = BIO_meth_get_ctrl((BIO_METHOD*)BIO_s_fd())(b,cmd,num,ptr);
break;
case BIO_CTRL_PENDING:
ret = tou_maxread(BIO_get_fd(b,NULL));