TCP is a stream protocol, so data isn't guaranteed to arrive in the same sized chunks as how you sent it. You'll need to introduce some additional context to your data stream to indicate the start/stop of a response.
It might be possible to change the behavior of _tcp_send() in tcp.lib to only set PSH if there isn't any more data queued to send. If you use sock_fastwrite() for writing data, and have enough buffer space enabled, this might work. Change these lines:
Code:
else {
sendpktlen = senddatalen + sizeof( tcp_Header ) + sizeof( in_Header );
if (senddatalen)
outFlags |= tcp_FlagPUSH;
}
to (just adding "& !more" to the if):
Code:
else {
sendpktlen = senddatalen + sizeof( tcp_Header ) + sizeof( in_Header );
if (senddatalen & !more)
outFlags |= tcp_FlagPUSH;
}
Please let me know the results of your test, and I will consider making it an official change to the library.