Most of the code doesn't care whether requests are terminated with a newline or
not, except that when requests are forwarded, it is assumed they do not have
one and a newline is added. When a node using SPTPS receives a request from
another SPTPS-using node, and forwards it to a non-SPTPS-using node, this will
result in two consecutive newlines, which the latter node will see as an empty,
and thus invalid, request.
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);