While testing using the Curl test suite on TPF I uncovered a rather complicated problem:
If the HTTP request headers can't be sent in one system call in http.c's add_buffer_send(), the remaining portion gets sent later by transfer.c. That causes two problems: 1) On non-ASCII platforms the remaining portion is re-converted (into garbage) if data->set.prefer_ascii is set. 2) On all platforms the line endings are mangled from CRLF to CRCRLF if data->set.crlf or data->set.prefer_ascii are set (depending on the CURL_DO_LINEEND_CONV #define). This patch addes checks to prevent these problems. Additional changes address two HTTP PUT problems: 1) On non-ASCII platforms not all of the protocol portions of the PUT are being translated to ASCII. 2) On all platforms the line endings of part of the protocol portions are being mangled from CRLF to CRCRLF if data->set.crlf or data->set.prefer_ascii are set (depending on the CURL_DO_LINEEND_CONV #define). Thank you, David McCreedy
patch.transfer.20090430.diff
Description: Binary data
