diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-01-10 04:26:37 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-01-10 04:26:37 (GMT) |
commit | 3ad91bf9d39c22dc6941068e6fdc1453988f0b07 (patch) | |
tree | 19e8dd0c44daf44ad8600de820752b39e385785f /Source/CTest/Curl/http_chunks.c | |
parent | 382d0d447497549b6db54b052b6eb3cc45f5d182 (diff) | |
download | CMake-3ad91bf9d39c22dc6941068e6fdc1453988f0b07.zip CMake-3ad91bf9d39c22dc6941068e6fdc1453988f0b07.tar.gz CMake-3ad91bf9d39c22dc6941068e6fdc1453988f0b07.tar.bz2 |
New version of libcurl
Diffstat (limited to 'Source/CTest/Curl/http_chunks.c')
-rw-r--r-- | Source/CTest/Curl/http_chunks.c | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/Source/CTest/Curl/http_chunks.c b/Source/CTest/Curl/http_chunks.c index 1754079..6d2a640 100644 --- a/Source/CTest/Curl/http_chunks.c +++ b/Source/CTest/Curl/http_chunks.c @@ -1,27 +1,28 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2001, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * In order to be useful for every potential user, curl and libcurl are - * dual-licensed under the MPL and the MIT/X-derivate licenses. + * Copyright (C) 1998 - 2002, 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 + * are also available at http://curl.haxx.se/docs/copyright.html. + * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the MPL or the MIT/X-derivate - * licenses. You may pick one of these licenses. + * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * * $Id$ - *****************************************************************************/ + ***************************************************************************/ #include "setup.h" +#ifndef CURL_DISABLE_HTTP /* -- WIN32 approved -- */ #include <stdio.h> #include <string.h> @@ -32,6 +33,8 @@ #include "urldata.h" /* it includes http_chunks.h */ #include "sendf.h" /* for the client write stuff */ +#include "content_encoding.h" /* 08/29/02 jhrg */ + #define _MPRINTF_REPLACE /* use our functions only */ #include <curl/mprintf.h> @@ -171,7 +174,32 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn, piece = (ch->datasize >= length)?length:ch->datasize; /* Write the data portion available */ - result = Curl_client_write(conn->data, CLIENTWRITE_BODY, datap, piece); + /* Added content-encoding here; untested but almost identical to the + tested code in transfer.c. 08/29/02 jhrg */ +#ifdef HAVE_LIBZ + switch (conn->keep.content_encoding) { + case IDENTITY: +#endif + result = Curl_client_write(conn->data, CLIENTWRITE_BODY, datap, + piece); +#ifdef HAVE_LIBZ + break; + + case DEFLATE: + result = Curl_unencode_deflate_write(conn->data, &conn->keep, piece); + break; + + case GZIP: + case COMPRESS: + default: + failf (conn->data, + "Unrecognized content encoding type. " + "libcurl understands `identity' and `deflate' " + "content encodings."); + return CHUNKE_BAD_ENCODING; + } +#endif + if(result) return CHUNKE_WRITE_ERROR; *wrote += piece; @@ -228,3 +256,4 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn, * vim600: fdm=marker * vim: et sw=2 ts=2 sts=2 tw=78 */ +#endif /* CURL_DISABLE_HTTP */ |