From: Richard Levitte Date: Sun, 15 Jul 2001 20:11:57 +0000 (+0000) Subject: SSL_get_[rw]fd were documented but not implemented. X-Git-Tag: OpenSSL_0_9_6c~182^2~4 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=24cbf3efc68cc3b6f41c39960e72f69b0ed9fe60 SSL_get_[rw]fd were documented but not implemented. --- diff --git a/ssl/ssl.h b/ssl/ssl.h index 216afd917f..61424ebab5 100644 --- a/ssl/ssl.h +++ b/ssl/ssl.h @@ -973,6 +973,8 @@ char * SSL_CIPHER_get_version(SSL_CIPHER *c); const char * SSL_CIPHER_get_name(SSL_CIPHER *c); int SSL_get_fd(SSL *s); +int SSL_get_rfd(SSL *s); +int SSL_get_wfd(SSL *s); const char * SSL_get_cipher_list(SSL *s,int n); char * SSL_get_shared_ciphers(SSL *s, char *buf, int len); int SSL_get_read_ahead(SSL * s); diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index ad1af7cda3..463ed16020 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -444,6 +444,11 @@ BIO *SSL_get_wbio(SSL *s) { return(s->wbio); } int SSL_get_fd(SSL *s) + { + return(SSL_get_rfc(s)); + } + +int SSL_get_rfd(SSL *s) { int ret= -1; BIO *b,*r; @@ -455,6 +460,18 @@ int SSL_get_fd(SSL *s) return(ret); } +int SSL_get_wfd(SSL *s) + { + int ret= -1; + BIO *b,*r; + + b=SSL_get_wbio(s); + r=BIO_find_type(b,BIO_TYPE_DESCRIPTOR); + if (r != NULL) + BIO_get_fd(r,&ret); + return(ret); + } + #ifndef OPENSSL_NO_SOCK int SSL_set_fd(SSL *s,int fd) {