+
+ if(type == SPTPS_HANDSHAKE) {
+ if(c->allow_request == ACK) {
+ return send_ack(c);
+ } else {
+ return true;
+ }
+ }
+
+ if(!data) {
+ return true;
+ }
+
+ /* Are we receiving a TCPpacket? */
+
+ if(c->tcplen) {
+ if(length != c->tcplen) {
+ return false;
+ }
+
+ receive_tcppacket(c, data, length);
+ c->tcplen = 0;
+ return true;
+ }
+
+ /* Change newline to null byte, just like non-SPTPS requests */
+
+ if(data[length - 1] == '\n') {
+ ((char *)data)[length - 1] = 0;
+ }
+
+ /* Otherwise we are waiting for a request */
+
+ return receive_request(c, data);