Skip to content

Commit

Permalink
Merge pull request sogou#402 from Barenboim/master
Browse files Browse the repository at this point in the history
add MySQL SSL client
  • Loading branch information
Barenboim authored Jun 3, 2021
2 parents af43d78 + 7e26feb commit 45ebee2
Show file tree
Hide file tree
Showing 14 changed files with 309 additions and 117 deletions.
4 changes: 4 additions & 0 deletions docs/en/tutorial-12-mysql_cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ After startup, you can directly enter MySQL command in the terminal to interact

mysql://username:password@host:port/dbname?character\_set=charset&character\_set\_results=charset

- set scheme to be **mysqls://** for accessing MySQL with SSL connnection (MySQL server 5.7 or above is required).

- fill in the username and the password for the MySQL database;

- the default port number is 3306;
Expand All @@ -34,6 +36,8 @@ mysql://root:password@127.0.0.1

mysql://@test.mysql.com:3306/db1?character\_set=utf8&character_set_results=utf8

mysqls://localhost/db1?character\_set=big5

# Creating and starting a MySQL task

You can use WFTaskFactory to create a MySQL task. The usage of creating interface and callback functions are similar to other tasks in workflow:
Expand Down
4 changes: 4 additions & 0 deletions docs/tutorial-12-mysql_cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

mysql://username:password@host:port/dbname?character_set=charset&character_set_results=charset

- 如果以SSL连接访问MySQL,则scheme设为**mysqls://**。MySQL server 5.7及以上支持;

- username和password按需填写;

- port默认为3306;
Expand All @@ -33,6 +35,8 @@ mysql://root:password@127.0.0.1

mysql://@test.mysql.com:3306/db1?character_set=utf8&character_set_results=utf8

mysqls://localhost/db1?character\_set=big5

# 创建并启动MySQL任务

用户可以使用WFTaskFactory创建MySQL任务,创建接口与回调函数的用法都与workflow其他任务类似:
Expand Down
5 changes: 1 addition & 4 deletions src/factory/HttpTaskImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,7 @@ CommMessageOut *ComplexHttpProxyTask::message_out()
}

auto *msg = (ProtocolMessage *)this->ComplexHttpTask::message_out();
if (is_ssl_)
return get_ssl_wrapper(msg);

return msg;
return is_ssl_ ? get_ssl_wrapper(msg) : msg;
}

CommMessageIn *ComplexHttpProxyTask::message_in()
Expand Down
Loading

0 comments on commit 45ebee2

Please sign in to comment.