diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-02-04 11:55:35 +0300 |
---|---|---|
committer | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-02-10 18:49:01 +0300 |
commit | bcbb30afe2ef51c7affaaa7ce4db67e26e7ff6b7 (patch) | |
tree | 79a5e9ead19f3931df04ffca46727b8096c1fec4 /include | |
parent | b0593c086dd303af31dc1e30233149978dd613c4 (diff) |
add BIO_socket_wait(), BIO_wait(), and BIO_connect_retry() improving timeout support
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/10667)
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/sockets.h | 7 | ||||
-rw-r--r-- | include/openssl/bio.h | 3 | ||||
-rw-r--r-- | include/openssl/bioerr.h | 3 |
3 files changed, 13 insertions, 0 deletions
diff --git a/include/internal/sockets.h b/include/internal/sockets.h index e444766dec..97ae2f6dcd 100644 --- a/include/internal/sockets.h +++ b/include/internal/sockets.h @@ -152,4 +152,11 @@ struct servent *PASCAL getservbyname(const char *, const char *); # define writesocket(s,b,n) write((s),(b),(n)) # endif +/* also in apps/include/apps.h */ +# if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINCE) +# define openssl_fdset(a,b) FD_SET((unsigned int)a, b) +# else +# define openssl_fdset(a,b) FD_SET(a, b) +# endif + #endif diff --git a/include/openssl/bio.h b/include/openssl/bio.h index 6b494a1026..1a06d72dc0 100644 --- a/include/openssl/bio.h +++ b/include/openssl/bio.h @@ -661,6 +661,9 @@ int BIO_dgram_sctp_msg_waiting(BIO *b); # ifndef OPENSSL_NO_SOCK int BIO_sock_should_retry(int i); int BIO_sock_non_fatal_error(int error); +int BIO_socket_wait(int fd, int for_read, time_t max_time); +int BIO_wait(BIO *bio, time_t max_time); +int BIO_connect_retry(BIO *bio, int timeout); # endif int BIO_fd_should_retry(int i); diff --git a/include/openssl/bioerr.h b/include/openssl/bioerr.h index 46e1840700..95cc05651f 100644 --- a/include/openssl/bioerr.h +++ b/include/openssl/bioerr.h @@ -97,6 +97,7 @@ int ERR_load_BIO_strings(void); # define BIO_R_BAD_FOPEN_MODE 101 # define BIO_R_BROKEN_PIPE 124 # define BIO_R_CONNECT_ERROR 103 +# define BIO_R_CONNECT_TIMEOUT 147 # define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107 # define BIO_R_GETSOCKNAME_ERROR 132 # define BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS 133 @@ -114,6 +115,8 @@ int ERR_load_BIO_strings(void); # define BIO_R_NO_PORT_DEFINED 113 # define BIO_R_NO_SUCH_FILE 128 # define BIO_R_NULL_PARAMETER 115 +# define BIO_R_TRANSFER_ERROR 104 +# define BIO_R_TRANSFER_TIMEOUT 105 # define BIO_R_UNABLE_TO_BIND_SOCKET 117 # define BIO_R_UNABLE_TO_CREATE_SOCKET 118 # define BIO_R_UNABLE_TO_KEEPALIVE 137 |