+ /* Decrypt */
+
+ if(cl->status.decryptin && !decrypted)
+ {
+ EVP_DecryptUpdate(cl->cipher_inctx, inbuf, &lenin, cl->buffer + oldlen, lenin);
+ memcpy(cl->buffer + oldlen, inbuf, lenin);
+ decrypted = 1;
+ }
+
+ /* Are we receiving a TCPpacket? */
+
+ if(cl->tcplen)
+ {
+ if(cl->tcplen <= cl->buflen)
+ {
+ receive_tcppacket(cl, cl->buffer, cl->tcplen);
+
+ cl->buflen -= cl->tcplen;
+ lenin -= cl->tcplen;
+ memmove(cl->buffer, cl->buffer + cl->tcplen, cl->buflen);
+ oldlen = 0;
+ cl->tcplen = 0;
+ continue;
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ /* Otherwise we are waiting for a request */
+
+ reqlen = 0;