Skip to content

Commit

Permalink
Add sni checking process before SSL handshake.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengshuxin committed May 25, 2024
1 parent 58058dd commit db9a327
Show file tree
Hide file tree
Showing 17 changed files with 416 additions and 173 deletions.
23 changes: 8 additions & 15 deletions lib_acl_cpp/include/acl_cpp/connpool/connect_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
#include "../acl_cpp_define.hpp"
#include "../stdlib/noncopyable.hpp"

namespace acl
{
namespace acl {

class connect_pool;

class ACL_CPP_API connect_client : public noncopyable
{
class ACL_CPP_API connect_client : public noncopyable {
public:
connect_client(void)
: conn_timeout_(5)
Expand All @@ -22,16 +20,14 @@ class ACL_CPP_API connect_client : public noncopyable
* 获得该连接对象最近一次被使用的时间截
* @return {time_t}
*/
time_t get_when()
{
time_t get_when() const {
return when_;
}

/**
* 设置该连接对象当前被使用的时间截
*/
void set_when(time_t when)
{
void set_when(time_t when) {
when_ = when;
}

Expand All @@ -46,8 +42,7 @@ class ACL_CPP_API connect_client : public noncopyable
* 连接对象会调用 set_pool 设置连接池对象句柄
* @return {connect_pool*}
*/
connect_pool* get_pool() const
{
connect_pool* get_pool() const {
return pool_;
}

Expand All @@ -58,10 +53,9 @@ class ACL_CPP_API connect_client : public noncopyable
* @param conn_timeout {int} 网络连接超时时间(秒)
* @param rw_timeout {int} 网络 IO 超时时间(秒)
*/
virtual void set_timeout(int conn_timeout, int rw_timeout)
{
virtual void set_timeout(int conn_timeout, int rw_timeout) {
conn_timeout_ = conn_timeout;
rw_timeout_ = rw_timeout;
rw_timeout_ = rw_timeout;
}

protected:
Expand All @@ -73,8 +67,7 @@ class ACL_CPP_API connect_client : public noncopyable
time_t when_;
connect_pool* pool_;

void set_pool(connect_pool* pool)
{
void set_pool(connect_pool* pool) {
pool_ = pool;
}
};
Expand Down
Loading

0 comments on commit db9a327

Please sign in to comment.