diff --git a/lib/content_encoding.c b/lib/content_encoding.c
index 6d47537..9c0fafb 100644
--- a/lib/content_encoding.c
+++ b/lib/content_encoding.c
@@ -145,13 +145,17 @@ static CURLcode process_trailer(struct connectdata *conn, zlib_params *zp)
   zp->trailerlen -= len;
   z->avail_in -= len;
   z->next_in += len;
-  if(z->avail_in)
+  if(z->avail_in) {
     result = CURLE_WRITE_ERROR;
-  if(result || !zp->trailerlen)
+    fprintf(stderr, "-------------- process_trailer - extra result: %d\n", (int)result);
+  }
+  if(result || !zp->trailerlen) {
     result = exit_zlib(conn, z, &zp->zlib_init, result);
-  else {
+    fprintf(stderr, "-------------- process_trailer - after exit: %d\n", (int)result);
+  } else {
     /* Only occurs for gzip with zlib < 1.2.0.4 or raw deflate. */
     zp->zlib_init = ZLIB_EXTERNAL_TRAILER;
+    fprintf(stderr, "-------------- process_trailer - ZLIB_EXTERNAL_TRAILER:\n");
   }
   return result;
 }
@@ -171,14 +175,18 @@ static CURLcode inflate_stream(struct connectdata *conn,
   if(zp->zlib_init != ZLIB_INIT &&
      zp->zlib_init != ZLIB_INFLATING &&
      zp->zlib_init != ZLIB_INIT_GZIP &&
-     zp->zlib_init != ZLIB_GZIP_INFLATING)
+     zp->zlib_init != ZLIB_GZIP_INFLATING) {
+  fprintf(stderr, "-------------- inflate_stream - 1\n");
     return exit_zlib(conn, z, &zp->zlib_init, CURLE_WRITE_ERROR);
+  }
 
   /* Dynamically allocate a buffer for decompression because it's uncommonly
      large to hold on the stack */
   decomp = malloc(DSIZ);
-  if(decomp == NULL)
+  if(decomp == NULL) {
+  fprintf(stderr, "-------------- inflate_stream - 2\n");
     return exit_zlib(conn, z, &zp->zlib_init, CURLE_OUT_OF_MEMORY);
+  }
 
   /* because the buffer size is fixed, iteratively decompress and transfer to
      the client via downstream_write function. */
@@ -197,6 +205,7 @@ static CURLcode inflate_stream(struct connectdata *conn,
     /* fallback for zlib ver. < 1.2.0.5 */
     status = inflate(z, Z_SYNC_FLUSH);
 #endif
+    fprintf(stderr, "-------------- inflate_stream - after inflate %d\n", (int)status);
 
     /* Flush output data if some. */
     if(z->avail_out != DSIZ) {
@@ -205,6 +214,7 @@ static CURLcode inflate_stream(struct connectdata *conn,
         result = Curl_unencode_write(conn, writer->downstream, decomp,
                                      DSIZ - z->avail_out);
         if(result) {
+      fprintf(stderr, "-------------- inflate_stream - 2.5, result: %d\n", (int)result);
           exit_zlib(conn, z, &zp->zlib_init, result);
           break;
         }
@@ -222,6 +232,7 @@ static CURLcode inflate_stream(struct connectdata *conn,
       break;
     case Z_STREAM_END:
       result = process_trailer(conn, zp);
+      fprintf(stderr, "-------------- inflate_stream - process_trailer result: %d\n", (int)result);
       break;
     case Z_DATA_ERROR:
       /* some servers seem to not generate zlib headers, so this is an attempt
@@ -240,10 +251,12 @@ static CURLcode inflate_stream(struct connectdata *conn,
         zp->zlib_init = ZLIB_UNINIT;    /* inflateEnd() already called. */
       }
       /* FALLTHROUGH */
-    default:
+    default: {
       result = exit_zlib(conn, z, &zp->zlib_init, process_zlib_error(conn, z));
+      fprintf(stderr, "-------------- inflate_stream - 3, result: %d\n", (int)result);
       break;
     }
+    }
   }
   free(decomp);
 
@@ -253,6 +266,8 @@ static CURLcode inflate_stream(struct connectdata *conn,
   if(nread && zp->zlib_init == ZLIB_INIT)
     zp->zlib_init = started;      /* Cannot restart anymore. */
 
+ fprintf(stderr, "-------------- inflate_stream - leaving result: %d\n", (int)result);
+
   return result;
 }
 
@@ -264,8 +279,10 @@ static CURLcode deflate_init_writer(struct connectdata *conn,
   zlib_params *zp = (zlib_params *) &writer->params;
   z_stream *z = &zp->z;     /* zlib state structure */
 
-  if(!writer->downstream)
+  if(!writer->downstream) {
+  fprintf(stderr, "-------------- deflate_init_writer\n");
     return CURLE_WRITE_ERROR;
+  }
 
   /* Initialize zlib */
   z->zalloc = (alloc_func) zalloc_cb;
@@ -438,17 +455,21 @@ static CURLcode gzip_unencode_write(struct connectdata *conn,
   zlib_params *zp = (zlib_params *) &writer->params;
   z_stream *z = &zp->z;     /* zlib state structure */
 
+  fprintf(stderr, "-------------- gzip_unencode_write - enter\n");
+
   if(zp->zlib_init == ZLIB_INIT_GZIP) {
     /* Let zlib handle the gzip decompression entirely */
     z->next_in = (Bytef *) buf;
     z->avail_in = (uInt) nbytes;
     /* Now uncompress the data */
+  fprintf(stderr, "-------------- gzip_unencode_write - 1\n");
     return inflate_stream(conn, writer, ZLIB_INIT_GZIP);
   }
 
 #ifndef OLD_ZLIB_SUPPORT
   /* Support for old zlib versions is compiled away and we are running with
      an old version, so return an error. */
+  fprintf(stderr, "-------------- gzip_unencode_write - ERRORRRRRRR\n");
   return exit_zlib(conn, z, &zp->zlib_init, CURLE_WRITE_ERROR);
 
 #else
@@ -495,9 +516,11 @@ static CURLcode gzip_unencode_write(struct connectdata *conn,
       return CURLE_OK;
 
     case GZIP_BAD:
-    default:
+    default: {
+  fprintf(stderr, "-------------- gzip_unencode_write - 2\n");
       return exit_zlib(conn, z, &zp->zlib_init, process_zlib_error(conn, z));
     }
+    }
 
   }
   break;
@@ -509,6 +532,7 @@ static CURLcode gzip_unencode_write(struct connectdata *conn,
     z->avail_in += (uInt) nbytes;
     z->next_in = Curl_saferealloc(z->next_in, z->avail_in);
     if(z->next_in == NULL) {
+  fprintf(stderr, "-------------- gzip_unencode_write - 3\n");
       return exit_zlib(conn, z, &zp->zlib_init, CURLE_OUT_OF_MEMORY);
     }
     /* Append the new block of data to the previous one */
diff --git a/lib/http_chunks.c b/lib/http_chunks.c
index 18dfcb2..919fd5f 100644
--- a/lib/http_chunks.c
+++ b/lib/http_chunks.c
@@ -125,8 +125,10 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
      chunk read process, to properly calculate the content length*/
   if(data->set.http_te_skip && !k->ignorebody) {
     result = Curl_client_write(conn, CLIENTWRITE_BODY, datap, datalen);
-    if(result)
+    if(result) {
+      failf(data, "--- 1 --- ");
       return CHUNKE_WRITE_ERROR;
+    }
   }
 
   while(length) {
@@ -140,15 +142,18 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
           ch->hexindex++;
         }
         else {
+      failf(data, "--- 2 --- ");
           return CHUNKE_TOO_LONG_HEX; /* longer hex than we support */
         }
       }
       else {
         char *endptr;
-        if(0 == ch->hexindex)
+        if(0 == ch->hexindex) {
           /* This is illegal data, we received junk where we expected
              a hexadecimal digit. */
+      failf(data, "--- 3 --- ");
           return CHUNKE_ILLEGAL_HEX;
+        }
 
         /* length and datap are unmodified */
         ch->hexbuffer[ch->hexindex] = 0;
@@ -159,11 +164,14 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
         if(result) {
           /* Curl_convert_from_network calls failf if unsuccessful */
           /* Treat it as a bad hex character */
+      failf(data, "--- 4 --- ");
           return CHUNKE_ILLEGAL_HEX;
         }
 
-        if(curlx_strtoofft(ch->hexbuffer, &endptr, 16, &ch->datasize))
+        if(curlx_strtoofft(ch->hexbuffer, &endptr, 16, &ch->datasize)) {
+      failf(data, "--- 5 --- ");
           return CHUNKE_ILLEGAL_HEX;
+        }
         ch->state = CHUNK_LF; /* now wait for the CRLF */
       }
       break;
@@ -192,13 +200,18 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
 
       /* Write the data portion available */
       if(!conn->data->set.http_te_skip && !k->ignorebody) {
-        if(!conn->data->set.http_ce_skip && k->writer_stack)
+        if(!conn->data->set.http_ce_skip && k->writer_stack) {
           result = Curl_unencode_write(conn, k->writer_stack, datap, piece);
-        else
+          fprintf(stderr, "unencode!!: %d\n", (int)result);
+        } else {
           result = Curl_client_write(conn, CLIENTWRITE_BODY, datap, piece);
+          fprintf(stderr, "client write!!: %d\n", (int)result);
+        }
 
-        if(result)
+        if(result) {
+          failf(data, "--- 6! --- %d", (int)result);
           return CHUNKE_WRITE_ERROR;
+        }
       }
 
       *wrote += piece;
@@ -216,8 +229,10 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
         /* The last one before we go back to hex state and start all over. */
         Curl_httpchunk_init(conn); /* sets state back to CHUNK_HEX */
       }
-      else if(*datap != 0x0d)
+      else if(*datap != 0x0d) {
+      failf(data, "--- 7 --- ");
         return CHUNKE_BAD_CHUNK;
+      }
       datap++;
       length--;
       break;
@@ -236,16 +251,20 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
           /* Convert to host encoding before calling Curl_client_write */
           result = Curl_convert_from_network(conn->data, conn->trailer,
                                              conn->trlPos);
-          if(result)
+          if(result) {
             /* Curl_convert_from_network calls failf if unsuccessful */
             /* Treat it as a bad chunk */
+      failf(data, "--- 8 --- ");
             return CHUNKE_BAD_CHUNK;
+          }
 
           if(!data->set.http_te_skip) {
             result = Curl_client_write(conn, CLIENTWRITE_HEADER,
                                        conn->trailer, conn->trlPos);
-            if(result)
+            if(result) {
+      failf(data, "--- 9 --- ");
               return CHUNKE_WRITE_ERROR;
+            }
           }
           conn->trlPos = 0;
           ch->state = CHUNK_TRAILER_CR;
@@ -274,8 +293,10 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
             conn->trlMax = 128;
             ptr = malloc(conn->trlMax + 3);
           }
-          if(!ptr)
+          if(!ptr) {
+      failf(data, "--- 10 --- ");
             return CHUNKE_OUT_OF_MEMORY;
+          }
           conn->trailer = ptr;
         }
         conn->trailer[conn->trlPos++]=*datap;
@@ -290,8 +311,10 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
         datap++;
         length--;
       }
-      else
+      else {
+      failf(data, "--- 11 --- ");
         return CHUNKE_BAD_CHUNK;
+      }
       break;
 
     case CHUNK_TRAILER_POSTCR:
@@ -321,8 +344,10 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
 
         return CHUNKE_STOP; /* return stop */
       }
-      else
+      else {
+      failf(data, "--- 12 --- ");
         return CHUNKE_BAD_CHUNK;
+      }
     }
   }
   return CHUNKE_OK;
diff --git a/lib/sendf.c b/lib/sendf.c
index 5008d93..927b8b1 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -669,8 +669,10 @@ CURLcode Curl_client_write(struct connectdata *conn,
     /* convert from the network encoding */
     CURLcode result = Curl_convert_from_network(data, ptr, len);
     /* Curl_convert_from_network calls failf if unsuccessful */
-    if(result)
+    if(result) {
+      failf(data, "--- 14 --- ");
       return result;
+    }
 
 #ifdef CURL_DO_LINEEND_CONV
     /* convert end-of-line markers */
diff --git a/lib/transfer.c b/lib/transfer.c
index ca60317..56bac62 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -824,7 +824,7 @@ static CURLcode readwrite_data(struct Curl_easy *data,
 
         if(CHUNKE_OK < res) {
           if(CHUNKE_WRITE_ERROR == res) {
-            failf(data, "Failed writing data");
+/*            failf(data, "Failed writing data");*/
             return CURLE_WRITE_ERROR;
           }
           failf(data, "%s in chunked-encoding", Curl_chunked_strerror(res));
