Fix multiple threading bugs including #699 and #697

This commit is contained in:
David Wu 2020-10-16 21:34:51 +00:00 committed by yhirose
parent 47e5af15ea
commit 02d3cd5909
3 changed files with 178 additions and 49 deletions

View file

@ -5,6 +5,7 @@
#include <chrono>
#include <future>
#include <thread>
#include <atomic>
#define SERVER_CERT_FILE "./cert.pem"
#define SERVER_CERT2_FILE "./cert2.pem"
@ -2761,7 +2762,7 @@ TEST_F(ServerTest, Brotli) {
// Sends a raw request to a server listening at HOST:PORT.
static bool send_request(time_t read_timeout_sec, const std::string &req,
std::string *resp = nullptr) {
Error error = Error::Success;
std::atomic<Error> error(Error::Success);
auto client_sock =
detail::create_client_socket(HOST, PORT, false, nullptr,