[core,tcp] replace macros with inline functions
This commit is contained in:
parent
66f31e5bb9
commit
8df1a9a52a
@ -1239,7 +1239,7 @@ HttpResponse* http_response_recv(rdpTls* tls, BOOL readContentLength)
|
||||
char* end = NULL;
|
||||
/* Read until we encounter \r\n\r\n */
|
||||
ERR_clear_error();
|
||||
const int wstatus = BIO_wait_read(tls->bio, timeout);
|
||||
const long wstatus = BIO_wait_read(tls->bio, timeout);
|
||||
if (wstatus < 0)
|
||||
{
|
||||
if (!BIO_should_retry(tls->bio))
|
||||
|
@ -53,15 +53,43 @@
|
||||
#define BIO_C_WAIT_WRITE 1108
|
||||
#define BIO_C_SET_HANDLE 1109
|
||||
|
||||
#define BIO_set_socket(b, s, c) BIO_ctrl(b, BIO_C_SET_SOCKET, c, s);
|
||||
#define BIO_get_socket(b, c) BIO_ctrl(b, BIO_C_GET_SOCKET, 0, (char*)c)
|
||||
#define BIO_get_event(b, c) BIO_ctrl(b, BIO_C_GET_EVENT, 0, (char*)c)
|
||||
#define BIO_set_handle(b, h) BIO_ctrl(b, BIO_C_SET_HANDLE, 0, h)
|
||||
#define BIO_set_nonblock(b, c) BIO_ctrl(b, BIO_C_SET_NONBLOCK, c, NULL)
|
||||
#define BIO_read_blocked(b) BIO_ctrl(b, BIO_C_READ_BLOCKED, 0, NULL)
|
||||
#define BIO_write_blocked(b) BIO_ctrl(b, BIO_C_WRITE_BLOCKED, 0, NULL)
|
||||
#define BIO_wait_read(b, c) BIO_ctrl(b, BIO_C_WAIT_READ, c, NULL)
|
||||
#define BIO_wait_write(b, c) BIO_ctrl(b, BIO_C_WAIT_WRITE, c, NULL)
|
||||
static INLINE long BIO_set_socket(BIO* b, SOCKET* s, long c)
|
||||
{
|
||||
return BIO_ctrl(b, BIO_C_SET_SOCKET, c, s);
|
||||
}
|
||||
static INLINE long BIO_get_socket(BIO* b, SOCKET* c)
|
||||
{
|
||||
return BIO_ctrl(b, BIO_C_GET_SOCKET, 0, c);
|
||||
}
|
||||
static INLINE long BIO_get_event(BIO* b, HANDLE* c)
|
||||
{
|
||||
return BIO_ctrl(b, BIO_C_GET_EVENT, 0, c);
|
||||
}
|
||||
static INLINE long BIO_set_handle(BIO* b, HANDLE* h)
|
||||
{
|
||||
return BIO_ctrl(b, BIO_C_SET_HANDLE, 0, h);
|
||||
}
|
||||
static INLINE long BIO_set_nonblock(BIO* b, long c)
|
||||
{
|
||||
return BIO_ctrl(b, BIO_C_SET_NONBLOCK, c, NULL);
|
||||
}
|
||||
static INLINE long BIO_read_blocked(BIO* b)
|
||||
{
|
||||
return BIO_ctrl(b, BIO_C_READ_BLOCKED, 0, NULL);
|
||||
}
|
||||
static INLINE long BIO_write_blocked(BIO* b)
|
||||
{
|
||||
return BIO_ctrl(b, BIO_C_WRITE_BLOCKED, 0, NULL);
|
||||
}
|
||||
static INLINE long BIO_wait_read(BIO* b, long c)
|
||||
{
|
||||
return BIO_ctrl(b, BIO_C_WAIT_READ, c, NULL);
|
||||
}
|
||||
|
||||
static INLINE long BIO_wait_write(BIO* b, long c)
|
||||
{
|
||||
return BIO_ctrl(b, BIO_C_WAIT_WRITE, c, NULL);
|
||||
}
|
||||
|
||||
FREERDP_LOCAL BIO_METHOD* BIO_s_simple_socket(void);
|
||||
FREERDP_LOCAL BIO_METHOD* BIO_s_buffered_socket(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user