diff options
author | Alex Deymo <deymo@google.com> | 2017-12-19 19:04:07 +0100 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2017-12-20 14:03:33 -0800 |
commit | 486467e11b5904b3e04adc2f5fdb96fcfe65da84 (patch) | |
tree | 492c1de56730f0b42bba1f651aa78c8cac13cfa7 /tests/server/getpart.c | |
parent | 7d91b4f63bd1fd29c11c9ff1ba6e7c42622e0687 (diff) | |
download | android_external_curl-486467e11b5904b3e04adc2f5fdb96fcfe65da84.tar.gz android_external_curl-486467e11b5904b3e04adc2f5fdb96fcfe65da84.tar.bz2 android_external_curl-486467e11b5904b3e04adc2f5fdb96fcfe65da84.zip |
Update from 7.55.1 to 7.57.0
Update the local patch to match the new config. Removed the
packages/Android/Android.mk file added by upstream (outdated Android.mk
version which will confuse people). Updated Android.bp with the new files.
Bug: http://b/70741465
Test: builds, boots, `vendor/google/tools/fake-ota on streaming` works
Change-Id: Ib2411f5e64db4e11ffd916dc81cd23b46888b900
Diffstat (limited to 'tests/server/getpart.c')
-rw-r--r-- | tests/server/getpart.c | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/tests/server/getpart.c b/tests/server/getpart.c index bb8351b..d434ba2 100644 --- a/tests/server/getpart.c +++ b/tests/server/getpart.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2017, 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 @@ -66,6 +66,35 @@ curl_wcsdup_callback Curl_cwcsdup = (curl_wcsdup_callback)_wcsdup; # pragma warning(default:4232) /* MSVC extension, dllimport identity */ #endif + +/* + * Curl_convert_clone() returns a malloced copy of the source string (if + * returning CURLE_OK), with the data converted to network format. This + * function is used by base64 code in libcurl built to support data + * conversion. This is a DUMMY VERSION that returns data unmodified - for + * use by the test server only. + */ +CURLcode Curl_convert_clone(struct Curl_easy *data, + const char *indata, + size_t insize, + char **outbuf); +CURLcode Curl_convert_clone(struct Curl_easy *data, + const char *indata, + size_t insize, + char **outbuf) +{ + char *convbuf; + (void)data; + + convbuf = malloc(insize); + if(!convbuf) + return CURLE_OUT_OF_MEMORY; + + memcpy(convbuf, indata, insize); + *outbuf = convbuf; + return CURLE_OK; +} + /* * readline() * @@ -250,11 +279,11 @@ int getpart(char **outbuf, size_t *outlen, const char *main, const char *sub, FILE *stream) { # define MAX_TAG_LEN 79 - char couter[MAX_TAG_LEN+1]; /* current outermost section */ - char cmain[MAX_TAG_LEN+1]; /* current main section */ - char csub[MAX_TAG_LEN+1]; /* current sub section */ - char ptag[MAX_TAG_LEN+1]; /* potential tag */ - char patt[MAX_TAG_LEN+1]; /* potential attributes */ + char couter[MAX_TAG_LEN + 1]; /* current outermost section */ + char cmain[MAX_TAG_LEN + 1]; /* current main section */ + char csub[MAX_TAG_LEN + 1]; /* current sub section */ + char ptag[MAX_TAG_LEN + 1]; /* potential tag */ + char patt[MAX_TAG_LEN + 1]; /* potential attributes */ char *buffer = NULL; char *ptr; char *end; @@ -451,4 +480,3 @@ int getpart(char **outbuf, size_t *outlen, return error; } - |