diff options
author | unknown <knielsen@knielsen-hq.org> | 2012-12-18 15:01:58 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2012-12-18 15:01:58 +0100 |
commit | 701419b02f12688188a7d4183523e0f5ee9ae09a (patch) | |
tree | 9cad9901bbf188c5ab30aeb31f10c71f61921312 /plugin | |
parent | 4923d19b7c3c4c034f70ac1411837afa75c4b6ad (diff) | |
parent | 6c3de76ad5cb8683ab8b049e0bbba670115d304a (diff) | |
download | mariadb-git-701419b02f12688188a7d4183523e0f5ee9ae09a.tar.gz |
Merge MariaDB 10.0-base to MariaDB 10.0
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/audit_null/audit_null.c | 2 | ||||
-rw-r--r-- | plugin/feedback/CMakeLists.txt | 12 | ||||
-rw-r--r-- | plugin/feedback/url_http.cc | 36 |
3 files changed, 31 insertions, 19 deletions
diff --git a/plugin/audit_null/audit_null.c b/plugin/audit_null/audit_null.c index 469e5ae494c..be0c70fbd35 100644 --- a/plugin/audit_null/audit_null.c +++ b/plugin/audit_null/audit_null.c @@ -145,7 +145,7 @@ mysql_declare_plugin(audit_null) { MYSQL_AUDIT_PLUGIN, /* type */ &audit_null_descriptor, /* descriptor */ - "NULL_AUDIT", /* name */ + "AUDIT_NULL", /* name */ "Oracle Corp", /* author */ "Simple NULL Audit", /* description */ PLUGIN_LICENSE_GPL, diff --git a/plugin/feedback/CMakeLists.txt b/plugin/feedback/CMakeLists.txt index 627e4d643fb..3e14ef3918b 100644 --- a/plugin/feedback/CMakeLists.txt +++ b/plugin/feedback/CMakeLists.txt @@ -1,9 +1,11 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/regex - ${CMAKE_SOURCE_DIR}/extra/yassl/include) + ${SSL_INCLUDE_DIRS}) SET(FEEDBACK_SOURCES feedback.cc sender_thread.cc url_base.cc url_http.cc utils.cc) +ADD_DEFINITIONS(${SSL_DEFINES}) + INCLUDE (CheckIncludeFiles) CHECK_INCLUDE_FILES (netdb.h HAVE_NETDB_H) IF(HAVE_NETDB_H) @@ -11,8 +13,10 @@ IF(HAVE_NETDB_H) ENDIF(HAVE_NETDB_H) IF(WIN32) - #SET(FEEDBACK_LIBS Ws2_32) - MYSQL_ADD_PLUGIN(FEEDBACK ${FEEDBACK_SOURCES} STATIC_ONLY DEFAULT) + MYSQL_ADD_PLUGIN(FEEDBACK ${FEEDBACK_SOURCES} + LINK_LIBRARIES ${SSL_LIBRARIES} + STATIC_ONLY DEFAULT) ELSE(WIN32) - MYSQL_ADD_PLUGIN(FEEDBACK ${FEEDBACK_SOURCES}) + MYSQL_ADD_PLUGIN(FEEDBACK ${FEEDBACK_SOURCES} + LINK_LIBRARIES ${SSL_LIBRARIES}) ENDIF(WIN32) diff --git a/plugin/feedback/url_http.cc b/plugin/feedback/url_http.cc index a9d4c5bbbaf..f214f7a6ccc 100644 --- a/plugin/feedback/url_http.cc +++ b/plugin/feedback/url_http.cc @@ -29,12 +29,6 @@ namespace feedback { static const uint FOR_READING= 0; static const uint FOR_WRITING= 1; -#ifdef MARIADB_BASE_VERSION -#define ssl_connect(A,B,C,D) sslconnect(A,B,C,D) -#else -#define ssl_connect(A,B,C,D) sslconnect(A,B,C) -#endif - /** implementation of the Url class that sends the data via HTTP POST request. @@ -199,12 +193,23 @@ int Url_http::send(const char* data, size_t data_length) struct st_VioSSLFd *UNINIT_VAR(ssl_fd); if (ssl) { - buf[0]= 0; - if (!(ssl_fd= new_VioSSLConnectorFd(0, 0, 0, 0, 0)) || - ssl_connect(ssl_fd, vio, send_timeout, buf)) + enum enum_ssl_init_error ssl_init_error= SSL_INITERR_NOERROR; + ulong ssl_error= 0; + if (!(ssl_fd= new_VioSSLConnectorFd(0, 0, 0, 0, 0, &ssl_init_error, 0, 0)) || + sslconnect(ssl_fd, vio, send_timeout, &ssl_error)) { + const char *err; + if (ssl_init_error != SSL_INITERR_NOERROR) + err= sslGetErrString(ssl_init_error); + else + { + ERR_error_string_n(ssl_error, buf, sizeof(buf)); + buf[sizeof(buf)-1]= 0; + err= buf; + } + sql_print_error("feedback plugin: ssl failed for url '%s' %s", - full_url.str, buf); + full_url.str, err); if (ssl_fd) free_vio_ssl_acceptor_fd(ssl_fd); closesocket(fd); @@ -256,18 +261,21 @@ int Url_http::send(const char* data, size_t data_length) Extract the first string between <h1>...</h1> tags and put it as a server reply into the error log. */ + len= 0; for (;;) { - size_t i= vio_read(vio, (uchar*)buf + len, sizeof(buf) - len - 1); + size_t i= sizeof(buf) - len - 1; + if (i) + i= vio_read(vio, (uchar*)buf + len, i); if ((int)i <= 0) break; len+= i; } - if (len && len < sizeof(buf)) + if (len) { char *from; - buf[len+1]= 0; // safety + buf[len]= 0; // safety if ((from= strstr(buf, "<h1>"))) { @@ -296,7 +304,7 @@ int Url_http::send(const char* data, size_t data_length) if (ssl) { SSL_CTX_free(ssl_fd->ssl_context); - my_free(ssl_fd, MYF(0)); + my_free(ssl_fd); } #endif |