Basically, UPNPSendAction() fails with -113 (UPNP_E_BAD_RESPONSE) when trying to read a simple HTML response from a DLINK DIR-625 because the 625 is using "Chunked" Transfer Encoding, when really it sends it all in one sweep anyway. The switch from a strstr() call to strcasestr is because their firmware sends out a tag that matches, but only case-insensitively.
The patch detects and rewrites the recieved buffer, non-chunked style and resets a few variables so that the rest of the parsing engine can't tell the difference.
This patch was written for the DLINK DIR-625 (Hardware: A1, firmware: 1.0.9) but may fix communication problems with other devices as well.
I would have preferred to modify the entire parser to accomodate such rotten firmware, but it was much simpler to write this patch than try to fully understand and modify the parser.
I send an email to DLINK regarding this problem and did not recieve a response.
Please let me know if you need more information.
Craig Nelson, Cameo Systems Inc.