aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buffet/webserv_client.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/buffet/webserv_client.cc b/buffet/webserv_client.cc
index 030ae59..5b35c8b 100644
--- a/buffet/webserv_client.cc
+++ b/buffet/webserv_client.cc
@@ -149,14 +149,17 @@ void WebServClient::OnRequest(const RequestHandlerCallback& callback,
void WebServClient::OnProtocolHandlerConnected(
libwebserv::ProtocolHandler* protocol_handler) {
+ bool connected = false;
if (protocol_handler->GetName() == libwebserv::ProtocolHandler::kHttp) {
http_port_ = *protocol_handler->GetPorts().begin();
+ connected = true;
} else if (protocol_handler->GetName() ==
libwebserv::ProtocolHandler::kHttps) {
https_port_ = *protocol_handler->GetPorts().begin();
certificate_ = protocol_handler->GetCertificateFingerprint();
+ connected = true;
}
- if (https_port_ && https_port_)
+ if (connected && http_port_ && https_port_)
server_available_callback_.Run();
}