mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-11-29 18:37:41 +08:00
use sslbase_conf/sslbase_io other than polarssl_conf/polarssl_io
This commit is contained in:
parent
7c86d76c33
commit
d8518893b2
@ -21,8 +21,8 @@ class aio_socket_stream;
|
||||
class socket_stream;
|
||||
class zlib_stream;
|
||||
class websocket;
|
||||
class polarssl_conf;
|
||||
class polarssl_io;
|
||||
class sslbase_conf;
|
||||
class sslbase_io;
|
||||
class http_header;
|
||||
|
||||
/**
|
||||
@ -37,9 +37,9 @@ public:
|
||||
/**
|
||||
* 构造函数
|
||||
* @param handle {aio_handle&} 异步通信事件引擎句柄
|
||||
* @param ssl_conf {polarssl_conf*} 非 NULL 时自动采用 SSL 通信方式
|
||||
* @param ssl_conf {sslbase_conf*} 非 NULL 时自动采用 SSL 通信方式
|
||||
*/
|
||||
http_aclient(aio_handle& handle, polarssl_conf* ssl_conf = NULL);
|
||||
http_aclient(aio_handle& handle, sslbase_conf* ssl_conf = NULL);
|
||||
virtual ~http_aclient(void);
|
||||
|
||||
/**
|
||||
@ -74,16 +74,16 @@ public:
|
||||
* 构造函数中设置的 ssl_conf 为 NULL,则内部自动将 ssl_enable_ 置为
|
||||
* false,通过本方法设置了 ssl_conf 后还需调用下面的 enable_ssl()
|
||||
* 方法以启用 ssl 功能
|
||||
* @param ssl_conf {polarssl_conf*} 为 NULL 时将取消 SSL功能
|
||||
* @param ssl_conf {sslbase_conf*} 为 NULL 时将取消 SSL功能
|
||||
* @return {http_aclient&}
|
||||
*/
|
||||
http_aclient& set_ssl_conf(polarssl_conf* ssl_conf);
|
||||
http_aclient& set_ssl_conf(sslbase_conf* ssl_conf);
|
||||
|
||||
/**
|
||||
* 获得设置的 SSL 配置
|
||||
* @return {polarssl_conf*} 为 NULL 表示未设置
|
||||
* @return {sslbase_conf*} 为 NULL 表示未设置
|
||||
*/
|
||||
polarssl_conf* get_ssl_conf(void) const
|
||||
sslbase_conf* get_ssl_conf(void) const
|
||||
{
|
||||
return ssl_conf_;
|
||||
}
|
||||
@ -384,7 +384,7 @@ protected:
|
||||
bool keep_alive_;
|
||||
bool unzip_; // 是否自动解压响应体数据
|
||||
aio_handle& handle_;
|
||||
polarssl_conf* ssl_conf_; // 非空时才允许启用 SSL 功能
|
||||
sslbase_conf* ssl_conf_; // 非空时才允许启用 SSL 功能
|
||||
bool ssl_enable_; // 是否启用 SSL 功能
|
||||
aio_socket_stream* conn_;
|
||||
socket_stream* stream_;
|
||||
|
@ -10,7 +10,7 @@ class http_client;
|
||||
class http_pipe;
|
||||
class socket_stream;
|
||||
class charset_conv;
|
||||
class polarssl_conf;
|
||||
class sslbase_conf;
|
||||
class xml;
|
||||
class json;
|
||||
|
||||
@ -60,10 +60,10 @@ public:
|
||||
|
||||
/**
|
||||
* 设置客户端 SSL 通信方式,内部缺省为非 SSL 通信方式
|
||||
* @param conf {polarssl_conf*} 客户端 SSL 配置对象
|
||||
* @param conf {sslbase_conf*} 客户端 SSL 配置对象
|
||||
* @return {http_request&}
|
||||
*/
|
||||
http_request& set_ssl(polarssl_conf* conf);
|
||||
http_request& set_ssl(sslbase_conf* conf);
|
||||
|
||||
/**
|
||||
* 获得 HTTP 请求头对象,然后在返回的 HTTP 请求头对象中添加
|
||||
@ -310,7 +310,7 @@ protected:
|
||||
private:
|
||||
char addr_[64];
|
||||
bool unzip_;
|
||||
polarssl_conf* ssl_conf_;
|
||||
sslbase_conf* ssl_conf_;
|
||||
char local_charset_[64];
|
||||
charset_conv* conv_;
|
||||
http_client* client_;
|
||||
|
@ -5,7 +5,7 @@
|
||||
namespace acl
|
||||
{
|
||||
|
||||
class polarssl_conf;
|
||||
class sslbase_conf;
|
||||
|
||||
/**
|
||||
* HTTP 客户端请求连接池管理类
|
||||
@ -18,9 +18,9 @@ public:
|
||||
|
||||
/**
|
||||
* 调用本函数设置 SSL 的客户端模式
|
||||
* @param ssl_conf {polarssl_conf*}
|
||||
* @param ssl_conf {sslbase_conf*}
|
||||
*/
|
||||
void set_ssl(polarssl_conf* ssl_conf);
|
||||
void set_ssl(sslbase_conf* ssl_conf);
|
||||
|
||||
protected:
|
||||
/**
|
||||
@ -34,7 +34,7 @@ protected:
|
||||
connect_pool* create_pool(const char* addr, size_t count, size_t idx);
|
||||
|
||||
private:
|
||||
polarssl_conf* ssl_conf_;
|
||||
sslbase_conf* ssl_conf_;
|
||||
};
|
||||
|
||||
} // namespace acl
|
||||
|
@ -5,7 +5,7 @@
|
||||
namespace acl
|
||||
{
|
||||
|
||||
class polarssl_conf;
|
||||
class sslbase_conf;
|
||||
|
||||
/**
|
||||
* http 客户端连接池类,该类父类为 connect_pool,该类只需实现父类中的虚函数
|
||||
@ -29,16 +29,16 @@ public:
|
||||
|
||||
/**
|
||||
* 调用本函数设置 SSL 的客户端模式
|
||||
* @param ssl_conf {polarssl_conf*}
|
||||
* @param ssl_conf {sslbase_conf*}
|
||||
*/
|
||||
void set_ssl(polarssl_conf* ssl_conf);
|
||||
void set_ssl(sslbase_conf* ssl_conf);
|
||||
|
||||
protected:
|
||||
// 基类纯虚函数,该函数返回后由基类设置该连接池的网络连接及网络 IO 超时时间
|
||||
virtual connect_client* create_connect();
|
||||
|
||||
private:
|
||||
polarssl_conf* ssl_conf_;
|
||||
sslbase_conf* ssl_conf_;
|
||||
};
|
||||
|
||||
class ACL_CPP_API http_guard : public connect_guard
|
||||
|
@ -13,7 +13,7 @@ namespace acl
|
||||
class dbuf_pool;
|
||||
class redis_result;
|
||||
class redis_request;
|
||||
class polarssl_conf;
|
||||
class sslbase_conf;
|
||||
|
||||
/**
|
||||
* redis 客户端对象网络通信类,通过此类将组织好的 redis 请求命令发给 redis
|
||||
@ -44,9 +44,9 @@ public:
|
||||
* 设置 SSL 通信方式下的配置句柄,内部缺省值为 NULL,如果设置了 SSL 连
|
||||
* 接配置对象,则内部切换成 SSL 通信方式
|
||||
* set SSL communication with Redis-server if ssl_conf not NULL
|
||||
* @param ssl_conf {polarssl_conf*}
|
||||
* @param ssl_conf {sslbase_conf*}
|
||||
*/
|
||||
void set_ssl_conf(polarssl_conf* ssl_conf);
|
||||
void set_ssl_conf(sslbase_conf* ssl_conf);
|
||||
|
||||
/**
|
||||
* 调用本函数设置连接 redis 服务的连接密码
|
||||
@ -180,7 +180,7 @@ private:
|
||||
bool slice_req_;
|
||||
bool slice_res_;
|
||||
int dbnum_;
|
||||
polarssl_conf* ssl_conf_;
|
||||
sslbase_conf* ssl_conf_;
|
||||
|
||||
redis_result* get_redis_objects(dbuf_pool* pool, size_t nobjs);
|
||||
redis_result* get_redis_object(dbuf_pool* pool);
|
||||
|
@ -10,7 +10,7 @@
|
||||
namespace acl
|
||||
{
|
||||
|
||||
class polarssl_conf;
|
||||
class sslbase_conf;
|
||||
|
||||
class redis_client_pool;
|
||||
|
||||
@ -140,10 +140,10 @@ public:
|
||||
* 设置 SSL 通信方式下的配置句柄,内部缺省值为 NULL,如果设置了 SSL 连
|
||||
* 接配置对象,则内部切换成 SSL 通信方式
|
||||
* set SSL communication with Redis-server if ssl_conf not NULL
|
||||
* @param ssl_conf {polarssl_conf*}
|
||||
* @param ssl_conf {sslbase_conf*}
|
||||
* @return {redis_client_cluster&}
|
||||
*/
|
||||
redis_client_cluster& set_ssl_conf(polarssl_conf* ssl_conf);
|
||||
redis_client_cluster& set_ssl_conf(sslbase_conf* ssl_conf);
|
||||
|
||||
/**
|
||||
* 设置某个 redis 服务相应的连接密码
|
||||
@ -200,7 +200,7 @@ private:
|
||||
int redirect_max_;
|
||||
int redirect_sleep_;
|
||||
std::map<string, string> passwds_;
|
||||
polarssl_conf* ssl_conf_;
|
||||
sslbase_conf* ssl_conf_;
|
||||
};
|
||||
|
||||
} // namespace acl
|
||||
|
@ -7,7 +7,7 @@
|
||||
namespace acl
|
||||
{
|
||||
|
||||
class polarssl_conf;
|
||||
class sslbase_conf;
|
||||
|
||||
/**
|
||||
* redis 连接池类,该类继承于 connect_pool,在 connect_pool 定义了通用的有关
|
||||
@ -38,10 +38,10 @@ public:
|
||||
* 设置 SSL 通信方式下的配置句柄,内部缺省值为 NULL,如果设置了 SSL 连
|
||||
* 接配置对象,则内部切换成 SSL 通信方式
|
||||
* set SSL communication with Redis-server if ssl_conf not NULL
|
||||
* @param ssl_conf {polarssl_conf*}
|
||||
* @param ssl_conf {sslbase_conf*}
|
||||
* @return {redis_client_pool&}
|
||||
*/
|
||||
redis_client_pool& set_ssl_conf(polarssl_conf* ssl_conf);
|
||||
redis_client_pool& set_ssl_conf(sslbase_conf* ssl_conf);
|
||||
|
||||
/**
|
||||
* 设置连接 redis 服务器的连接密码
|
||||
@ -80,7 +80,7 @@ protected:
|
||||
private:
|
||||
char* pass_;
|
||||
int dbnum_;
|
||||
polarssl_conf* ssl_conf_;
|
||||
sslbase_conf* ssl_conf_;
|
||||
};
|
||||
|
||||
} // namespace acl
|
||||
|
@ -11,7 +11,7 @@ struct SMTP_CLIENT;
|
||||
namespace acl {
|
||||
|
||||
class istream;
|
||||
class polarssl_conf;
|
||||
class sslbase_conf;
|
||||
class mail_message;
|
||||
|
||||
/**
|
||||
@ -60,10 +60,10 @@ public:
|
||||
|
||||
/**
|
||||
* 设置 SSL 数据传输模式
|
||||
* @param ssl_conf {polarssl_conf*} 非空时,指定采用 SSL 传输模式
|
||||
* @param ssl_conf {sslbase_conf*} 非空时,指定采用 SSL 传输模式
|
||||
* @return {smtp_client&}
|
||||
*/
|
||||
smtp_client& set_ssl(polarssl_conf* ssl_conf);
|
||||
smtp_client& set_ssl(sslbase_conf* ssl_conf);
|
||||
|
||||
/**
|
||||
* 获得上次 SMTP 交互过程服务端返回的状态码
|
||||
@ -207,7 +207,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
polarssl_conf* ssl_conf_;
|
||||
sslbase_conf* ssl_conf_;
|
||||
char* addr_;
|
||||
int conn_timeout_;
|
||||
int rw_timeout_;
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include "acl_cpp/stream/aio_handle.hpp"
|
||||
#include "acl_cpp/stream/socket_stream.hpp"
|
||||
#include "acl_cpp/stream/aio_socket_stream.hpp"
|
||||
#include "acl_cpp/stream/polarssl_conf.hpp"
|
||||
#include "acl_cpp/stream/polarssl_io.hpp"
|
||||
#include "acl_cpp/stream/sslbase_conf.hpp"
|
||||
#include "acl_cpp/stream/sslbase_io.hpp"
|
||||
#include "acl_cpp/http/http_header.hpp"
|
||||
#include "acl_cpp/http/websocket.hpp"
|
||||
#include "acl_cpp/http/http_aclient.hpp"
|
||||
@ -22,7 +22,7 @@ enum {
|
||||
HTTP_ACLIENT_STATUS_WS_READING,
|
||||
};
|
||||
|
||||
http_aclient::http_aclient(aio_handle& handle, polarssl_conf* ssl_conf /* NULL */)
|
||||
http_aclient::http_aclient(aio_handle& handle, sslbase_conf* ssl_conf /* NULL */)
|
||||
: status_(HTTP_ACLIENT_STATUS_NONE)
|
||||
, rw_timeout_(0)
|
||||
, gzip_header_left_(0)
|
||||
@ -81,7 +81,7 @@ http_aclient& http_aclient::unzip_body(bool on)
|
||||
return *this;
|
||||
}
|
||||
|
||||
http_aclient& http_aclient::set_ssl_conf(polarssl_conf* ssl_conf)
|
||||
http_aclient& http_aclient::set_ssl_conf(sslbase_conf* ssl_conf)
|
||||
{
|
||||
ssl_conf_ = ssl_conf;
|
||||
return *this;
|
||||
@ -407,7 +407,7 @@ bool http_aclient::handle_ssl_handshake(void)
|
||||
{
|
||||
#if defined(HAS_POLARSSL_DLL) || defined(HAS_POLARSSL)
|
||||
// 否则,则是第一次进行 SSL 握手阶段的 IO 过程
|
||||
polarssl_io* ssl_io = (polarssl_io*) conn_->get_hook();
|
||||
sslbase_io* ssl_io = (sslbase_io*) conn_->get_hook();
|
||||
if (ssl_io == NULL) {
|
||||
logger_error("no ssl_io hooked!");
|
||||
return false;
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include "acl_cpp/stdlib/xml.hpp"
|
||||
#include "acl_cpp/stdlib/json.hpp"
|
||||
#include "acl_cpp/stdlib/string.hpp"
|
||||
#include "acl_cpp/stream/polarssl_conf.hpp"
|
||||
#include "acl_cpp/stream/polarssl_io.hpp"
|
||||
#include "acl_cpp/stream/sslbase_conf.hpp"
|
||||
#include "acl_cpp/stream/sslbase_io.hpp"
|
||||
#include "acl_cpp/stream/socket_stream.hpp"
|
||||
#include "acl_cpp/stdlib/charset_conv.hpp"
|
||||
#include "acl_cpp/stdlib/pipe_stream.hpp"
|
||||
@ -120,7 +120,7 @@ http_request& http_request::set_unzip(bool on)
|
||||
return *this;
|
||||
}
|
||||
|
||||
http_request& http_request::set_ssl(polarssl_conf* ssl_conf)
|
||||
http_request& http_request::set_ssl(sslbase_conf* ssl_conf)
|
||||
{
|
||||
ssl_conf_ = ssl_conf;
|
||||
return *this;
|
||||
|
@ -16,7 +16,7 @@ http_request_manager::~http_request_manager()
|
||||
{
|
||||
}
|
||||
|
||||
void http_request_manager::set_ssl(polarssl_conf* ssl_conf)
|
||||
void http_request_manager::set_ssl(sslbase_conf* ssl_conf)
|
||||
{
|
||||
ssl_conf_ = ssl_conf;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ http_request_pool::~http_request_pool()
|
||||
{
|
||||
}
|
||||
|
||||
void http_request_pool::set_ssl(polarssl_conf* ssl_conf)
|
||||
void http_request_pool::set_ssl(sslbase_conf* ssl_conf)
|
||||
{
|
||||
ssl_conf_ = ssl_conf;
|
||||
}
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include "acl_cpp/stdlib/log.hpp"
|
||||
#include "acl_cpp/stdlib/snprintf.hpp"
|
||||
#include "acl_cpp/stream/socket_stream.hpp"
|
||||
#include "acl_cpp/stream/polarssl_conf.hpp"
|
||||
#include "acl_cpp/stream/polarssl_io.hpp"
|
||||
#include "acl_cpp/stream/sslbase_conf.hpp"
|
||||
#include "acl_cpp/stream/sslbase_io.hpp"
|
||||
#include "acl_cpp/redis/redis_result.hpp"
|
||||
#include "acl_cpp/redis/redis_connection.hpp"
|
||||
#include "acl_cpp/redis/redis_client.hpp"
|
||||
@ -50,7 +50,7 @@ void redis_client::set_check_addr(bool on)
|
||||
check_addr_ = on;
|
||||
}
|
||||
|
||||
void redis_client::set_ssl_conf(polarssl_conf* ssl_conf)
|
||||
void redis_client::set_ssl_conf(sslbase_conf* ssl_conf)
|
||||
{
|
||||
ssl_conf_ = ssl_conf;
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ void redis_client_cluster::set_all_slot(const char* addr, size_t max_conns,
|
||||
}
|
||||
}
|
||||
|
||||
redis_client_cluster& redis_client_cluster::set_ssl_conf(polarssl_conf* ssl_conf)
|
||||
redis_client_cluster& redis_client_cluster::set_ssl_conf(sslbase_conf* ssl_conf)
|
||||
{
|
||||
ssl_conf_ = ssl_conf;
|
||||
return *this;
|
||||
|
@ -24,7 +24,7 @@ redis_client_pool::~redis_client_pool(void)
|
||||
acl_myfree(pass_);
|
||||
}
|
||||
|
||||
redis_client_pool& redis_client_pool::set_ssl_conf(polarssl_conf* ssl_conf)
|
||||
redis_client_pool& redis_client_pool::set_ssl_conf(sslbase_conf* ssl_conf)
|
||||
{
|
||||
ssl_conf_ = ssl_conf;
|
||||
return *this;
|
||||
|
@ -3,8 +3,8 @@
|
||||
#include "acl_cpp/stdlib/log.hpp"
|
||||
#include "acl_cpp/stdlib/util.hpp"
|
||||
#include "acl_cpp/stream/istream.hpp"
|
||||
#include "acl_cpp/stream/polarssl_conf.hpp"
|
||||
#include "acl_cpp/stream/polarssl_io.hpp"
|
||||
#include "acl_cpp/stream/sslbase_conf.hpp"
|
||||
#include "acl_cpp/stream/sslbase_io.hpp"
|
||||
#include "acl_cpp/mime/rfc822.hpp"
|
||||
#include "acl_cpp/smtp/mail_message.hpp"
|
||||
#include "acl_cpp/smtp/smtp_client.hpp"
|
||||
@ -33,7 +33,7 @@ smtp_client::~smtp_client(void)
|
||||
close();
|
||||
}
|
||||
|
||||
smtp_client& smtp_client::set_ssl(polarssl_conf* ssl_conf)
|
||||
smtp_client& smtp_client::set_ssl(sslbase_conf* ssl_conf)
|
||||
{
|
||||
ssl_conf_ = ssl_conf;
|
||||
return *this;
|
||||
|
Loading…
Reference in New Issue
Block a user