MCPcopy Create free account
hub / github.com/acl-dev/acl / open

Method open

lib_acl_cpp/src/smtp/smtp_client.cpp:113–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113bool smtp_client::open(void)
114{
115 if (stream_.opened()) {
116 acl_assert(client_ != NULL);
117 acl_assert(client_->conn == stream_.get_vstream());
118 reuse_ = true;
119 return true;
120 }
121
122 reuse_ = false;
123
124 client_ = smtp_open(addr_, conn_timeout_, rw_timeout_, 1024);
125 if (client_ == NULL) {
126 logger_error("connect %s error: %s", addr_, last_serror());
127 return false;
128 }
129
130 // ��������ֻ����ʹ�� stream_ ��ҪΪ��ʹ�� SSL ͨ��
131 stream_.open(client_->conn);
132
133 // ��������� SSL ͨ�ŷ�ʽ������Ҫ�� SSL ͨ�Žӿ�
134 if (ssl_conf_) {
135 sslbase_io* ssl = ssl_conf_->create(false);
136 if (stream_.setup_hook(ssl) == ssl) {
137 logger_error("open ssl client error!");
138 ssl->destroy();
139 return false;
140 }
141 }
142
143 return true;
144}
145
146void smtp_client::close(void)
147{

Callers

nothing calls this directly

Calls 7

smtp_openFunction · 0.85
last_serrorFunction · 0.50
openedMethod · 0.45
get_vstreamMethod · 0.45
createMethod · 0.45
setup_hookMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected