diff options
author | unknown <tonu@hundin.mysql.fi> | 2001-06-08 22:28:57 +0300 |
---|---|---|
committer | unknown <tonu@hundin.mysql.fi> | 2001-06-08 22:28:57 +0300 |
commit | 31eaa188defbc187ce22554e783d358f0509900e (patch) | |
tree | e4b889f31b7f39f63449053c9966b889a695698a /vio/viossl.c | |
parent | ffc92fd01129f5e6d05b2e9727a31d5cc8268342 (diff) | |
download | mariadb-git-31eaa188defbc187ce22554e783d358f0509900e.tar.gz |
Fixed compile-time warnings
vio/viossl.c:
Fixed compile-time warnings by moving code around plus small fixes
Diffstat (limited to 'vio/viossl.c')
-rw-r--r-- | vio/viossl.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/vio/viossl.c b/vio/viossl.c index 696d7d54a29..e4fe9d87228 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -63,6 +63,26 @@ #ifdef HAVE_OPENSSL + +static void +report_errors() +{ + unsigned long l; + const char* file; + const char* data; + int line,flags; + DBUG_ENTER("report_errors"); + + while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0) + { + char buf[200]; + DBUG_PRINT("error", ("OpenSSL: %s:%s:%d:%s\n", ERR_error_string(l,buf), + file,line,(flags&ERR_TXT_STRING)?data:"")) ; + } + DBUG_VOID_RETURN; +} + + void vio_ssl_delete(Vio * vio) { /* It must be safe to delete null pointers. */ @@ -266,24 +286,6 @@ my_bool vio_ssl_poll_read(Vio *vio,uint timeout) } -static void -report_errors() -{ - unsigned long l; - const char* file; - const char* data; - int line,flags; - DBUG_ENTER("report_errors"); - - while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0) - { - char buf[200]; - DBUG_PRINT("error", ("OpenSSL: %s:%s:%d:%s\n", ERR_error_string(l,buf), - file,line,(flags&ERR_TXT_STRING)?data:"")) ; - } - DBUG_VOID_RETURN; -} - /* FIXME: There are some duplicate code in * sslaccept()/sslconnect() which maybe can be eliminated */ @@ -326,7 +328,7 @@ Vio *sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* sd) DBUG_PRINT("enter", ("sd=%s ptr=%p ctx: %p", sd->desc,ptr,ptr->ssl_context_)); vio_reset(sd,VIO_TYPE_SSL,sd->sd,0,FALSE); - ptr->bio_=0; + sd->bio_=0; sd->ssl_=0; sd->open_=FALSE; assert(sd != 0); @@ -339,7 +341,7 @@ Vio *sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* sd) report_errors(); DBUG_RETURN(sd); } - if (!(ptr->bio_ = BIO_new_socket(sd->sd, BIO_NOCLOSE))) + if (!(sd->bio_ = BIO_new_socket(sd->sd, BIO_NOCLOSE))) { DBUG_PRINT("error", ("BIO_new_socket failure")); report_errors(); @@ -347,7 +349,7 @@ Vio *sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* sd) sd->ssl_=0; DBUG_RETURN(sd); } - SSL_set_bio(sd->ssl_, ptr->bio_, ptr->bio_); + SSL_set_bio(sd->ssl_, sd->bio_, sd->bio_); SSL_set_connect_state(sd->ssl_); /* sprintf(ptr->desc_, "VioSSL(%d)", sd->sd); sd->ssl_cip_ = SSL_get_cipher(sd->ssl_);*/ |