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

Method thread_on_read

lib_acl_cpp/samples/ssl/https_proxy/master_service.cpp:87–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87bool master_service::thread_on_read(acl::socket_stream* conn)
88{
89 http_servlet* servlet = (http_servlet*) conn->get_ctx();
90 if (servlet == NULL) {
91 logger_fatal("servlet null!");
92 }
93
94 if (server_ssl_conf_ == NULL) {
95 return servlet->doRun("127.0.0.1:11211", conn);
96 }
97
98 acl::sslbase_io* ssl = setup_ssl(*conn, *server_ssl_conf_);
99 if (ssl == NULL) {
100 return false;
101 }
102
103 if (!ssl->handshake()) {
104 out_.puts("ssl handshake failed");
105 return false;
106 }
107
108 if (!ssl->handshake_ok()) {
109 out_.puts("handshake trying ...");
110 return true;
111 }
112
113 return servlet->doRun("127.0.0.1:11211", conn);
114}
115
116bool master_service::thread_on_accept(acl::socket_stream* conn)
117{

Callers

nothing calls this directly

Calls 5

putsMethod · 0.80
setup_sslFunction · 0.50
get_ctxMethod · 0.45
doRunMethod · 0.45
handshakeMethod · 0.45

Tested by

no test coverage detected