remove unused var and method

This commit is contained in:
Alexandre Konieczny 2019-04-24 17:56:37 +02:00
parent 2b9b31ef4c
commit 679791dd63
2 changed files with 2 additions and 19 deletions

View File

@ -68,7 +68,6 @@ namespace ix
const int WebSocketTransport::kDefaultPingIntervalSecs(-1);
const int WebSocketTransport::kDefaultPingTimeoutSecs(-1);
const bool WebSocketTransport::kDefaultEnablePong(true);
const int WebSocketTransport::kClosingMaximumWaitingDelayInMs(100);
constexpr size_t WebSocketTransport::kChunkSize;
const uint16_t WebSocketTransport::kInternalErrorCode(1011);
@ -88,7 +87,6 @@ namespace ix
_closeRemote(false),
_enablePerMessageDeflate(false),
_requestInitCancellation(false),
_closingTimePoint(std::chrono::steady_clock::now()),
_enablePong(kDefaultEnablePong),
_pingIntervalSecs(kDefaultPingIntervalSecs),
_pingTimeoutSecs(kDefaultPingTimeoutSecs),
@ -245,13 +243,6 @@ namespace ix
return now - _lastReceivePongTimePoint > std::chrono::seconds(_pingTimeoutSecs);
}
bool WebSocketTransport::closingDelayExceeded()
{
std::lock_guard<std::mutex> lock(_closingTimePointMutex);
auto now = std::chrono::steady_clock::now();
return now - _closingTimePoint > std::chrono::milliseconds(kClosingMaximumWaitingDelayInMs);
}
WebSocketTransport::PollPostTreatment WebSocketTransport::poll()
{
PollResultType pollResult = _socket->poll(_pingIntervalOrTimeoutGCDSecs);
@ -333,7 +324,7 @@ namespace ix
_socket->close();
}
if (_readyState == CLOSING /*&& closingDelayExceeded()*/)
if (_readyState == CLOSING)
{
// close code and reason were set when calling close()
_socket->close();
@ -935,10 +926,6 @@ namespace ix
_closeWireSize = closeWireSize;
_closeRemote = remote;
}
{
std::lock_guard<std::mutex> lock(_closingTimePointMutex);
_closingTimePoint = std::chrono::steady_clock::now();
}
setReadyState(CLOSING);
_socket->wakeUpFromPoll(Socket::kSendRequest);

View File

@ -169,10 +169,6 @@ namespace ix
// Used to cancel dns lookup + socket connect + http upgrade
std::atomic<bool> _requestInitCancellation;
mutable std::mutex _closingTimePointMutex;
std::chrono::time_point<std::chrono::steady_clock>_closingTimePoint;
static const int kClosingMaximumWaitingDelayInMs;
// Constants for dealing with closing conneections
static const uint16_t kInternalErrorCode;
static const uint16_t kAbnormalCloseCode;