]> granicus.if.org Git - curl/commitdiff
TE: rename struct field content_encoding
authorDaniel Stenberg <daniel@haxx.se>
Fri, 8 Apr 2011 20:50:40 +0000 (22:50 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 18 Apr 2011 17:46:21 +0000 (19:46 +0200)
Since this struct member is used in the code to determine what and how
to decode automatically and since it is now also used for compressed
Transfer-Encodings, I renamed it to the more suitable 'auto_decoding'

lib/http.c
lib/http_chunks.c
lib/transfer.c
lib/urldata.h

index 6b14fab19db5e91863507ff49455331ca1b269eb..c442eebab3abb25ba031f6016445ddda8de81bd3 100644 (file)
@@ -3169,32 +3169,32 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
           start += 7;
         }
 
-        if(k->content_encoding)
+        if(k->auto_decoding)
           /* TODO: we only support the first mentioned compression for now */
           break;
 
         if(checkprefix("identity", start)) {
-          k->content_encoding = IDENTITY;
+          k->auto_decoding = IDENTITY;
           start += 8;
         }
         else if(checkprefix("deflate", start)) {
-          k->content_encoding = DEFLATE;
+          k->auto_decoding = DEFLATE;
           start += 7;
         }
         else if(checkprefix("gzip", start)) {
-          k->content_encoding = GZIP;
+          k->auto_decoding = GZIP;
           start += 4;
         }
         else if(checkprefix("x-gzip", start)) {
-          k->content_encoding = GZIP;
+          k->auto_decoding = GZIP;
           start += 6;
         }
         else if(checkprefix("compress", start)) {
-          k->content_encoding = COMPRESS;
+          k->auto_decoding = COMPRESS;
           start += 8;
         }
         else if(checkprefix("x-compress", start)) {
-          k->content_encoding = COMPRESS;
+          k->auto_decoding = COMPRESS;
           start += 10;
         }
         else
@@ -3222,15 +3222,15 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
 
       /* Record the content-encoding for later use */
       if(checkprefix("identity", start))
-        k->content_encoding = IDENTITY;
+        k->auto_decoding = IDENTITY;
       else if(checkprefix("deflate", start))
-        k->content_encoding = DEFLATE;
+        k->auto_decoding = DEFLATE;
       else if(checkprefix("gzip", start)
               || checkprefix("x-gzip", start))
-        k->content_encoding = GZIP;
+        k->auto_decoding = GZIP;
       else if(checkprefix("compress", start)
               || checkprefix("x-compress", start))
-        k->content_encoding = COMPRESS;
+        k->auto_decoding = COMPRESS;
     }
     else if(checkprefix("Content-Range:", k->p)) {
       /* Content-Range: bytes [num]-
index 56d8248ffb9949914bff481f64f77d99b8b3410e..e955b945e88b5df535044ec70377bea97ad09cee 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -209,7 +209,7 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
       /* Write the data portion available */
 #ifdef HAVE_LIBZ
       switch (conn->data->set.http_ce_skip?
-              IDENTITY : data->req.content_encoding) {
+              IDENTITY : data->req.auto_decoding) {
       case IDENTITY:
 #endif
         if(!k->ignorebody) {
index 065c7341f0b81bf98ec86a8e37a259fd5daf630d..960056c1d86e6bea017b9b1902328dc0e96a4972 100644 (file)
@@ -714,12 +714,12 @@ static CURLcode readwrite_data(struct SessionHandle *data,
              encodings handled here. */
 #ifdef HAVE_LIBZ
           switch (conn->data->set.http_ce_skip ?
-                  IDENTITY : k->content_encoding) {
+                  IDENTITY : k->auto_decoding) {
           case IDENTITY:
 #endif
             /* This is the default when the server sends no
                Content-Encoding header. See Curl_readwrite_init; the
-               memset() call initializes k->content_encoding to zero. */
+               memset() call initializes k->auto_decoding to zero. */
             if(!k->ignorebody) {
 
 #ifndef CURL_DISABLE_POP3
index f2fb279d41c2bbd0cb9a952eab9a641ce760e1a2..33933b3e110ca097a1563d622bc95a56df81e334 100644 (file)
@@ -582,7 +582,7 @@ struct SingleRequest {
   struct timeval start100;      /* time stamp to wait for the 100 code from */
   enum expect100 exp100;        /* expect 100 continue state */
 
-  int content_encoding;         /* What content encoding. sec 3.5, RFC2616. */
+  int auto_decoding;            /* What content encoding. sec 3.5, RFC2616. */
 
 #define IDENTITY 0              /* No encoding */
 #define DEFLATE 1               /* zlib deflate [RFC 1950 & 1951] */