mirror of
https://github.com/sogou/workflow.git
synced 2026-02-08 01:33:17 +08:00
Remove SSL
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <functional>
|
||||
#include <openssl/ssl.h>
|
||||
#include "json_parser.h"
|
||||
#include "StringUtil.h"
|
||||
#include "URIParser.h"
|
||||
@@ -47,7 +46,6 @@ WFConsulTask::WFConsulTask(const std::string& proxy_url,
|
||||
this->retry_max = retry_max;
|
||||
this->finish = false;
|
||||
this->consul_index = 0;
|
||||
this->ssl_ctx = NULL;
|
||||
}
|
||||
|
||||
void WFConsulTask::set_service(const struct protocol::ConsulService *service)
|
||||
@@ -172,9 +170,6 @@ void WFConsulTask::dispatch()
|
||||
return;
|
||||
}
|
||||
|
||||
auto *t = (WFComplexClientTask<HttpRequest, HttpResponse> *)task;
|
||||
t->set_ssl_ctx(this->ssl_ctx);
|
||||
|
||||
series_of(this)->push_front(this);
|
||||
series_of(this)->push_front(task);
|
||||
this->subtask_done();
|
||||
@@ -400,8 +395,7 @@ void WFConsulTask::register_callback(WFHttpTask *task)
|
||||
t->finish = true;
|
||||
}
|
||||
|
||||
int WFConsulClient::init(const std::string& proxy_url, ConsulConfig config,
|
||||
SSL_CTX *ssl_ctx)
|
||||
int WFConsulClient::init(const std::string& proxy_url, ConsulConfig config)
|
||||
{
|
||||
ParsedURI uri;
|
||||
|
||||
@@ -417,7 +411,6 @@ int WFConsulClient::init(const std::string& proxy_url, ConsulConfig config,
|
||||
}
|
||||
|
||||
this->config = std::move(config);
|
||||
this->ssl_ctx = ssl_ctx;
|
||||
return 0;
|
||||
}
|
||||
else if (uri.state == URI_STATE_INVALID)
|
||||
@@ -437,7 +430,6 @@ WFConsulTask *WFConsulClient::create_discover_task(
|
||||
std::move(cb));
|
||||
task->set_api_type(CONSUL_API_TYPE_DISCOVER);
|
||||
task->set_config(this->config);
|
||||
task->set_ssl_ctx(this->ssl_ctx);
|
||||
return task;
|
||||
}
|
||||
|
||||
@@ -451,7 +443,6 @@ WFConsulTask *WFConsulClient::create_list_service_task(
|
||||
std::move(cb));
|
||||
task->set_api_type(CONSUL_API_TYPE_LIST_SERVICE);
|
||||
task->set_config(this->config);
|
||||
task->set_ssl_ctx(this->ssl_ctx);
|
||||
return task;
|
||||
}
|
||||
|
||||
@@ -467,7 +458,6 @@ WFConsulTask *WFConsulClient::create_register_task(
|
||||
std::move(cb));
|
||||
task->set_api_type(CONSUL_API_TYPE_REGISTER);
|
||||
task->set_config(this->config);
|
||||
task->set_ssl_ctx(this->ssl_ctx);
|
||||
return task;
|
||||
}
|
||||
|
||||
@@ -482,7 +472,6 @@ WFConsulTask *WFConsulClient::create_deregister_task(
|
||||
std::move(cb));
|
||||
task->set_api_type(CONSUL_API_TYPE_DEREGISTER);
|
||||
task->set_config(this->config);
|
||||
task->set_ssl_ctx(this->ssl_ctx);
|
||||
return task;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <functional>
|
||||
#include <openssl/ssl.h>
|
||||
#include "HttpMessage.h"
|
||||
#include "WFTaskFactory.h"
|
||||
#include "ConsulDataTypes.h"
|
||||
@@ -84,11 +83,6 @@ protected:
|
||||
this->config = std::move(conf);
|
||||
}
|
||||
|
||||
void set_ssl_ctx(SSL_CTX *ssl_ctx)
|
||||
{
|
||||
this->ssl_ctx = ssl_ctx;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void dispatch();
|
||||
virtual SubTask *done();
|
||||
@@ -108,7 +102,6 @@ protected:
|
||||
|
||||
protected:
|
||||
protocol::ConsulConfig config;
|
||||
SSL_CTX *ssl_ctx;
|
||||
struct protocol::ConsulService service;
|
||||
std::string proxy_url;
|
||||
int retry_max;
|
||||
@@ -134,22 +127,10 @@ public:
|
||||
// example: http://127.0.0.1:8500
|
||||
int init(const std::string& proxy_url)
|
||||
{
|
||||
return this->init(proxy_url, NULL);
|
||||
return this->init(proxy_url, protocol::ConsulConfig());
|
||||
}
|
||||
|
||||
int init(const std::string& proxy_url, protocol::ConsulConfig config)
|
||||
{
|
||||
return this->init(proxy_url, std::move(config), NULL);
|
||||
}
|
||||
|
||||
// with specific SSL_CTX
|
||||
int init(const std::string& proxy_url, SSL_CTX *ctx_ctx)
|
||||
{
|
||||
return this->init(proxy_url, protocol::ConsulConfig(), ssl_ctx);
|
||||
}
|
||||
|
||||
int init(const std::string& proxy_url, protocol::ConsulConfig config,
|
||||
SSL_CTX *ctx);
|
||||
int init(const std::string& proxy_url, protocol::ConsulConfig config);
|
||||
|
||||
void deinit() { }
|
||||
|
||||
@@ -176,7 +157,6 @@ public:
|
||||
protected:
|
||||
std::string proxy_url;
|
||||
protocol::ConsulConfig config;
|
||||
SSL_CTX *ssl_ctx;
|
||||
|
||||
public:
|
||||
virtual ~WFConsulClient() { }
|
||||
|
||||
Reference in New Issue
Block a user