+
+ if(!c->node) {
+ if(c->outgoing && c->allow_request == ID && (proxytype == PROXY_SOCKS4 || proxytype == PROXY_SOCKS5)) {
+ if(!check_socks_resp(proxytype, tcpbuffer, c->tcplen)) {
+ return false;
+ }
+ } else {
+ logger(DEBUG_CONNECTIONS, LOG_ERR, "c->tcplen set but c->node is NULL!");
+ abort();
+ }
+ } else {
+ if(c->allow_request == ALL) {
+ receive_tcppacket(c, tcpbuffer, c->tcplen);
+ } else {
+ logger(DEBUG_CONNECTIONS, LOG_ERR, "Got unauthorized TCP packet from %s (%s)", c->name, c->hostname);
+ return false;
+ }
+ }
+
+ c->tcplen = 0;