diff -ru -x '*.lib' -x '*.idb' -x '*.pdb' curl-7.16.1-20070205/include/curl/curl.h curl-7.16.1-20070205-mod/include/curl/curl.h
--- curl-7.16.1-20070205/include/curl/curl.h	2007-01-09 05:00:12.000000000 +0200
+++ curl-7.16.1-20070205-mod/include/curl/curl.h	2007-02-05 12:59:41.421875000 +0200
@@ -1053,6 +1053,10 @@
 
   /* Send CCC (Clear Command Channel) after authentication */
   CINIT(FTP_SSL_CCC, LONG, 154),
+  /* set to non-zero to pass the raw body data to the appliction even when
+     it is encoded/compressed */
+  CINIT(HTTP_TRANSFER_ENCODING_RAW, LONG, 155),
+  CINIT(HTTP_CONTENT_ENCODING_RAW, LONG, 156),
 
   CURLOPT_LASTENTRY /* the last unused */
 } CURLoption;
Only in curl-7.16.1-20070205-mod/lib: debug
diff -ru -x '*.lib' -x '*.idb' -x '*.pdb' curl-7.16.1-20070205/lib/http_chunks.c curl-7.16.1-20070205-mod/lib/http_chunks.c
--- curl-7.16.1-20070205/lib/http_chunks.c	2007-01-17 05:00:43.000000000 +0200
+++ curl-7.16.1-20070205-mod/lib/http_chunks.c	2007-02-05 13:36:03.859375000 +0200
@@ -113,6 +113,8 @@
   size_t piece;
   size_t length = (size_t)datalen;
   size_t *wrote = (size_t *)wrotep;
+  size_t origdatalen = datalen;
+  char* origdatap = datap;
 
   *wrote = 0; /* nothing's written yet */
 
@@ -206,12 +208,21 @@
 
       /* Write the data portion available */
 #ifdef HAVE_LIBZ
-      switch (data->reqdata.keep.content_encoding) {
+      switch (conn->data->set.http_ce_raw ? IDENTITY : data->reqdata.keep.content_encoding) {
         case IDENTITY:
 #endif
-          if(!k->ignorebody)
-            result = Curl_client_write(conn, CLIENTWRITE_BODY, datap,
-                                       piece);
+          if(!k->ignorebody) {
+            if ( !data->set.http_te_raw )
+              result = Curl_client_write(conn, CLIENTWRITE_BODY, datap,
+                                         piece);
+            else
+              if ( origdatalen ) {
+                result = Curl_client_write(conn, CLIENTWRITE_BODY,
+                                           origdatap,origdatalen);
+                origdatalen = 0; /* to avoid writing twice */
+              } else
+                result = CURLE_OK;
+          }
 #ifdef HAVE_LIBZ
           break;
 
@@ -334,8 +345,15 @@
             return(CHUNKE_BAD_CHUNK);
           }
 #endif /* CURL_DOES_CONVERSIONS */
-          Curl_client_write(conn, CLIENTWRITE_HEADER,
-                            conn->trailer, conn->trlPos);
+            if ( !data->set.http_te_raw )
+              Curl_client_write(conn, CLIENTWRITE_HEADER,
+                                conn->trailer, conn->trlPos);
+            else
+              if ( origdatalen ) {
+                Curl_client_write(conn, CLIENTWRITE_BODY, origdatap,origdatalen);
+                origdatalen = 0; /* to avoid writing twice */
+              }
+
         }
         ch->state = CHUNK_TRAILER;
         conn->trlPos=0;
diff -ru -x '*.lib' -x '*.idb' -x '*.pdb' curl-7.16.1-20070205/lib/transfer.c curl-7.16.1-20070205-mod/lib/transfer.c
--- curl-7.16.1-20070205/lib/transfer.c	2007-01-27 05:00:08.000000000 +0200
+++ curl-7.16.1-20070205-mod/lib/transfer.c	2007-02-05 12:56:00.859375000 +0200
@@ -1286,7 +1286,7 @@
                  Make sure that ALL_CONTENT_ENCODINGS contains all the
                  encodings handled here. */
 #ifdef HAVE_LIBZ
-              switch (k->content_encoding) {
+              switch (conn->data->set.http_ce_raw ? IDENTITY : k->content_encoding) {
               case IDENTITY:
 #endif
                 /* This is the default when the server sends no
diff -ru -x '*.lib' -x '*.idb' -x '*.pdb' curl-7.16.1-20070205/lib/url.c curl-7.16.1-20070205-mod/lib/url.c
--- curl-7.16.1-20070205/lib/url.c	2007-02-04 05:00:08.000000000 +0200
+++ curl-7.16.1-20070205-mod/lib/url.c	2007-02-05 12:55:10.343750000 +0200
@@ -1716,6 +1716,19 @@
     data->set.ssh_private_key = va_arg(param, char *);
     break;
 
+  case CURLOPT_HTTP_TRANSFER_ENCODING_RAW:
+    /*
+     * raw data passed to the application when chunked transfer encoding is used
+     */
+    data->set.http_te_raw = (bool)(0 != va_arg(param, long));
+    break;
+
+  case CURLOPT_HTTP_CONTENT_ENCODING_RAW:
+    /*
+     * raw data passed to the application when content encoding is used
+     */
+    data->set.http_ce_raw = (bool)(0 != va_arg(param, long));
+    break;
   default:
     /* unknown tag and its companion, just ignore: */
     result = CURLE_FAILED_INIT; /* correct this */
diff -ru -x '*.lib' -x '*.idb' -x '*.pdb' curl-7.16.1-20070205/lib/urldata.h curl-7.16.1-20070205-mod/lib/urldata.h
--- curl-7.16.1-20070205/lib/urldata.h	2007-02-04 05:00:08.000000000 +0200
+++ curl-7.16.1-20070205-mod/lib/urldata.h	2007-02-05 12:44:52.234375000 +0200
@@ -1292,6 +1292,8 @@
                              authentication */
   char *ssh_private_key;  /* the path to the private key file for
                              authentication */
+  bool http_te_raw;    /* pass the raw body data to the user, even when encoded (chunked, compressed) */
+  bool http_ce_raw;    /* pass the raw body data to the user, even when encoded (chunked, compressed) */
 };
 
 struct Names {
