Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.6.0
-
None
-
None
Description
I've been attempting to use tcpmon to diagnose various problems since doing so often requires looking at exactly what was send and received. Unfortunately, tcpmon doesn't log the exact response that is returned. It appears to be converting any instances of "><" to ">\n<".
Besides just the basic problem of it not being what was actually transferred, this also causes inconsistency between headers like Content-Length and the actual length of the data, and generally makes things rather confusing.
Sample testcase, assuming you have the "socket" program installed:
Window #1:
printf "HTTP/1.0 200 OK\r\nContent-Length: 2\r\n\r\n><" > response.txt
printf "cat response.txt" > sendit.sh
chmod +x sendit.sh
socket -s 1234 -v -p sendit.sh # listen on port 1234 and runs sendit.sh
Window #2:
tcpmon -lp 1235 -tp 1234 -th localhost
Windows #3:
echo foo | telnet localhost 1235