Fix catch up error on https.

This commit is contained in:
kishorenc 2020-09-18 07:24:38 +05:30
parent 55d28e6f31
commit 1ca39459eb
3 changed files with 3 additions and 8 deletions

View File

@ -58,8 +58,6 @@ private:
bool exit_loop = false;
bool ssl_enabled = false;
private:
std::string version;
@ -173,8 +171,4 @@ public:
static void on_deferred_process_request(h2o_timer_t *entry);
void defer_processing(http_req& req, http_res& res, size_t timeout_ms);
bool is_ssl_enabled() {
return ssl_enabled;
}
};

View File

@ -112,7 +112,6 @@ int HttpServer::setup_ssl(const char *cert_file, const char *key_file) {
}
h2o_ssl_register_alpn_protocols(accept_ctx->ssl_ctx, h2o_http2_alpn_protocols);
ssl_enabled = true;
return 0;
}

View File

@ -357,11 +357,13 @@ int run_server(const Config & config, const std::string & version, void (*master
server->on(HttpServer::STREAM_RESPONSE_MESSAGE, HttpServer::on_stream_response_message);
server->on(HttpServer::REQUEST_PROCEED_MESSAGE, HttpServer::on_request_proceed_message);
bool ssl_enabled = (!config.get_ssl_cert().empty() && !config.get_ssl_cert_key().empty());
// first we start the peering service
ThreadPool thread_pool(32);
ReplicationState replication_state(&store, &thread_pool, server->get_message_dispatcher(),
server->is_ssl_enabled(), config.get_catch_up_threshold_percentage(),
ssl_enabled, config.get_catch_up_threshold_percentage(),
create_init_db_snapshot, quit_raft_service);
std::thread raft_thread([&replication_state, &config, &state_dir]() {