Index: lib/transfer.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/transfer.c,v
retrieving revision 1.429
diff -u -r1.429 transfer.c
--- lib/transfer.c	4 May 2009 09:47:02 -0000	1.429
+++ lib/transfer.c	5 May 2009 12:42:31 -0000
@@ -1496,15 +1496,14 @@
           break;
         }
 
-        if(data->state.proto.http) {
-          if(data->state.proto.http->sending == HTTPSEND_REQUEST) {
-            /* We're sending the HTTP request headers, not the data.
-               Remember that so we don't change the line endings. */
-               sending_http_headers = TRUE;
-          } else {
-            sending_http_headers = FALSE;
-          }
+        sending_http_headers = FALSE;
+        if((data->state.proto.http) &&
+           (data->state.proto.http->sending == HTTPSEND_REQUEST)) {
+          /* We're sending the HTTP request headers, not the data.
+             Remember that so we don't change the line endings. */
+          sending_http_headers = TRUE;
         }
+
         result = Curl_fillreadbuffer(conn, BUFSIZE, &fillcount);
         if(result)
           return result;
@@ -1536,11 +1535,11 @@
       /* convert LF to CRLF if so asked */
 #ifdef CURL_DO_LINEEND_CONV
       /* always convert if we're FTPing in ASCII mode */
-        if(((data->set.crlf) || (data->set.prefer_ascii))
+        if((data->set.crlf) || (data->set.prefer_ascii))
 #else
-        if((data->set.crlf)
+        if((data->set.crlf) && (!sending_http_headers))
 #endif /* CURL_DO_LINEEND_CONV */
-        && (!sending_http_headers)) {
+        {
           if(data->state.scratch == NULL)
             data->state.scratch = malloc(2*BUFSIZE);
           if(data->state.scratch == NULL) {

