Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
0380b0e2
Commit
0380b0e2
authored
Nov 06, 2012
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build feedback plugin with ssl (changes for cmake).
fix the ssl related code to use newer function prototypes
parent
00e7915f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
15 deletions
+24
-15
plugin/feedback/CMakeLists.txt
plugin/feedback/CMakeLists.txt
+8
-4
plugin/feedback/url_http.cc
plugin/feedback/url_http.cc
+16
-11
No files found.
plugin/feedback/CMakeLists.txt
View file @
0380b0e2
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
)
plugin/feedback/url_http.cc
View file @
0380b0e2
...
...
@@ -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
))
||
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
);
...
...
@@ -296,7 +301,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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment