| 219 | int dlen_; |
| 220 | |
| 221 | bool setup_ssl(acl::sslbase_conf& ssl_conf) |
| 222 | { |
| 223 | acl::sslbase_io* ssl = ssl_conf.create(true); |
| 224 | |
| 225 | // �� SSL IO ����ע�����첽���� |
| 226 | if (client_->setup_hook(ssl) == ssl) { |
| 227 | std::cout << "open ssl error!" << std::endl; |
| 228 | ssl->destroy(); |
| 229 | return false; |
| 230 | } |
| 231 | |
| 232 | // ��ʼ SSL ���ֹ��� |
| 233 | if (!ssl->handshake()) { |
| 234 | client_->remove_hook(); |
| 235 | ssl->destroy(); |
| 236 | return false; |
| 237 | } |
| 238 | |
| 239 | if (ssl->handshake_ok()) { |
| 240 | printf("%s: ssl handshake ok\r\n", __FUNCTION__); |
| 241 | client_->disable_read(); |
| 242 | return begin_run(); |
| 243 | } else { |
| 244 | // ��ʼ�첽 SSL ���ֹ��̣�����ɶ�����ʱ������ |
| 245 | // read_wakeup |
| 246 | client_->read_wait(10); |
| 247 | } |
| 248 | return true; |
| 249 | } |
| 250 | |
| 251 | bool begin_run(void) |
| 252 | { |
nothing calls this directly
no test coverage detected