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 | 32692277b9ef3c387eaf88b80dde262272a69b41 (patch) | |
tree | e4b889f31b7f39f63449053c9966b889a695698a /vio | |
parent | 17bc31504df4a9590d9ebb340074aceb509630ca (diff) | |
download | mariadb-git-32692277b9ef3c387eaf88b80dde262272a69b41.tar.gz |
Fixed compile-time warnings
vio/viossl.c:
Fixed compile-time warnings by moving code around plus small fixes
Diffstat (limited to 'vio')
-rw-r--r-- | vio/viossl.c | 44 | ||||
-rw-r--r-- | vio/viosslfactories.c | 4 |
2 files changed, 25 insertions, 23 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_);*/ diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c index dfe67b503f8..4be956ed9ba 100644 --- a/vio/viosslfactories.c +++ b/vio/viosslfactories.c @@ -186,7 +186,7 @@ struct st_VioSSLConnectorFd* new_VioSSLConnectorFd(const char* key_file, DBUG_RETURN(ptr); ctor_failure: DBUG_PRINT("exit", ("there was an error")); - DBUG_VOID_RETURN; + DBUG_RETURN(0); } @@ -267,7 +267,7 @@ new_VioSSLAcceptorFd(const char* key_file, DBUG_RETURN(ptr); ctor_failure: DBUG_PRINT("exit", ("there was an error")); - DBUG_VOID_RETURN; + DBUG_RETURN(0); } |