Replaces tab with 4 spaces
This commit is contained in:
@@ -103,7 +103,7 @@ void WebClient::enqueue_raw_packet(const pipes::buffer_view &msg) {
|
||||
if(this->writeEvent)
|
||||
event_add(this->writeEvent, nullptr);
|
||||
}
|
||||
this->connectionStatistics->logOutgoingPacket(stats::ConnectionStatistics::category::COMMAND, buffer.length());
|
||||
this->connectionStatistics->logOutgoingPacket(stats::ConnectionStatistics::category::COMMAND, buffer.length());
|
||||
}
|
||||
|
||||
void WebClient::registerMessageProcess() {
|
||||
@@ -113,14 +113,14 @@ void WebClient::registerMessageProcess() {
|
||||
}
|
||||
|
||||
inline bool is_ssl_handshake_header(const pipes::buffer_view& buffer) {
|
||||
if(buffer.length() < 0x05) return false; //Header too small!
|
||||
if(buffer.length() < 0x05) return false; //Header too small!
|
||||
|
||||
if(buffer[0] != 0x16) return false; //recordType=handshake
|
||||
if(buffer[0] != 0x16) return false; //recordType=handshake
|
||||
|
||||
if(buffer[1] < 1 || buffer[1] > 3) return false; //SSL version
|
||||
if(buffer[2] < 1 || buffer[2] > 3) return false; //TLS version
|
||||
if(buffer[1] < 1 || buffer[1] > 3) return false; //SSL version
|
||||
if(buffer[2] < 1 || buffer[2] > 3) return false; //TLS version
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void WebClient::processNextMessage(const std::chrono::system_clock::time_point& /* scheduled */) {
|
||||
@@ -138,18 +138,18 @@ void WebClient::processNextMessage(const std::chrono::system_clock::time_point&
|
||||
buffer_lock.unlock();
|
||||
|
||||
this->connectionStatistics->logIncomingPacket(stats::ConnectionStatistics::category::COMMAND, buffer.length());
|
||||
if(!this->ssl_detected) {
|
||||
if(!this->ssl_detected) {
|
||||
this->ssl_detected = true;
|
||||
this->ssl_encrypted = is_ssl_handshake_header(buffer);
|
||||
if(this->ssl_encrypted)
|
||||
logMessage(this->getServerId(), "[{}] Using encrypted basic connection.", CLIENT_STR_LOG_PREFIX_(this));
|
||||
logMessage(this->getServerId(), "[{}] Using encrypted basic connection.", CLIENT_STR_LOG_PREFIX_(this));
|
||||
else
|
||||
logMessage(this->getServerId(), "[{}] Using unencrypted basic connection.", CLIENT_STR_LOG_PREFIX_(this));
|
||||
}
|
||||
}
|
||||
if(this->ssl_encrypted) {
|
||||
this->ssl_handler.process_incoming_data(buffer);
|
||||
this->ssl_handler.process_incoming_data(buffer);
|
||||
} else {
|
||||
this->ws_handler.process_incoming_data(buffer);
|
||||
this->ws_handler.process_incoming_data(buffer);
|
||||
}
|
||||
|
||||
if(has_next)
|
||||
|
||||
Reference in New Issue
Block a user