if (rawhttps_tls_handshake(&ts, connection->connected_socket))
{
rawhttps_logger_log_error("Error in TLS handshake. Connection with client %s will be destroyed.", client_ip_ascii);
rawhttps_tls_state_destroy(&ts);
returnNULL;
}
// In the future, if we want to support keep-alive, we need to add a loop here.
// We would need to differ between a CLOSE_NOTIFY and a real error
rawhttps_http_parser_statehps;
rawhttps_requestrequest;
rawhttps_http_parser_state_create(&hps, &ts);
if (rawhttps_parser_parse(&hps, &request, connection->connected_socket))
{
rawhttps_logger_log_error("Error parsing HTTP packet. Connection was dropped or syntax was invalid. Connection with client %s will be destroyed.", client_ip_ascii);