summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2001-07-15 20:12:45 +0000
committerRichard Levitte <levitte@openssl.org>2001-07-15 20:12:45 +0000
commit026dad0f3b872f9030e061174f10afbef0b0c4a1 (patch)
tree13cb0558d86c2b96684efb3fb389cbf02303ee5d
parent6b99c692d0f3b63170fdb0110441ab753c86c35b (diff)
SSL_get_[rw]fd were documented but not implemented.
-rw-r--r--ssl/ssl.h2
-rw-r--r--ssl/ssl_lib.c17
2 files changed, 19 insertions, 0 deletions
diff --git a/ssl/ssl.h b/ssl/ssl.h
index 9de9e611ab..6e67506a75 100644
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -939,6 +939,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 1fe85b6cb7..cd110ca1e6 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -411,6 +411,11 @@ BIO *SSL_get_wbio(SSL *s)
int SSL_get_fd(SSL *s)
{
+ return(SSL_get_rfc(s));
+ }
+
+int SSL_get_rfd(SSL *s)
+ {
int ret= -1;
BIO *b,*r;
@@ -421,6 +426,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 NO_SOCK
int SSL_set_fd(SSL *s,int fd)
{