Update trantor (#656)

* Update trantor
* Make some minor modifications.
This commit is contained in:
An Tao 2020-12-14 08:49:33 +08:00 committed by GitHub
parent d2f291689d
commit ce704aff5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 8 deletions

View File

@ -168,8 +168,8 @@ void press::handleCommand(std::vector<std::string> &parameters)
// std::cout << "c=" << numOfConnections_ << std::endl;
// std::cout << "q=" << processIndication_ << std::endl;
// std::cout << "url=" << url_ << std::endl;
if (url_.empty() || url_.find("http") != 0 ||
url_.find("://") == std::string::npos)
if (url_.empty() || url_.compare(0, 4, "http") != 0 ||
(url_.compare(4, 3, "://") != 0 && url_.compare(4, 4, "s://") != 0))
{
outputErrorAndExit("Invalid URL");
}

View File

@ -26,5 +26,5 @@ class TestPlugin : public Plugin<TestPlugin>
private:
std::thread workThread_;
bool stop_{false};
int interval_;
int interval_{0};
};

View File

@ -238,12 +238,17 @@ void WebSocketClientImpl::onRecvMessage(
{
resp->parseJson();
}
if (resp->getHeaderBy("content-encoding") == "gzip")
auto &coding = resp->getHeaderBy("content-encoding");
if (coding == "gzip")
{
resp->gunzip();
}
#ifdef USE_BROTLI
else if (coding == "br")
{
resp->brDecompress();
}
#endif
upgraded_ = true;
websockConnPtr_ =
std::make_shared<WebSocketConnectionImpl>(connPtr, false);

View File

@ -56,7 +56,7 @@ struct SqlCmd
ExceptPtrCallback exceptionCallback_;
std::string preparingStatement_;
#if LIBPQ_SUPPORTS_BATCH_MODE
bool isChanging_;
bool isChanging_{false};
#endif
SqlCmd(string_view &&sql,
const size_t paraNum,

@ -1 +1 @@
Subproject commit 8e0af4aaa1bc2fb6eb1e1e2f310fa1d070c5e1d2
Subproject commit 38bfde8f37cbedcc4d98cc1784947c6c7734cef0