- if(proxytype == PROXY_SOCKS4 && c->allow_request == ID) {
- if(c->buffer[0] == 0 && c->buffer[1] == 0x5a) {
- logger(LOG_DEBUG, "Proxy request granted");
- } else {
- logger(LOG_ERR, "Proxy request rejected");
- return false;
- }
- } else
- receive_tcppacket(c, c->buffer, c->tcplen);
-
- c->buflen -= c->tcplen;
- lenin -= c->tcplen - oldlen;
- memmove(c->buffer, c->buffer + c->tcplen, c->buflen);
- oldlen = 0;
+ if(c->allow_request != ALL) {
+ logger(LOG_ERR, "Got unauthorized TCP packet from %s (%s)", c->name, c->hostname);
+ return false;
+ }
+
+ receive_tcppacket(c, c->buffer, c->tcplen);
+ reqlen = c->tcplen;