Catch all conditions in switch statement, remove trailing whitespaces

This commit is contained in:
Joseph Henry 2023-08-15 08:54:05 -07:00
parent 1d095e81d9
commit a15883d49b
No known key found for this signature in database
GPG Key ID: C45B33FF5EBC9344

View File

@ -2750,46 +2750,8 @@ public:
TcpConnection *tc = reinterpret_cast<TcpConnection *>(*uptr); TcpConnection *tc = reinterpret_cast<TcpConnection *>(*uptr);
tc->lastReceive = OSUtils::now(); tc->lastReceive = OSUtils::now();
switch(tc->type) { switch(tc->type) {
case TcpConnection::TCP_UNCATEGORIZED_INCOMING:
// TODO: Remove Me return;
// case TcpConnection::TCP_UNCATEGORIZED_INCOMING:
// switch(reinterpret_cast<uint8_t *>(data)[0]) {
// // HTTP: GET, PUT, POST, HEAD, DELETE
// case 'G':
// case 'P':
// case 'D':
// case 'H': {
// // This is only allowed from IPs permitted to access the management
// // backplane, which is just 127.0.0.1/::1 unless otherwise configured.
// bool allow;
// {
// Mutex::Lock _l(_localConfig_m);
// if (_allowManagementFrom.empty()) {
// allow = (tc->remoteAddr.ipScope() == InetAddress::IP_SCOPE_LOOPBACK);
// } else {
// allow = false;
// for(std::vector<InetAddress>::const_iterator i(_allowManagementFrom.begin());i!=_allowManagementFrom.end();++i) {
// if (i->containsAddress(tc->remoteAddr)) {
// allow = true;
// break;
// }
// }
// }
// }
// if (allow) {
// tc->type = TcpConnection::TCP_HTTP_INCOMING;
// phyOnTcpData(sock,uptr,data,len);
// } else {
// _phy.close(sock);
// }
// } break;
// // Drop unknown protocols
// default:
// _phy.close(sock);
// break;
// }
// return;
case TcpConnection::TCP_HTTP_INCOMING: case TcpConnection::TCP_HTTP_INCOMING:
case TcpConnection::TCP_HTTP_OUTGOING: case TcpConnection::TCP_HTTP_OUTGOING: