[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 17/150: lib555: drop text conversion and encode dat
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 17/150: lib555: drop text conversion and encode data as ascii codes |
Date: |
Fri, 30 Mar 2018 16:47:51 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit bd5b9e50ce10e75048c3f584b2c7784d31504f0c
Author: Patrick Monnerat <address@hidden>
AuthorDate: Fri Jan 26 17:45:20 2018 +0100
lib555: drop text conversion and encode data as ascii codes
If CURL_DOES_CONVERSION is enabled, uploaded LFs are mapped to CRLFs,
giving a result that is different from what is expected.
This commit avoids using CURLOPT_TRANSFERTEXT and directly encodes data
to upload in ascii.
Bug: https://github.com/curl/curl/pull/1872
---
tests/data/test555 | 4 ----
tests/libtest/lib555.c | 24 ++++++++++++++----------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/tests/data/test555 b/tests/data/test555
index 3aa2ef14a..18bbc43c0 100644
--- a/tests/data/test555
+++ b/tests/data/test555
@@ -106,10 +106,6 @@ chkhostname curlhost
<strip>
^User-Agent: curl/.*
</strip>
-<strippart>
-# remove CR that CURLOPT_TRANSFERTEXT added, when CharConv enabled:
-s/^(this is the blurb we want to upload)\r\n/$1\n/ if($has_charconv)
-</strippart>
<protocol>
POST http://test.remote.example.com/path/555 HTTP/1.1
Host: test.remote.example.com
diff --git a/tests/libtest/lib555.c b/tests/libtest/lib555.c
index fc71bb643..c887b56f0 100644
--- a/tests/libtest/lib555.c
+++ b/tests/libtest/lib555.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, <address@hidden>, et al.
+ * Copyright (C) 1998 - 2018, Daniel Stenberg, <address@hidden>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -35,7 +35,15 @@
#define TEST_HANG_TIMEOUT 60 * 1000
-#define UPLOADTHIS "this is the blurb we want to upload\n"
+static const char uploadthis[] =
+#ifdef CURL_DOES_CONVERSIONS
+ /* ASCII representation with escape sequences for non-ASCII platforms */
+ "\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x62\x6c\x75\x72"
+ "\x62\x20\x77\x65\x20\x77\x61\x6e\x74\x20\x74\x6f\x20\x75\x70\x6c"
+ "\x6f\x61\x64\x0a";
+#else
+ "this is the blurb we want to upload\n";
+#endif
static size_t readcallback(void *ptr,
size_t size,
@@ -51,10 +59,10 @@ static size_t readcallback(void *ptr,
}
(*counter)++; /* bump */
- if(size * nmemb > strlen(UPLOADTHIS)) {
+ if(size * nmemb > strlen(uploadthis)) {
fprintf(stderr, "READ!\n");
- strcpy(ptr, UPLOADTHIS);
- return strlen(UPLOADTHIS);
+ strcpy(ptr, uploadthis);
+ return strlen(uploadthis);
}
fprintf(stderr, "READ NOT FINE!\n");
return 0;
@@ -98,13 +106,9 @@ int test(char *URL)
easy_setopt(curl, CURLOPT_READDATA, &counter);
/* We CANNOT do the POST fine without setting the size (or choose
chunked)! */
- easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(UPLOADTHIS));
+ easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(uploadthis));
easy_setopt(curl, CURLOPT_POST, 1L);
-#ifdef CURL_DOES_CONVERSIONS
- /* Convert the POST data to ASCII. */
- easy_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
-#endif
easy_setopt(curl, CURLOPT_PROXY, libtest_arg2);
easy_setopt(curl, CURLOPT_PROXYUSERPWD, libtest_arg3);
easy_setopt(curl, CURLOPT_PROXYAUTH,
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 02/150: Fixes for MSDOS etc., (continued)
- [GNUnet-SVN] [gnurl] 02/150: Fixes for MSDOS etc., gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 05/150: TODO: hardcode the "localhost" addresses, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 08/150: SChannel/WinSSL: Implement public key pinning, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 12/150: configure: fix the check for unsigned time_t, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 15/150: lib544: sync ascii code data with textual data, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 27/150: curl_easy_reset: clear digest auth state, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 13/150: darwinssl: Don't import client certificates into Keychain on macOS, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 14/150: GSKit: restore pinnedpubkey functionality, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 07/150: bump: towards 7.58.1, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 16/150: lib517: make variable static to avoid compiler warning, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 17/150: lib555: drop text conversion and encode data as ascii codes,
gnunet <=
- [GNUnet-SVN] [gnurl] 29/150: curl/curl.h: fix comment typo for CURLOPT_DNS_LOCAL_IP6, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 10/150: openssl: fix pinned public key build error in FIPS mode, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 38/150: fnmatch: do not match the empty string with a character set, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 18/150: docs: fix typos in man pages, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 19/150: KNOWN_BUGS: DICT responses show the underlying protocol, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 20/150: TODO: UTF-8 filenames in Content-Disposition, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 22/150: build: open VC15 projects with VS 2017, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 24/150: configure: set PATH_SEPARATOR to colon for PATH w/o separator, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 26/150: winbuild: make linker generate proper PDB, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 21/150: RELEASE-NOTES: synced with 094647fca, gnunet, 2018/03/30