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