]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib: remove support for CURL_DOES_CONVERSIONS
authorDaniel Stenberg <daniel@haxx.se>
Thu, 3 Feb 2022 12:04:30 +0000 (13:04 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 4 Feb 2022 07:05:35 +0000 (08:05 +0100)
TPF was the only user and support for that was dropped.

Closes #8378

95 files changed:
docs/examples/Makefile.inc
docs/examples/sampleconv.c [deleted file]
docs/libcurl/opts/CURLOPT_CONV_FROM_NETWORK_FUNCTION.3
docs/libcurl/opts/CURLOPT_CONV_FROM_UTF8_FUNCTION.3
docs/libcurl/opts/CURLOPT_CONV_TO_NETWORK_FUNCTION.3
docs/libcurl/symbols-in-versions
include/curl/curl.h
lib/Makefile.inc
lib/base64.c
lib/curl_base64.h
lib/curl_ctype.c
lib/curl_ctype.h
lib/curl_ntlm_core.c
lib/curl_ntlm_core.h
lib/curl_path.c
lib/curl_sasl.c
lib/dict.c
lib/easy.c
lib/escape.c
lib/escape.h
lib/file.c
lib/formdata.c
lib/ftp.c
lib/gopher.c
lib/http.c
lib/http2.c
lib/http_chunks.c
lib/http_negotiate.c
lib/http_ntlm.c
lib/http_proxy.c
lib/imap.c
lib/krb5.c
lib/ldap.c
lib/mime.c
lib/mqtt.c
lib/non-ascii.c [deleted file]
lib/non-ascii.h [deleted file]
lib/openldap.c
lib/pingpong.c
lib/pop3.c
lib/sendf.c
lib/setopt.c
lib/smb.c
lib/smtp.c
lib/strcase.c
lib/strcase.h
lib/strerror.c
lib/tftp.c
lib/transfer.c
lib/url.c
lib/urlapi.c
lib/urldata.h
lib/vauth/digest.c
lib/vauth/ntlm.c
lib/vauth/spnego_gssapi.c
lib/vauth/spnego_sspi.c
lib/vauth/vauth.h
lib/version.c
lib/vssh/libssh2.c
lib/vtls/openssl.c
lib/vtls/vtls.c
lib/x509asn1.c
scripts/zuul/iconv-env.sh [deleted file]
scripts/zuul/script.sh
src/Makefile.inc
src/tool_cb_dbg.c
src/tool_convert.c [deleted file]
src/tool_convert.h [deleted file]
src/tool_formparse.c
src/tool_getparam.c
src/tool_main.c
src/tool_operhlp.c
src/tool_setopt.c
tests/data/test1538
tests/libtest/lib1517.c
tests/libtest/lib508.c
tests/libtest/lib510.c
tests/libtest/lib544.c
tests/libtest/lib547.c
tests/libtest/lib552.c
tests/libtest/lib553.c
tests/libtest/lib554.c
tests/libtest/lib555.c
tests/libtest/lib556.c
tests/libtest/lib578.c
tests/libtest/lib579.c
tests/libtest/lib643.c
tests/libtest/lib650.c
tests/libtest/lib654.c
tests/libtest/lib667.c
tests/libtest/lib668.c
tests/server/util.c
tests/unit/unit1302.c
tests/unit/unit1600.c
zuul.d/jobs.yaml

index 028956f00b5b16ec11f50a07e74e1e6714a7316a..039bec13cbb7f06bbace0057d8fa21989850666d 100644 (file)
@@ -5,7 +5,7 @@
 #                            | (__| |_| |  _ <| |___
 #                             \___|\___/|_| \_\_____|
 #
-# Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2022, 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
@@ -135,7 +135,6 @@ COMPLICATED_EXAMPLES = \
   multi-uv.c \
   multithread.c \
   opensslthreadlock.c \
-  sampleconv.c \
   sessioninfo.c \
   smooth-gtk-thread.c \
   synctime.c \
diff --git a/docs/examples/sampleconv.c b/docs/examples/sampleconv.c
deleted file mode 100644 (file)
index 7aa169f..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/***************************************************************************
- *                                  _   _ ____  _
- *  Project                     ___| | | |  _ \| |
- *                             / __| | | | |_) | |
- *                            | (__| |_| |  _ <| |___
- *                             \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2020, 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 https://curl.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 COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ***************************************************************************/
-/* <DESC>
- * This is a simple example showing how a program on a non-ASCII platform
- * would invoke callbacks to do its own codeset conversions instead of
- * using the built-in iconv functions in libcurl.
- * </DESC>
- */
-/*
-
-   The IBM-1047 EBCDIC codeset is used for this example but the code
-   would be similar for other non-ASCII codesets.
-
-   Three callback functions are created below:
-        my_conv_from_ascii_to_ebcdic,
-        my_conv_from_ebcdic_to_ascii, and
-        my_conv_from_utf8_to_ebcdic
-
-   The "platform_xxx" calls represent platform-specific conversion routines.
-
- */
-
-#include <stdio.h>
-#include <curl/curl.h>
-
-static CURLcode my_conv_from_ascii_to_ebcdic(char *buffer, size_t length)
-{
-  char *tempptrin, *tempptrout;
-  size_t bytes = length;
-  int rc;
-  tempptrin = tempptrout = buffer;
-  rc = platform_a2e(&tempptrin, &bytes, &tempptrout, &bytes);
-  if(rc == PLATFORM_CONV_OK) {
-    return CURLE_OK;
-  }
-  else {
-    return CURLE_CONV_FAILED;
-  }
-}
-
-static CURLcode my_conv_from_ebcdic_to_ascii(char *buffer, size_t length)
-{
-  char *tempptrin, *tempptrout;
-  size_t bytes = length;
-  int rc;
-  tempptrin = tempptrout = buffer;
-  rc = platform_e2a(&tempptrin, &bytes, &tempptrout, &bytes);
-  if(rc == PLATFORM_CONV_OK) {
-    return CURLE_OK;
-  }
-  else {
-    return CURLE_CONV_FAILED;
-  }
-}
-
-static CURLcode my_conv_from_utf8_to_ebcdic(char *buffer, size_t length)
-{
-  char *tempptrin, *tempptrout;
-  size_t bytes = length;
-  int rc;
-  tempptrin = tempptrout = buffer;
-  rc = platform_u2e(&tempptrin, &bytes, &tempptrout, &bytes);
-  if(rc == PLATFORM_CONV_OK) {
-    return CURLE_OK;
-  }
-  else {
-    return CURLE_CONV_FAILED;
-  }
-}
-
-int main(void)
-{
-  CURL *curl;
-
-  curl = curl_easy_init();
-  if(curl) {
-    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
-
-    /* use platform-specific functions for codeset conversions */
-    curl_easy_setopt(curl, CURLOPT_CONV_FROM_NETWORK_FUNCTION,
-                     my_conv_from_ascii_to_ebcdic);
-    curl_easy_setopt(curl, CURLOPT_CONV_TO_NETWORK_FUNCTION,
-                     my_conv_from_ebcdic_to_ascii);
-    curl_easy_setopt(curl, CURLOPT_CONV_FROM_UTF8_FUNCTION,
-                     my_conv_from_utf8_to_ebcdic);
-
-    curl_easy_perform(curl);
-
-    /* always cleanup */
-    curl_easy_cleanup(curl);
-  }
-  return 0;
-}
index 0c8ce5eac9690b9b8499d7568c63d06bad9b9c7b..0f63979a4a363c19269e127f1a5000b4f840e8e1 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2022, 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
@@ -94,7 +94,10 @@ curl_easy_setopt(curl, CURLOPT_CONV_FROM_NETWORK_FUNCTION,
                  my_conv_from_ascii_to_ebcdic);
 .fi
 .SH AVAILABILITY
-Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built.
+Not available since 7.82.0
+
+Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was
+built.
 .SH RETURN VALUE
 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
 .SH "SEE ALSO"
index 0629eb51c6bbab75eda8f374b2dc65a0b8f1c6b9..a962a75ff7b6ca30d3defd1f2798a2d82399e27c 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2022, 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
@@ -92,7 +92,10 @@ curl_easy_setopt(curl, CURLOPT_CONV_FROM_UTF8_FUNCTION,
                  my_conv_from_utf8_to_ebcdic);
 .fi
 .SH AVAILABILITY
-Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built.
+Not available since 7.82.0
+
+Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was
+built.
 .SH RETURN VALUE
 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
 .SH "SEE ALSO"
index 5f63f42339e01d135d9839a3c227db727f52b65b..6c217d079f61d03cdfb3f50267d0eb2348d56df4 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2022, 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
@@ -93,7 +93,10 @@ curl_easy_setopt(curl, CURLOPT_CONV_TO_NETWORK_FUNCTION,
                  my_conv_from_ebcdic_to_ascii);
 .fi
 .SH AVAILABILITY
-Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built.
+Not available since 7.82.0
+
+Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was
+built.
 .SH RETURN VALUE
 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
 .SH "SEE ALSO"
index 3fcfa339a8c7e4d4921b461c001ea66a5e4821d8..5e683455e67de651cfaa702f896c0677e137f648 100644 (file)
@@ -47,7 +47,7 @@ CURLE_BAD_FUNCTION_ARGUMENT     7.1
 CURLE_BAD_PASSWORD_ENTERED      7.4.2         7.17.0
 CURLE_CHUNK_FAILED              7.21.0
 CURLE_CONV_FAILED               7.15.4
-CURLE_CONV_REQD                 7.15.4
+CURLE_CONV_REQD                 7.15.4        7.82.0
 CURLE_COULDNT_CONNECT           7.1
 CURLE_COULDNT_RESOLVE_HOST      7.1
 CURLE_COULDNT_RESOLVE_PROXY     7.1
@@ -391,9 +391,9 @@ CURLOPT_CONNECTTIMEOUT          7.7
 CURLOPT_CONNECTTIMEOUT_MS       7.16.2
 CURLOPT_CONNECT_ONLY            7.15.2
 CURLOPT_CONNECT_TO              7.49.0
-CURLOPT_CONV_FROM_NETWORK_FUNCTION 7.15.4
-CURLOPT_CONV_FROM_UTF8_FUNCTION 7.15.4
-CURLOPT_CONV_TO_NETWORK_FUNCTION 7.15.4
+CURLOPT_CONV_FROM_NETWORK_FUNCTION 7.15.4     7.82.0
+CURLOPT_CONV_FROM_UTF8_FUNCTION 7.15.4        7.82.0
+CURLOPT_CONV_TO_NETWORK_FUNCTION 7.15.4       7.82.0
 CURLOPT_COOKIE                  7.1
 CURLOPT_COOKIEFILE              7.1
 CURLOPT_COOKIEJAR               7.9
index dff724fbe8fecd55d323d49219fc8750018f21f7..5b270906d238e2ae8ddbcfc0d2c8d0ccfe34bec9 100644 (file)
@@ -524,10 +524,6 @@ typedef enum {
   CURLE_UPLOAD_FAILED,           /* 25 - failed upload "command" */
   CURLE_READ_ERROR,              /* 26 - couldn't open/read from file */
   CURLE_OUT_OF_MEMORY,           /* 27 */
-  /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
-           instead of a memory allocation error if CURL_DOES_CONVERSIONS
-           is defined
-  */
   CURLE_OPERATION_TIMEDOUT,      /* 28 - the timeout time was reached */
   CURLE_OBSOLETE29,              /* 29 - NOT USED */
   CURLE_FTP_PORT_FAILED,         /* 30 - FTP PORT operation failed */
@@ -580,11 +576,7 @@ typedef enum {
   CURLE_REMOTE_FILE_EXISTS,      /* 73 - File already exists */
   CURLE_TFTP_NOSUCHUSER,         /* 74 - No such user */
   CURLE_CONV_FAILED,             /* 75 - conversion failed */
-  CURLE_CONV_REQD,               /* 76 - caller must register conversion
-                                    callbacks using curl_easy_setopt options
-                                    CURLOPT_CONV_FROM_NETWORK_FUNCTION,
-                                    CURLOPT_CONV_TO_NETWORK_FUNCTION, and
-                                    CURLOPT_CONV_FROM_UTF8_FUNCTION */
+  CURLE_OBSOLETE76,              /* 76 - NOT IN USE since 7.82.0 */
   CURLE_SSL_CACERT_BADFILE,      /* 77 - could not load CACERT file, missing
                                     or wrong format */
   CURLE_REMOTE_FILE_NOT_FOUND,   /* 78 - remote file not found */
@@ -684,6 +676,7 @@ typedef enum {
 #define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
 #define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
 #define CURLE_LDAP_INVALID_URL CURLE_OBSOLETE62
+#define CURLE_CONV_REQD CURLE_OBSOLETE76
 
 /* This was the error code 50 in 7.7.3 and a few earlier versions, this
    is no longer used by libcurl but is instead #defined here only to not
index fedd70a16079256228e42d7031ff285e0de0ca33..74e600742083576e35f9b5f6cecc5c5c0db6191c 100644 (file)
@@ -168,7 +168,6 @@ LIB_CFILES =         \
   mqtt.c             \
   multi.c            \
   netrc.c            \
-  non-ascii.c        \
   nonblock.c         \
   openldap.c         \
   parsedate.c        \
@@ -289,7 +288,6 @@ LIB_HFILES =         \
   multihandle.h      \
   multiif.h          \
   netrc.h            \
-  non-ascii.h        \
   nonblock.h         \
   parsedate.h        \
   pingpong.h         \
index 527e29955a3e7a924843676a313073952879d297..960a1ca3ad82de75373003cf10aa3d3222dcfaf6 100644 (file)
@@ -34,7 +34,6 @@
 #include "urldata.h" /* for the Curl_easy definition */
 #include "warnless.h"
 #include "curl_base64.h"
-#include "non-ascii.h"
 
 /* The last 3 #include files should be in this order */
 #include "curl_printf.h"
@@ -176,19 +175,15 @@ CURLcode Curl_base64_decode(const char *src,
 }
 
 static CURLcode base64_encode(const char *table64,
-                              struct Curl_easy *data,
                               const char *inputbuff, size_t insize,
                               char **outptr, size_t *outlen)
 {
-  CURLcode result;
   unsigned char ibuf[3];
   unsigned char obuf[4];
   int i;
   int inputparts;
   char *output;
   char *base64data;
-  char *convbuf = NULL;
-
   const char *indata = inputbuff;
 
   *outptr = NULL;
@@ -206,20 +201,6 @@ static CURLcode base64_encode(const char *table64,
   if(!output)
     return CURLE_OUT_OF_MEMORY;
 
-  /*
-   * The base64 data needs to be created using the network encoding
-   * not the host encoding.  And we can't change the actual input
-   * so we copy it to a buffer, translate it, and use that instead.
-   */
-  result = Curl_convert_clone(data, indata, insize, &convbuf);
-  if(result) {
-    free(output);
-    return result;
-  }
-
-  if(convbuf)
-    indata = (char *)convbuf;
-
   while(insize > 0) {
     for(i = inputparts = 0; i < 3; i++) {
       if(insize > 0) {
@@ -270,8 +251,6 @@ static CURLcode base64_encode(const char *table64,
   /* Return the pointer to the new data (allocated memory) */
   *outptr = base64data;
 
-  free(convbuf);
-
   /* Return the length of the new data */
   *outlen = output - base64data;
 
@@ -295,11 +274,10 @@ static CURLcode base64_encode(const char *table64,
  *
  * @unittest: 1302
  */
-CURLcode Curl_base64_encode(struct Curl_easy *data,
-                            const char *inputbuff, size_t insize,
+CURLcode Curl_base64_encode(const char *inputbuff, size_t insize,
                             char **outptr, size_t *outlen)
 {
-  return base64_encode(base64, data, inputbuff, insize, outptr, outlen);
+  return base64_encode(base64, inputbuff, insize, outptr, outlen);
 }
 
 /*
@@ -319,11 +297,10 @@ CURLcode Curl_base64_encode(struct Curl_easy *data,
  *
  * @unittest: 1302
  */
-CURLcode Curl_base64url_encode(struct Curl_easy *data,
-                               const char *inputbuff, size_t insize,
+CURLcode Curl_base64url_encode(const char *inputbuff, size_t insize,
                                char **outptr, size_t *outlen)
 {
-  return base64_encode(base64url, data, inputbuff, insize, outptr, outlen);
+  return base64_encode(base64url, inputbuff, insize, outptr, outlen);
 }
 
 #endif /* no users so disabled */
index d48edc424145eff473b8cb9889ae672d800acc20..4cb9d73537c1ee0c5732d29df0d2e67f5f2c8538 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
  *
  ***************************************************************************/
 
-CURLcode Curl_base64_encode(struct Curl_easy *data,
-                            const char *inputbuff, size_t insize,
+CURLcode Curl_base64_encode(const char *inputbuff, size_t insize,
                             char **outptr, size_t *outlen);
-CURLcode Curl_base64url_encode(struct Curl_easy *data,
-                               const char *inputbuff, size_t insize,
+CURLcode Curl_base64url_encode(const char *inputbuff, size_t insize,
                                char **outptr, size_t *outlen);
-
 CURLcode Curl_base64_decode(const char *src,
                             unsigned char **outptr, size_t *outlen);
 
index d6cd08a0773ccd27ec6c5f0938dd9062ed60cdaa..233a69e76fe53286f8503b80618707f29261579b 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -22,8 +22,6 @@
 
 #include "curl_setup.h"
 
-#ifndef CURL_DOES_CONVERSIONS
-
 #undef _U
 #define _U (1<<0) /* upper case */
 #undef _L
@@ -130,4 +128,3 @@ int Curl_iscntrl(int c)
   return (ascii[c] & (_C));
 }
 
-#endif /* !CURL_DOES_CONVERSIONS */
index 17dfaa09424a384a6976032692c3b6976073c0a4..2fa749dca9b645f20fe283508684edc4e0cd7b82 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
 
 #include "curl_setup.h"
 
-#ifdef CURL_DOES_CONVERSIONS
-
-/*
- * Uppercase macro versions of ANSI/ISO is*() functions/macros which
- * avoid negative number inputs with argument byte codes > 127.
- *
- * For non-ASCII platforms the C library character classification routines
- * are used despite being locale-dependent, because this is better than
- * not to work at all.
- */
-#include <ctype.h>
-
-#define ISSPACE(x)  (isspace((int)  ((unsigned char)x)))
-#define ISDIGIT(x)  (isdigit((int)  ((unsigned char)x)))
-#define ISALNUM(x)  (isalnum((int)  ((unsigned char)x)))
-#define ISXDIGIT(x) (isxdigit((int) ((unsigned char)x)))
-#define ISGRAPH(x)  (isgraph((int)  ((unsigned char)x)))
-#define ISALPHA(x)  (isalpha((int)  ((unsigned char)x)))
-#define ISPRINT(x)  (isprint((int)  ((unsigned char)x)))
-#define ISUPPER(x)  (isupper((int)  ((unsigned char)x)))
-#define ISLOWER(x)  (islower((int)  ((unsigned char)x)))
-#define ISCNTRL(x)  (iscntrl((int)  ((unsigned char)x)))
-#define ISASCII(x)  (isascii((int)  ((unsigned char)x)))
-
-#else
-
 int Curl_isspace(int c);
 int Curl_isdigit(int c);
 int Curl_isalnum(int c);
@@ -73,8 +47,6 @@ int Curl_iscntrl(int c);
 #define ISCNTRL(x)  (Curl_iscntrl((int)  ((unsigned char)x)))
 #define ISASCII(x)  (((x) >= 0) && ((x) <= 0x80))
 
-#endif
-
 #define ISBLANK(x)  (int)((((unsigned char)x) == ' ') ||        \
                           (((unsigned char)x) == '\t'))
 
index ed123d0c1c3a54dec57d4484d04c2f3a490c3fa1..d1387ee72d83c233f364525623fbfd465c500df9 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
 #endif
 
 #include "urldata.h"
-#include "non-ascii.h"
 #include "strcase.h"
 #include "curl_ntlm_core.h"
 #include "curl_md5.h"
@@ -402,11 +401,9 @@ void Curl_ntlm_core_lm_resp(const unsigned char *keys,
 /*
  * Set up lanmanager hashed password
  */
-CURLcode Curl_ntlm_core_mk_lm_hash(struct Curl_easy *data,
-                                   const char *password,
+CURLcode Curl_ntlm_core_mk_lm_hash(const char *password,
                                    unsigned char *lmbuffer /* 21 bytes */)
 {
-  CURLcode result;
   unsigned char pw[14];
   static const unsigned char magic[] = {
     0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25 /* i.e. KGS!@#$% */
@@ -416,14 +413,6 @@ CURLcode Curl_ntlm_core_mk_lm_hash(struct Curl_easy *data,
   Curl_strntoupper((char *)pw, password, len);
   memset(&pw[len], 0, 14 - len);
 
-  /*
-   * The LanManager hashed password needs to be created using the
-   * password in the network encoding not the host encoding.
-   */
-  result = Curl_convert_to_network(data, (char *)pw, 14);
-  if(result)
-    return result;
-
   {
     /* Create LanManager hashed password. */
 
@@ -484,13 +473,11 @@ static void ascii_uppercase_to_unicode_le(unsigned char *dest,
  * Set up nt hashed passwords
  * @unittest: 1600
  */
-CURLcode Curl_ntlm_core_mk_nt_hash(struct Curl_easy *data,
-                                   const char *password,
+CURLcode Curl_ntlm_core_mk_nt_hash(const char *password,
                                    unsigned char *ntbuffer /* 21 bytes */)
 {
   size_t len = strlen(password);
   unsigned char *pw;
-  CURLcode result;
   if(len > SIZE_T_MAX/2) /* avoid integer overflow */
     return CURLE_OUT_OF_MEMORY;
   pw = len ? malloc(len * 2) : (unsigned char *)strdup("");
@@ -499,19 +486,13 @@ CURLcode Curl_ntlm_core_mk_nt_hash(struct Curl_easy *data,
 
   ascii_to_unicode_le(pw, password, len);
 
-  /*
-   * The NT hashed password needs to be created using the password in the
-   * network encoding not the host encoding.
-   */
-  result = Curl_convert_to_network(data, (char *)pw, len * 2);
-  if(!result) {
-    /* Create NT hashed password. */
-    Curl_md4it(ntbuffer, pw, 2 * len);
-    memset(ntbuffer + 16, 0, 21 - 16);
-  }
+  /* Create NT hashed password. */
+  Curl_md4it(ntbuffer, pw, 2 * len);
+  memset(ntbuffer + 16, 0, 21 - 16);
+
   free(pw);
 
-  return result;
+  return CURLE_OK;
 }
 
 #if defined(USE_NTLM_V2) && !defined(USE_WINDOWS_SSPI)
index 02b39d485841e71e9b3b4b1482a87b4c80675134..957d9cbfe68e6febd05e74c9dcd44a744997cbe0 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -67,13 +67,11 @@ void Curl_ntlm_core_lm_resp(const unsigned char *keys,
                             const unsigned char *plaintext,
                             unsigned char *results);
 
-CURLcode Curl_ntlm_core_mk_lm_hash(struct Curl_easy *data,
-                                   const char *password,
+CURLcode Curl_ntlm_core_mk_lm_hash(const char *password,
                                    unsigned char *lmbuffer /* 21 bytes */);
 
 #ifdef USE_NTRESPONSES
-CURLcode Curl_ntlm_core_mk_nt_hash(struct Curl_easy *data,
-                                   const char *password,
+CURLcode Curl_ntlm_core_mk_nt_hash(const char *password,
                                    unsigned char *ntbuffer /* 21 bytes */);
 
 #if defined(USE_NTLM_V2) && !defined(USE_WINDOWS_SSPI)
index 65106188c7221fdb469fe651c8e83d5ed916426f..a1669d12f7ae1cc90f0ca6e137126d08c66923f7 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -40,7 +40,7 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data,
   char *working_path;
   size_t working_path_len;
   CURLcode result =
-    Curl_urldecode(data, data->state.up.path, 0, &working_path,
+    Curl_urldecode(data->state.up.path, 0, &working_path,
                    &working_path_len, REJECT_ZERO);
   if(result)
     return result;
index 8d39e4f81b45ff4de27d074a4c99667ba7a47a70..bf2484ef0530d702cd2949205249db0290180089 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 2012 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 2012 - 2022, 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
@@ -48,7 +48,6 @@
 #include "warnless.h"
 #include "strtok.h"
 #include "sendf.h"
-#include "non-ascii.h" /* included for Curl_convert_... prototypes */
 /* The last 3 #include files should be in this order */
 #include "curl_printf.h"
 #include "curl_memory.h"
@@ -283,8 +282,7 @@ static CURLcode get_server_message(struct SASL *sasl, struct Curl_easy *data,
 }
 
 /* Encode the outgoing SASL message. */
-static CURLcode build_message(struct SASL *sasl, struct Curl_easy *data,
-                              struct bufref *msg)
+static CURLcode build_message(struct SASL *sasl, struct bufref *msg)
 {
   CURLcode result = CURLE_OK;
 
@@ -297,7 +295,7 @@ static CURLcode build_message(struct SASL *sasl, struct Curl_easy *data,
       char *base64;
       size_t base64len;
 
-      result = Curl_base64_encode(data, (const char *) Curl_bufref_ptr(msg),
+      result = Curl_base64_encode((const char *) Curl_bufref_ptr(msg),
                                   Curl_bufref_len(msg), &base64, &base64len);
       if(!result)
         Curl_bufref_set(msg, base64, base64len, curl_free);
@@ -494,7 +492,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct Curl_easy *data,
   if(!result && mech) {
     sasl->curmech = mech;
     if(Curl_bufref_ptr(&resp))
-      result = build_message(sasl, data, &resp);
+      result = build_message(sasl, &resp);
 
     if(sasl->params->maxirlen &&
        strlen(mech) + Curl_bufref_len(&resp) > sasl->params->maxirlen)
@@ -729,7 +727,7 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct Curl_easy *data,
     newstate = SASL_CANCEL;
     break;
   case CURLE_OK:
-    result = build_message(sasl, data, &resp);
+    result = build_message(sasl, &resp);
     if(!result)
       result = sasl->params->contauth(data, sasl->curmech, &resp);
     break;
index 5d53b8f1ff1c2fea9f4d7db514f8f6d77b6f5c32..73b0e3176184d509fd28473c611b7ef93f894442 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -96,13 +96,13 @@ const struct Curl_handler Curl_handler_dict = {
   PROTOPT_NONE | PROTOPT_NOURLQUERY     /* flags */
 };
 
-static char *unescape_word(struct Curl_easy *data, const char *inputbuff)
+static char *unescape_word(const char *inputbuff)
 {
   char *newp = NULL;
   char *dictp;
   size_t len;
 
-  CURLcode result = Curl_urldecode(data, inputbuff, 0, &newp, &len,
+  CURLcode result = Curl_urldecode(inputbuff, 0, &newp, &len,
                                    REJECT_NADA);
   if(!newp || result)
     return NULL;
@@ -226,7 +226,7 @@ static CURLcode dict_do(struct Curl_easy *data, bool *done)
       strategy = (char *)".";
     }
 
-    eword = unescape_word(data, word);
+    eword = unescape_word(word);
     if(!eword)
       return CURLE_OUT_OF_MEMORY;
 
@@ -274,7 +274,7 @@ static CURLcode dict_do(struct Curl_easy *data, bool *done)
       database = (char *)"!";
     }
 
-    eword = unescape_word(data, word);
+    eword = unescape_word(word);
     if(!eword)
       return CURLE_OUT_OF_MEMORY;
 
index a225191d620ff104cb896b88169ba1fb36381919..0e23561376ed983934b240410b3f432586cce672 100644 (file)
@@ -68,7 +68,6 @@
 #include "slist.h"
 #include "mime.h"
 #include "amigaos.h"
-#include "non-ascii.h"
 #include "warnless.h"
 #include "multiif.h"
 #include "sigpipe.h"
@@ -927,8 +926,6 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data)
   }
 #endif /* USE_ARES */
 
-  Curl_convert_setup(outcurl);
-
   Curl_initinfo(outcurl);
 
   outcurl->magic = CURLEASY_MAGIC_NUMBER;
index 53361fb0851aad3f02ac28c5e315cd03d96ff39b..ff5887508e60b6d74e6dd9ab3b1640658a777cb8 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "urldata.h"
 #include "warnless.h"
-#include "non-ascii.h"
 #include "escape.h"
 #include "strdup.h"
 /* The last 3 #include files should be in this order */
@@ -80,8 +79,8 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string,
                        int inlength)
 {
   size_t length;
-  CURLcode result;
   struct dynbuf d;
+  (void)data;
 
   if(inlength < 0)
     return NULL;
@@ -102,16 +101,7 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string,
     }
     else {
       /* encode it */
-      char encoded[4];
-      result = Curl_convert_to_network(data, (char *)&in, 1);
-      if(result) {
-        /* Curl_convert_to_network calls failf if unsuccessful */
-        Curl_dyn_free(&d);
-        return NULL;
-      }
-
-      msnprintf(encoded, sizeof(encoded), "%%%02X", in);
-      if(Curl_dyn_add(&d, encoded))
+      if(Curl_dyn_addf(&d, "%%%02X", in))
         return NULL;
     }
     string++;
@@ -126,8 +116,7 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string,
  * Returns a pointer to a malloced string in *ostring with length given in
  * *olen. If length == 0, the length is assumed to be strlen(string).
  *
- * 'data' can be set to NULL but then this function can't convert network
- * data to host for non-ascii.
+ * 'data' can be set to NULL
  *
  * ctrl options:
  * - REJECT_NADA: accept everything
@@ -139,8 +128,7 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string,
  * invokes that used TRUE/FALSE (0 and 1).
  */
 
-CURLcode Curl_urldecode(struct Curl_easy *data,
-                        const char *string, size_t length,
+CURLcode Curl_urldecode(const char *string, size_t length,
                         char **ostring, size_t *olen,
                         enum urlreject ctrl)
 {
@@ -148,7 +136,6 @@ CURLcode Curl_urldecode(struct Curl_easy *data,
   char *ns;
   size_t strindex = 0;
   unsigned long hex;
-  CURLcode result = CURLE_OK;
 
   DEBUGASSERT(string);
   DEBUGASSERT(ctrl >= REJECT_NADA); /* crash on TRUE/FALSE */
@@ -174,15 +161,6 @@ CURLcode Curl_urldecode(struct Curl_easy *data,
 
       in = curlx_ultouc(hex); /* this long is never bigger than 255 anyway */
 
-      if(data) {
-        result = Curl_convert_from_network(data, (char *)&in, 1);
-        if(result) {
-          /* Curl_convert_from_network calls failf if unsuccessful */
-          free(ns);
-          return result;
-        }
-      }
-
       string += 2;
       alloc -= 2;
     }
@@ -218,10 +196,11 @@ char *curl_easy_unescape(struct Curl_easy *data, const char *string,
                          int length, int *olen)
 {
   char *str = NULL;
+  (void)data;
   if(length >= 0) {
     size_t inputlen = length;
     size_t outputlen;
-    CURLcode res = Curl_urldecode(data, string, inputlen, &str, &outputlen,
+    CURLcode res = Curl_urldecode(string, inputlen, &str, &outputlen,
                                   REJECT_NADA);
     if(res)
       return NULL;
index 46cb59039a1e3781494adcf66f6c46d8d6dfa55f..02668835cc6a3a7239ef8d8cefb1a3654e9110db 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -32,8 +32,7 @@ enum urlreject {
   REJECT_ZERO
 };
 
-CURLcode Curl_urldecode(struct Curl_easy *data,
-                        const char *string, size_t length,
+CURLcode Curl_urldecode(const char *string, size_t length,
                         char **ostring, size_t *olen,
                         enum urlreject ctrl);
 
index 0420db3454919ce18efb908206e857880d3beb53..3da79a2c1b1fd0d1e4be6cad89004d042fecc048 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -147,7 +147,7 @@ static CURLcode file_connect(struct Curl_easy *data, bool *done)
 #endif
   size_t real_path_len;
 
-  CURLcode result = Curl_urldecode(data, data->state.up.path, 0, &real_path,
+  CURLcode result = Curl_urldecode(data->state.up.path, 0, &real_path,
                                    &real_path_len, REJECT_ZERO);
   if(result)
     return result;
index ce11d5b484a6939c8958cd9f8df586aa96f3051a..5fefd7a6efd705449c2fa5faf2e83fa308805993 100644 (file)
@@ -33,7 +33,6 @@
 
 #include "urldata.h" /* for struct Curl_easy */
 #include "mime.h"
-#include "non-ascii.h"
 #include "vtls/vtls.h"
 #include "strcase.h"
 #include "sendf.h"
@@ -274,14 +273,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
        * Set the Name property.
        */
     case CURLFORM_PTRNAME:
-#ifdef CURL_DOES_CONVERSIONS
-      /* Treat CURLFORM_PTR like CURLFORM_COPYNAME so that libcurl will copy
-       * the data in all cases so that we'll have safe memory for the eventual
-       * conversion.
-       */
-#else
       current_form->flags |= HTTPPOST_PTRNAME; /* fall through */
-#endif
+
       /* FALLTHROUGH */
     case CURLFORM_COPYNAME:
       if(current_form->name)
@@ -906,11 +899,6 @@ CURLcode Curl_getformdata(struct Curl_easy *data,
           else
             uclen = (size_t)clen;
           result = curl_mime_data(part, post->contents, uclen);
-#ifdef CURL_DOES_CONVERSIONS
-          /* Convert textual contents now. */
-          if(!result && data && part->datasize)
-            result = Curl_convert_to_network(data, part->data, part->datasize);
-#endif
         }
       }
 
index f6921e42620cd207420dc18c6eaeffed0f45130b..5487961137d71c1297d698e98f937fe852f93cc1 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -76,7 +76,6 @@
 #include "speedcheck.h"
 #include "warnless.h"
 #include "http_proxy.h"
-#include "non-ascii.h"
 #include "socks.h"
 /* The last 3 #include files should be in this order */
 #include "curl_printf.h"
@@ -1460,7 +1459,7 @@ static CURLcode ftp_state_list(struct Curl_easy *data)
     /* url-decode before evaluation: e.g. paths starting/ending with %2f */
     const char *slashPos = NULL;
     char *rawPath = NULL;
-    result = Curl_urldecode(data, ftp->path, 0, &rawPath, NULL, REJECT_CTRL);
+    result = Curl_urldecode(ftp->path, 0, &rawPath, NULL, REJECT_CTRL);
     if(result)
       return result;
 
@@ -3247,7 +3246,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status,
 
   if(!result)
     /* get the url-decoded "raw" path */
-    result = Curl_urldecode(data, ftp->path, 0, &rawPath, &pathLen,
+    result = Curl_urldecode(ftp->path, 0, &rawPath, &pathLen,
                             REJECT_CTRL);
   if(result) {
     /* We can limp along anyway (and should try to since we may already be in
@@ -4131,7 +4130,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data)
   ftpc->cwdfail = FALSE;
 
   /* url-decode ftp path before further evaluation */
-  result = Curl_urldecode(data, ftp->path, 0, &rawPath, &pathLen, REJECT_CTRL);
+  result = Curl_urldecode(ftp->path, 0, &rawPath, &pathLen, REJECT_CTRL);
   if(result)
     return result;
 
index f61232ff56135688e399359e144c099c527dc0ea..0a3ba8fb565e468dd9a9134b0c4c5ff37a118aab 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -165,7 +165,7 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done)
     newp += 2;
 
     /* ... and finally unescape */
-    result = Curl_urldecode(data, newp, 0, &sel, &len, REJECT_ZERO);
+    result = Curl_urldecode(newp, 0, &sel, &len, REJECT_ZERO);
     free(gopherpath);
     if(result)
       return result;
index c036d877e560d1f7ebedfcfe9fb926f12ac8c0de..d9043bcad796d3c2c37a0e060e982d9602fdfa8f 100644 (file)
@@ -77,7 +77,6 @@
 #include "content_encoding.h"
 #include "http_proxy.h"
 #include "warnless.h"
-#include "non-ascii.h"
 #include "http2.h"
 #include "connect.h"
 #include "strdup.h"
@@ -327,7 +326,7 @@ static CURLcode http_output_basic(struct Curl_easy *data, bool proxy)
   if(!out)
     return CURLE_OUT_OF_MEMORY;
 
-  result = Curl_base64_encode(data, out, strlen(out), &authorization, &size);
+  result = Curl_base64_encode(out, strlen(out), &authorization, &size);
   if(result)
     goto fail;
 
@@ -1251,14 +1250,6 @@ CURLcode Curl_buffer_send(struct dynbuf *in,
 
   DEBUGASSERT(size > (size_t)included_body_bytes);
 
-  result = Curl_convert_to_network(data, ptr, headersize);
-  /* Curl_convert_to_network calls failf if unsuccessful */
-  if(result) {
-    /* conversion failed, free memory and return to the caller */
-    Curl_dyn_free(in);
-    return result;
-  }
-
   if((conn->handler->flags & PROTOPT_SSL
 #ifndef CURL_DISABLE_PROXY
       || conn->http_proxy.proxytype == CURLPROXY_HTTPS
@@ -3308,20 +3299,6 @@ checkhttpprefix(struct Curl_easy *data,
   struct curl_slist *head = data->set.http200aliases;
   statusline rc = STATUS_BAD;
   statusline onmatch = len >= 5? STATUS_DONE : STATUS_UNKNOWN;
-#ifdef CURL_DOES_CONVERSIONS
-  /* convert from the network encoding using a scratch area */
-  char *scratch = strdup(s);
-  if(!scratch) {
-    failf(data, "Failed to allocate memory for conversion!");
-    return FALSE; /* can't return CURLE_OUT_OF_MEMORY so return FALSE */
-  }
-  if(CURLE_OK != Curl_convert_from_network(data, scratch, strlen(s) + 1)) {
-    /* Curl_convert_from_network calls failf if unsuccessful */
-    free(scratch);
-    return FALSE; /* can't return CURLE_foobar so return FALSE */
-  }
-  s = scratch;
-#endif /* CURL_DOES_CONVERSIONS */
 
   while(head) {
     if(checkprefixmax(head->data, s, len)) {
@@ -3334,9 +3311,6 @@ checkhttpprefix(struct Curl_easy *data,
   if((rc != STATUS_DONE) && (checkprefixmax("HTTP/", s, len)))
     rc = onmatch;
 
-#ifdef CURL_DOES_CONVERSIONS
-  free(scratch);
-#endif /* CURL_DOES_CONVERSIONS */
   return rc;
 }
 
@@ -3347,26 +3321,9 @@ checkrtspprefix(struct Curl_easy *data,
 {
   statusline result = STATUS_BAD;
   statusline onmatch = len >= 5? STATUS_DONE : STATUS_UNKNOWN;
-
-#ifdef CURL_DOES_CONVERSIONS
-  /* convert from the network encoding using a scratch area */
-  char *scratch = strdup(s);
-  if(!scratch) {
-    failf(data, "Failed to allocate memory for conversion!");
-    return FALSE; /* can't return CURLE_OUT_OF_MEMORY so return FALSE */
-  }
-  if(CURLE_OK != Curl_convert_from_network(data, scratch, strlen(s) + 1)) {
-    /* Curl_convert_from_network calls failf if unsuccessful */
-    result = FALSE; /* can't return CURLE_foobar so return FALSE */
-  }
-  else if(checkprefixmax("RTSP/", scratch, len))
-    result = onmatch;
-  free(scratch);
-#else
   (void)data; /* unused */
   if(checkprefixmax("RTSP/", s, len))
     result = onmatch;
-#endif /* CURL_DOES_CONVERSIONS */
 
   return result;
 }
@@ -3903,21 +3860,10 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
       size_t headerlen;
       /* Zero-length header line means end of headers! */
 
-#ifdef CURL_DOES_CONVERSIONS
-      if(0x0d == *headp) {
-        *headp = '\r'; /* replace with CR in host encoding */
-        headp++;       /* pass the CR byte */
-      }
-      if(0x0a == *headp) {
-        *headp = '\n'; /* replace with LF in host encoding */
-        headp++;       /* pass the LF byte */
-      }
-#else
       if('\r' == *headp)
         headp++; /* pass the \r byte */
       if('\n' == *headp)
         headp++; /* pass the \n byte */
-#endif /* CURL_DOES_CONVERSIONS */
 
       if(100 <= k->httpcode && 199 >= k->httpcode) {
         /* "A user agent MAY ignore unexpected 1xx status responses." */
@@ -4189,26 +4135,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
       int httpversion_major;
       int rtspversion_major;
       int nc = 0;
-#ifdef CURL_DOES_CONVERSIONS
-#define HEADER1 scratch
-#define SCRATCHSIZE 21
-      CURLcode res;
-      char scratch[SCRATCHSIZE + 1]; /* "HTTP/major.minor 123" */
-      /* We can't really convert this yet because we don't know if it's the
-         1st header line or the body.  So we do a partial conversion into a
-         scratch area, leaving the data at 'headp' as-is.
-      */
-      strncpy(&scratch[0], headp, SCRATCHSIZE);
-      scratch[SCRATCHSIZE] = 0; /* null terminate */
-      res = Curl_convert_from_network(data,
-                                      &scratch[0],
-                                      SCRATCHSIZE);
-      if(res)
-        /* Curl_convert_from_network calls failf if unsuccessful */
-        return res;
-#else
 #define HEADER1 headp /* no conversion needed, just use headp */
-#endif /* CURL_DOES_CONVERSIONS */
 
       if(conn->handler->protocol & PROTO_FAMILY_HTTP) {
         /*
@@ -4333,11 +4260,6 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
       }
     }
 
-    result = Curl_convert_from_network(data, headp, strlen(headp));
-    /* Curl_convert_from_network calls failf if unsuccessful */
-    if(result)
-      return result;
-
     result = Curl_http_header(data, conn, headp);
     if(result)
       return result;
index e74400a4caa0517fdf26a9d24b8e24efaa8cbae0..652be3f8afe8cf1915a2bbfe726bcb517f727ee0 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -1337,7 +1337,7 @@ CURLcode Curl_http2_request_upgrade(struct dynbuf *req,
   }
   conn->proto.httpc.binlen = binlen;
 
-  result = Curl_base64url_encode(data, (const char *)binsettings, binlen,
+  result = Curl_base64url_encode((const char *)binsettings, binlen,
                                  &base64, &blen);
   if(result) {
     Curl_dyn_free(req);
index beb96958846a406abf0e7521405a1f442065ff31..72d6f385bbfeb65a31eb1d6d4a7dc1c4c72f877c 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -29,7 +29,6 @@
 #include "dynbuf.h"
 #include "content_encoding.h"
 #include "http.h"
-#include "non-ascii.h" /* for Curl_convert_to_network prototype */
 #include "strtoofft.h"
 #include "warnless.h"
 
 
  */
 
-#ifdef CURL_DOES_CONVERSIONS
-/* Check for an ASCII hex digit.
-   We avoid the use of ISXDIGIT to accommodate non-ASCII hosts. */
-static bool isxdigit_ascii(char digit)
-{
-  return (digit >= 0x30 && digit <= 0x39) /* 0-9 */
-    || (digit >= 0x41 && digit <= 0x46) /* A-F */
-    || (digit >= 0x61 && digit <= 0x66); /* a-f */
-}
-#else
 #define isxdigit_ascii(x) Curl_isxdigit(x)
-#endif
 
 void Curl_httpchunk_init(struct Curl_easy *data)
 {
@@ -157,14 +145,6 @@ CHUNKcode Curl_httpchunk_read(struct Curl_easy *data,
         /* length and datap are unmodified */
         ch->hexbuffer[ch->hexindex] = 0;
 
-        /* convert to host encoding before calling strtoul */
-        result = Curl_convert_from_network(data, ch->hexbuffer, ch->hexindex);
-        if(result) {
-          /* Curl_convert_from_network calls failf if unsuccessful */
-          /* Treat it as a bad hex character */
-          return CHUNKE_ILLEGAL_HEX;
-        }
-
         if(curlx_strtoofft(ch->hexbuffer, &endptr, 16, &ch->datasize))
           return CHUNKE_ILLEGAL_HEX;
         ch->state = CHUNK_LF; /* now wait for the CRLF */
@@ -240,13 +220,6 @@ CHUNKcode Curl_httpchunk_read(struct Curl_easy *data,
 
           tr = Curl_dyn_ptr(&conn->trailer);
           trlen = Curl_dyn_len(&conn->trailer);
-          /* Convert to host encoding before calling Curl_client_write */
-          result = Curl_convert_from_network(data, tr, trlen);
-          if(result)
-            /* Curl_convert_from_network calls failf if unsuccessful */
-            /* Treat it as a bad chunk */
-            return CHUNKE_BAD_CHUNK;
-
           if(!data->set.http_te_skip) {
             result = Curl_client_write(data, CLIENTWRITE_HEADER, tr, trlen);
             if(result) {
index 5f764dc136b2697ee3b6113e6e11bb76449b8dc4..888d3b24a2cc4ecd9a2f70cd8a20fbd28a2abc09 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -161,7 +161,7 @@ CURLcode Curl_output_negotiate(struct Curl_easy *data,
         return result;
     }
 
-    result = Curl_auth_create_spnego_message(data, neg_ctx, &base64, &len);
+    result = Curl_auth_create_spnego_message(neg_ctx, &base64, &len);
     if(result)
       return result;
 
index a6526db9f7aa74603c1e73d37d0d5356eec744b7..bb7e5360f967e1bec1e340656b6deb2d1d226a11 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -213,8 +213,7 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy)
                                                  ntlm, &ntlmmsg);
     if(!result) {
       DEBUGASSERT(Curl_bufref_len(&ntlmmsg) != 0);
-      result = Curl_base64_encode(data,
-                                  (const char *) Curl_bufref_ptr(&ntlmmsg),
+      result = Curl_base64_encode((const char *) Curl_bufref_ptr(&ntlmmsg),
                                   Curl_bufref_len(&ntlmmsg), &base64, &len);
       if(!result) {
         free(*allocuserpwd);
@@ -233,8 +232,7 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy)
     result = Curl_auth_create_ntlm_type3_message(data, userp, passwdp,
                                                  ntlm, &ntlmmsg);
     if(!result && Curl_bufref_len(&ntlmmsg)) {
-      result = Curl_base64_encode(data,
-                                  (const char *) Curl_bufref_ptr(&ntlmmsg),
+      result = Curl_base64_encode((const char *) Curl_bufref_ptr(&ntlmmsg),
                                   Curl_bufref_len(&ntlmmsg), &base64, &len);
       if(!result) {
         free(*allocuserpwd);
index e13f485a734228ca71ce13c1aa4728057c35f9f0..2793459cd57745596a572a8ef87925881f075b8e 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -35,7 +35,6 @@
 #include "url.h"
 #include "select.h"
 #include "progress.h"
-#include "non-ascii.h"
 #include "connect.h"
 #include "curlx.h"
 #include "vtls/vtls.h"
@@ -481,12 +480,6 @@ static CURLcode CONNECT(struct Curl_easy *data,
         linep = Curl_dyn_ptr(&s->rcvbuf);
         perline = Curl_dyn_len(&s->rcvbuf); /* amount of bytes in this line */
 
-        /* convert from the network encoding */
-        result = Curl_convert_from_network(data, linep, perline);
-        /* Curl_convert_from_network calls failf if unsuccessful */
-        if(result)
-          return result;
-
         /* output debug if that is requested */
         Curl_debug(data, CURLINFO_HEADER_IN, linep, perline);
 
index 958ad1456c1b85d451bd6ab8d8deb3320a0f5849..70e4b8306e44581cc51bf215a38e256e3a723297 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -1986,7 +1986,7 @@ static CURLcode imap_parse_url_path(struct Curl_easy *data)
     if(end > begin && end[-1] == '/')
       end--;
 
-    result = Curl_urldecode(data, begin, end - begin, &imap->mailbox, NULL,
+    result = Curl_urldecode(begin, end - begin, &imap->mailbox, NULL,
                             REJECT_CTRL);
     if(result)
       return result;
@@ -2009,7 +2009,7 @@ static CURLcode imap_parse_url_path(struct Curl_easy *data)
       return CURLE_URL_MALFORMAT;
 
     /* Decode the name parameter */
-    result = Curl_urldecode(data, begin, ptr - begin, &name, NULL,
+    result = Curl_urldecode(begin, ptr - begin, &name, NULL,
                             REJECT_CTRL);
     if(result)
       return result;
@@ -2020,7 +2020,7 @@ static CURLcode imap_parse_url_path(struct Curl_easy *data)
       ptr++;
 
     /* Decode the value parameter */
-    result = Curl_urldecode(data, begin, ptr - begin, &value, &valuelen,
+    result = Curl_urldecode(begin, ptr - begin, &value, &valuelen,
                             REJECT_CTRL);
     if(result) {
       free(name);
@@ -2108,7 +2108,7 @@ static CURLcode imap_parse_custom_request(struct Curl_easy *data)
 
   if(custom) {
     /* URL decode the custom request */
-    result = Curl_urldecode(data, custom, 0, &imap->custom, NULL, REJECT_CTRL);
+    result = Curl_urldecode(custom, 0, &imap->custom, NULL, REJECT_CTRL);
 
     /* Extract the parameters if specified */
     if(!result) {
index 5edd34cbdf957e16fe49a4a2b5108c243e6df875..787137c19290e57700ebba057f8c6477ab8dfa99 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
  * (Royal Institute of Technology, Stockholm, Sweden).
- * Copyright (c) 2004 - 2021 Daniel Stenberg
+ * Copyright (c) 2004 - 2022 Daniel Stenberg
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,6 @@
 #include "sendf.h"
 #include "curl_krb5.h"
 #include "warnless.h"
-#include "non-ascii.h"
 #include "strcase.h"
 #include "strdup.h"
 
@@ -81,11 +80,6 @@ static CURLcode ftpsend(struct Curl_easy *data, struct connectdata *conn,
   write_len += 2;
   bytes_written = 0;
 
-  result = Curl_convert_to_network(data, s, write_len);
-  /* Curl_convert_to_network calls failf if unsuccessful */
-  if(result)
-    return result;
-
   for(;;) {
 #ifdef HAVE_GSSAPI
     conn->data_prot = PROT_CMD;
@@ -298,7 +292,7 @@ krb5_auth(void *app_data, struct Curl_easy *data, struct connectdata *conn)
       if(output_buffer.length) {
         char *cmd;
 
-        result = Curl_base64_encode(data, (char *)output_buffer.value,
+        result = Curl_base64_encode((char *)output_buffer.value,
                                     output_buffer.length, &p, &base64_sz);
         if(result) {
           infof(data, "base64-encoding: %s", curl_easy_strerror(result));
@@ -612,7 +606,7 @@ static void do_sec_send(struct Curl_easy *data, struct connectdata *conn,
     return; /* error */
 
   if(iscmd) {
-    error = Curl_base64_encode(data, buffer, curlx_sitouz(bytes),
+    error = Curl_base64_encode(buffer, curlx_sitouz(bytes),
                                &cmd_buffer, &cmd_size);
     if(error) {
       free(buffer);
index 3e3562078053e6cd0362c20239cea4aa1a4efa2b..0b3ee373b43699a843bc63bdf6d5c4592a85ff53 100644 (file)
@@ -636,11 +636,8 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
           if((attr_len > 7) &&
              (strcmp(";binary", (char *) attr + (attr_len - 7)) == 0)) {
             /* Binary attribute, encode to base64. */
-            result = Curl_base64_encode(data,
-                                        vals[i]->bv_val,
-                                        vals[i]->bv_len,
-                                        &val_b64,
-                                        &val_b64_sz);
+            result = Curl_base64_encode(vals[i]->bv_val, vals[i]->bv_len,
+                                        &val_b64, &val_b64_sz);
             if(result) {
               ldap_value_free_len(vals);
               FREE_ON_WINLDAP(attr);
@@ -870,7 +867,7 @@ static int _ldap_url_parse2(struct Curl_easy *data,
     LDAP_TRACE(("DN '%s'\n", dn));
 
     /* Unescape the DN */
-    result = Curl_urldecode(data, dn, 0, &unescaped, NULL, REJECT_ZERO);
+    result = Curl_urldecode(dn, 0, &unescaped, NULL, REJECT_ZERO);
     if(result) {
       rc = LDAP_NO_MEMORY;
 
@@ -935,7 +932,7 @@ static int _ldap_url_parse2(struct Curl_easy *data,
       LDAP_TRACE(("attr[%zu] '%s'\n", i, attributes[i]));
 
       /* Unescape the attribute */
-      result = Curl_urldecode(data, attributes[i], 0, &unescaped, NULL,
+      result = Curl_urldecode(attributes[i], 0, &unescaped, NULL,
                               REJECT_ZERO);
       if(result) {
         free(attributes);
@@ -1005,7 +1002,7 @@ static int _ldap_url_parse2(struct Curl_easy *data,
     LDAP_TRACE(("filter '%s'\n", filter));
 
     /* Unescape the filter */
-    result = Curl_urldecode(data, filter, 0, &unescaped, NULL, REJECT_ZERO);
+    result = Curl_urldecode(filter, 0, &unescaped, NULL, REJECT_ZERO);
     if(result) {
       rc = LDAP_NO_MEMORY;
 
index 7783b8990a03e4350e2d53ddb5f72a603eb13fda..3cf420b84ecf66429dc130828dff9da117e0ddfd 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -25,7 +25,6 @@
 #include <curl/curl.h>
 
 #include "mime.h"
-#include "non-ascii.h"
 #include "warnless.h"
 #include "urldata.h"
 #include "sendf.h"
@@ -506,15 +505,6 @@ static size_t encoder_base64_read(char *buffer, size_t size, bool ateof,
     }
   }
 
-#ifdef CURL_DOES_CONVERSIONS
-  /* This is now textual data, Convert character codes. */
-  if(part->easy && cursize) {
-    CURLcode result = Curl_convert_to_network(part->easy, buffer, cursize);
-    if(result)
-      return READ_ERROR;
-  }
-#endif
-
   return cursize;
 }
 
@@ -925,9 +915,6 @@ static size_t readback_part(curl_mimepart *part,
                             char *buffer, size_t bufsize, bool *hasread)
 {
   size_t cursize = 0;
-#ifdef CURL_DOES_CONVERSIONS
-  char *convbuf = buffer;
-#endif
 
   /* Readback from part. */
 
@@ -967,15 +954,6 @@ static size_t readback_part(curl_mimepart *part,
         mimesetstate(&part->state, MIMESTATE_BODY, NULL);
       break;
     case MIMESTATE_BODY:
-#ifdef CURL_DOES_CONVERSIONS
-      if(part->easy && convbuf < buffer) {
-        CURLcode result = Curl_convert_to_network(part->easy, convbuf,
-                                                  buffer - convbuf);
-        if(result)
-          return READ_ERROR;
-        convbuf = buffer;
-      }
-#endif
       cleanup_encoder_state(&part->encstate);
       mimesetstate(&part->state, MIMESTATE_CONTENT, NULL);
       break;
@@ -1012,16 +990,6 @@ static size_t readback_part(curl_mimepart *part,
     bufsize -= sz;
   }
 
-#ifdef CURL_DOES_CONVERSIONS
-      if(part->easy && convbuf < buffer &&
-         part->state.state < MIMESTATE_BODY) {
-        CURLcode result = Curl_convert_to_network(part->easy, convbuf,
-                                                  buffer - convbuf);
-        if(result)
-          return READ_ERROR;
-      }
-#endif
-
   return cursize;
 }
 
@@ -1031,10 +999,6 @@ static size_t mime_subparts_read(char *buffer, size_t size, size_t nitems,
 {
   curl_mime *mime = (curl_mime *) instream;
   size_t cursize = 0;
-#ifdef CURL_DOES_CONVERSIONS
-  char *convbuf = buffer;
-#endif
-
   (void) size;   /* Always 1. */
 
   while(nitems) {
@@ -1043,9 +1007,6 @@ static size_t mime_subparts_read(char *buffer, size_t size, size_t nitems,
     switch(mime->state.state) {
     case MIMESTATE_BEGIN:
     case MIMESTATE_BODY:
-#ifdef CURL_DOES_CONVERSIONS
-      convbuf = buffer;
-#endif
       mimesetstate(&mime->state, MIMESTATE_BOUNDARY1, mime->firstpart);
       /* The first boundary always follows the header termination empty line,
          so is always preceded by a CRLF. We can then spare 2 characters
@@ -1061,15 +1022,6 @@ static size_t mime_subparts_read(char *buffer, size_t size, size_t nitems,
       sz = readback_bytes(&mime->state, buffer, nitems, mime->boundary,
                           strlen(mime->boundary), part? "\r\n": "--\r\n");
       if(!sz) {
-#ifdef CURL_DOES_CONVERSIONS
-        if(mime->easy && convbuf < buffer) {
-          CURLcode result = Curl_convert_to_network(mime->easy, convbuf,
-                                                    buffer - convbuf);
-          if(result)
-            return READ_ERROR;
-          convbuf = buffer;
-        }
-#endif
         mimesetstate(&mime->state, MIMESTATE_CONTENT, part);
       }
       break;
@@ -1086,9 +1038,6 @@ static size_t mime_subparts_read(char *buffer, size_t size, size_t nitems,
       case STOP_FILLING:
         return cursize? cursize: sz;
       case 0:
-#ifdef CURL_DOES_CONVERSIONS
-        convbuf = buffer;
-#endif
         mimesetstate(&mime->state, MIMESTATE_BOUNDARY1, part->nextpart);
         break;
       }
@@ -1105,16 +1054,6 @@ static size_t mime_subparts_read(char *buffer, size_t size, size_t nitems,
     nitems -= sz;
   }
 
-#ifdef CURL_DOES_CONVERSIONS
-      if(mime->easy && convbuf < buffer &&
-         mime->state.state <= MIMESTATE_CONTENT) {
-        CURLcode result = Curl_convert_to_network(mime->easy, convbuf,
-                                                  buffer - convbuf);
-        if(result)
-          return READ_ERROR;
-      }
-#endif
-
   return cursize;
 }
 
index c056ae77b243081215b2e458c88291708182c9ef..e0fa0aa8fb17f3193d797d0a41cf8ab22f692bf6 100644 (file)
@@ -386,8 +386,7 @@ static CURLcode mqtt_get_topic(struct Curl_easy *data,
 {
   char *path = data->state.up.path;
   if(strlen(path) > 1)
-    return Curl_urldecode(data, path + 1, 0, topic, topiclen,
-                          REJECT_NADA);
+    return Curl_urldecode(path + 1, 0, topic, topiclen, REJECT_NADA);
   failf(data, "No MQTT topic found. Forgot to URL encode it?");
   return CURLE_URL_MALFORMAT;
 }
diff --git a/lib/non-ascii.c b/lib/non-ascii.c
deleted file mode 100644 (file)
index 3b77ae9..0000000
+++ /dev/null
@@ -1,336 +0,0 @@
-/***************************************************************************
- *                                  _   _ ____  _
- *  Project                     ___| | | |  _ \| |
- *                             / __| | | | |_) | |
- *                            | (__| |_| |  _ <| |___
- *                             \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2021, 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 https://curl.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 COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ***************************************************************************/
-
-#include "curl_setup.h"
-
-#ifdef CURL_DOES_CONVERSIONS
-
-#include <curl/curl.h>
-
-#include "non-ascii.h"
-#include "formdata.h"
-#include "sendf.h"
-#include "urldata.h"
-#include "multiif.h"
-#include "strerror.h"
-
-#include "curl_memory.h"
-/* The last #include file should be: */
-#include "memdebug.h"
-
-#ifdef HAVE_ICONV
-#include <iconv.h>
-/* set default codesets for iconv */
-#ifndef CURL_ICONV_CODESET_OF_NETWORK
-#define CURL_ICONV_CODESET_OF_NETWORK "ISO8859-1"
-#endif
-#ifndef CURL_ICONV_CODESET_FOR_UTF8
-#define CURL_ICONV_CODESET_FOR_UTF8   "UTF-8"
-#endif
-#define ICONV_ERROR  (size_t)-1
-#endif /* HAVE_ICONV */
-
-/*
- * Curl_convert_clone() returns a malloced copy of the source string (if
- * returning CURLE_OK), with the data converted to network format.
- */
-CURLcode Curl_convert_clone(struct Curl_easy *data,
-                           const char *indata,
-                           size_t insize,
-                           char **outbuf)
-{
-  char *convbuf;
-  CURLcode result;
-
-  convbuf = malloc(insize);
-  if(!convbuf)
-    return CURLE_OUT_OF_MEMORY;
-
-  memcpy(convbuf, indata, insize);
-  result = Curl_convert_to_network(data, convbuf, insize);
-  if(result) {
-    free(convbuf);
-    return result;
-  }
-
-  *outbuf = convbuf; /* return the converted buffer */
-
-  return CURLE_OK;
-}
-
-/*
- * Curl_convert_to_network() is an internal function for performing ASCII
- * conversions on non-ASCII platforms. It converts the buffer _in place_.
- */
-CURLcode Curl_convert_to_network(struct Curl_easy *data,
-                                 char *buffer, size_t length)
-{
-  if(data && data->set.convtonetwork) {
-    /* use translation callback */
-    CURLcode result;
-    Curl_set_in_callback(data, true);
-    result = data->set.convtonetwork(buffer, length);
-    Curl_set_in_callback(data, false);
-    if(result) {
-      failf(data,
-            "CURLOPT_CONV_TO_NETWORK_FUNCTION callback returned %d: %s",
-            (int)result, curl_easy_strerror(result));
-    }
-
-    return result;
-  }
-  else {
-#ifdef HAVE_ICONV
-    /* do the translation ourselves */
-    iconv_t tmpcd = (iconv_t) -1;
-    iconv_t *cd = &tmpcd;
-    char *input_ptr, *output_ptr;
-    size_t in_bytes, out_bytes, rc;
-    char ebuffer[STRERROR_LEN];
-
-    /* open an iconv conversion descriptor if necessary */
-    if(data)
-      cd = &data->outbound_cd;
-    if(*cd == (iconv_t)-1) {
-      *cd = iconv_open(CURL_ICONV_CODESET_OF_NETWORK,
-                       CURL_ICONV_CODESET_OF_HOST);
-      if(*cd == (iconv_t)-1) {
-        failf(data,
-              "The iconv_open(\"%s\", \"%s\") call failed with errno %i: %s",
-              CURL_ICONV_CODESET_OF_NETWORK,
-              CURL_ICONV_CODESET_OF_HOST,
-              errno, Curl_strerror(errno, ebuffer, sizeof(ebuffer)));
-        return CURLE_CONV_FAILED;
-      }
-    }
-    /* call iconv */
-    input_ptr = output_ptr = buffer;
-    in_bytes = out_bytes = length;
-    rc = iconv(*cd, &input_ptr, &in_bytes,
-               &output_ptr, &out_bytes);
-    if(!data)
-      iconv_close(tmpcd);
-    if((rc == ICONV_ERROR) || (in_bytes)) {
-      failf(data,
-            "The Curl_convert_to_network iconv call failed with errno %i: %s",
-            errno, Curl_strerror(errno, ebuffer, sizeof(ebuffer)));
-      return CURLE_CONV_FAILED;
-    }
-#else
-    failf(data, "CURLOPT_CONV_TO_NETWORK_FUNCTION callback required");
-    return CURLE_CONV_REQD;
-#endif /* HAVE_ICONV */
-  }
-
-  return CURLE_OK;
-}
-
-/*
- * Curl_convert_from_network() is an internal function for performing ASCII
- * conversions on non-ASCII platforms. It converts the buffer _in place_.
- */
-CURLcode Curl_convert_from_network(struct Curl_easy *data,
-                                   char *buffer, size_t length)
-{
-  if(data && data->set.convfromnetwork) {
-    /* use translation callback */
-    CURLcode result;
-    Curl_set_in_callback(data, true);
-    result = data->set.convfromnetwork(buffer, length);
-    Curl_set_in_callback(data, false);
-    if(result) {
-      failf(data,
-            "CURLOPT_CONV_FROM_NETWORK_FUNCTION callback returned %d: %s",
-            (int)result, curl_easy_strerror(result));
-    }
-
-    return result;
-  }
-  else {
-#ifdef HAVE_ICONV
-    /* do the translation ourselves */
-    iconv_t tmpcd = (iconv_t) -1;
-    iconv_t *cd = &tmpcd;
-    char *input_ptr, *output_ptr;
-    size_t in_bytes, out_bytes, rc;
-    char ebuffer[STRERROR_LEN];
-
-    /* open an iconv conversion descriptor if necessary */
-    if(data)
-      cd = &data->inbound_cd;
-    if(*cd == (iconv_t)-1) {
-      *cd = iconv_open(CURL_ICONV_CODESET_OF_HOST,
-                       CURL_ICONV_CODESET_OF_NETWORK);
-      if(*cd == (iconv_t)-1) {
-        failf(data,
-              "The iconv_open(\"%s\", \"%s\") call failed with errno %i: %s",
-              CURL_ICONV_CODESET_OF_HOST,
-              CURL_ICONV_CODESET_OF_NETWORK,
-              errno, Curl_strerror(errno, ebuffer, sizeof(ebuffer)));
-        return CURLE_CONV_FAILED;
-      }
-    }
-    /* call iconv */
-    input_ptr = output_ptr = buffer;
-    in_bytes = out_bytes = length;
-    rc = iconv(*cd, &input_ptr, &in_bytes,
-               &output_ptr, &out_bytes);
-    if(!data)
-      iconv_close(tmpcd);
-    if((rc == ICONV_ERROR) || (in_bytes)) {
-      failf(data,
-            "Curl_convert_from_network iconv call failed with errno %i: %s",
-            errno, Curl_strerror(errno, ebuffer, sizeof(ebuffer)));
-      return CURLE_CONV_FAILED;
-    }
-#else
-    failf(data, "CURLOPT_CONV_FROM_NETWORK_FUNCTION callback required");
-    return CURLE_CONV_REQD;
-#endif /* HAVE_ICONV */
-  }
-
-  return CURLE_OK;
-}
-
-/*
- * Curl_convert_from_utf8() is an internal function for performing UTF-8
- * conversions on non-ASCII platforms.
- */
-CURLcode Curl_convert_from_utf8(struct Curl_easy *data,
-                                char *buffer, size_t length)
-{
-  if(data && data->set.convfromutf8) {
-    /* use translation callback */
-    CURLcode result;
-    Curl_set_in_callback(data, true);
-    result = data->set.convfromutf8(buffer, length);
-    Curl_set_in_callback(data, false);
-    if(result) {
-      failf(data,
-            "CURLOPT_CONV_FROM_UTF8_FUNCTION callback returned %d: %s",
-            (int)result, curl_easy_strerror(result));
-    }
-
-    return result;
-  }
-  else {
-#ifdef HAVE_ICONV
-    /* do the translation ourselves */
-    iconv_t tmpcd = (iconv_t) -1;
-    iconv_t *cd = &tmpcd;
-    char *input_ptr;
-    char *output_ptr;
-    size_t in_bytes, out_bytes, rc;
-    char ebuffer[STRERROR_LEN];
-
-    /* open an iconv conversion descriptor if necessary */
-    if(data)
-      cd = &data->utf8_cd;
-    if(*cd == (iconv_t)-1) {
-      *cd = iconv_open(CURL_ICONV_CODESET_OF_HOST,
-                       CURL_ICONV_CODESET_FOR_UTF8);
-      if(*cd == (iconv_t)-1) {
-        failf(data,
-              "The iconv_open(\"%s\", \"%s\") call failed with errno %i: %s",
-              CURL_ICONV_CODESET_OF_HOST,
-              CURL_ICONV_CODESET_FOR_UTF8,
-              errno, Curl_strerror(errno, ebuffer, sizeof(ebuffer)));
-        return CURLE_CONV_FAILED;
-      }
-    }
-    /* call iconv */
-    input_ptr = output_ptr = buffer;
-    in_bytes = out_bytes = length;
-    rc = iconv(*cd, &input_ptr, &in_bytes,
-               &output_ptr, &out_bytes);
-    if(!data)
-      iconv_close(tmpcd);
-    if((rc == ICONV_ERROR) || (in_bytes)) {
-      failf(data,
-            "The Curl_convert_from_utf8 iconv call failed with errno %i: %s",
-            errno, Curl_strerror(errno, ebuffer, sizeof(ebuffer)));
-      return CURLE_CONV_FAILED;
-    }
-    if(output_ptr < input_ptr) {
-      /* null terminate the now shorter output string */
-      *output_ptr = 0x00;
-    }
-#else
-    failf(data, "CURLOPT_CONV_FROM_UTF8_FUNCTION callback required");
-    return CURLE_CONV_REQD;
-#endif /* HAVE_ICONV */
-  }
-
-  return CURLE_OK;
-}
-
-/*
- * Init conversion stuff for a Curl_easy
- */
-void Curl_convert_init(struct Curl_easy *data)
-{
-#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV)
-  /* conversion descriptors for iconv calls */
-  data->outbound_cd = (iconv_t)-1;
-  data->inbound_cd  = (iconv_t)-1;
-  data->utf8_cd     = (iconv_t)-1;
-#else
-  (void)data;
-#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */
-}
-
-/*
- * Setup conversion stuff for a Curl_easy
- */
-void Curl_convert_setup(struct Curl_easy *data)
-{
-  data->inbound_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST,
-                                CURL_ICONV_CODESET_OF_NETWORK);
-  data->outbound_cd = iconv_open(CURL_ICONV_CODESET_OF_NETWORK,
-                                 CURL_ICONV_CODESET_OF_HOST);
-  data->utf8_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST,
-                             CURL_ICONV_CODESET_FOR_UTF8);
-}
-
-/*
- * Close conversion stuff for a Curl_easy
- */
-
-void Curl_convert_close(struct Curl_easy *data)
-{
-#ifdef HAVE_ICONV
-  /* close iconv conversion descriptors */
-  if(data->inbound_cd != (iconv_t)-1) {
-    iconv_close(data->inbound_cd);
-  }
-  if(data->outbound_cd != (iconv_t)-1) {
-    iconv_close(data->outbound_cd);
-  }
-  if(data->utf8_cd != (iconv_t)-1) {
-    iconv_close(data->utf8_cd);
-  }
-#else
-  (void)data;
-#endif /* HAVE_ICONV */
-}
-
-#endif /* CURL_DOES_CONVERSIONS */
diff --git a/lib/non-ascii.h b/lib/non-ascii.h
deleted file mode 100644 (file)
index 458e8ef..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef HEADER_CURL_NON_ASCII_H
-#define HEADER_CURL_NON_ASCII_H
-/***************************************************************************
- *                                  _   _ ____  _
- *  Project                     ___| | | |  _ \| |
- *                             / __| | | | |_) | |
- *                            | (__| |_| |  _ <| |___
- *                             \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2020, 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 https://curl.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 COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ***************************************************************************/
-#include "curl_setup.h"
-
-#ifdef CURL_DOES_CONVERSIONS
-
-#include "urldata.h"
-
-/*
- * Curl_convert_clone() returns a malloced copy of the source string (if
- * returning CURLE_OK), with the data converted to network format.
- *
- * If no conversion was needed *outbuf may be NULL.
- */
-CURLcode Curl_convert_clone(struct Curl_easy *data,
-                            const char *indata,
-                            size_t insize,
-                            char **outbuf);
-
-void Curl_convert_init(struct Curl_easy *data);
-void Curl_convert_setup(struct Curl_easy *data);
-void Curl_convert_close(struct Curl_easy *data);
-
-CURLcode Curl_convert_to_network(struct Curl_easy *data,
-                                 char *buffer, size_t length);
-CURLcode Curl_convert_from_network(struct Curl_easy *data,
-                                 char *buffer, size_t length);
-CURLcode Curl_convert_from_utf8(struct Curl_easy *data,
-                                 char *buffer, size_t length);
-#else
-#define Curl_convert_clone(a,b,c,d) ((void)a, CURLE_OK)
-#define Curl_convert_init(x) Curl_nop_stmt
-#define Curl_convert_setup(x) Curl_nop_stmt
-#define Curl_convert_close(x) Curl_nop_stmt
-#define Curl_convert_to_network(a,b,c) ((void)a, CURLE_OK)
-#define Curl_convert_from_network(a,b,c) ((void)a, CURLE_OK)
-#define Curl_convert_from_utf8(a,b,c) ((void)a, CURLE_OK)
-#endif
-
-#endif /* HEADER_CURL_NON_ASCII_H */
index 6ed513f9fe710e201b54540b676d2d02d2b2baf7..4f0dad8358bae27178135a6198092cb6811ad233 100644 (file)
@@ -1083,7 +1083,7 @@ static ssize_t oldap_recv(struct Curl_easy *data, int sockindex, char *buf,
 
           /* Binary value, encode to base64. */
           if(bvals[i].bv_len)
-            result = Curl_base64_encode(data, bvals[i].bv_val, bvals[i].bv_len,
+            result = Curl_base64_encode(bvals[i].bv_val, bvals[i].bv_len,
                                         &val_b64, &val_b64_sz);
           if(!result)
             result = client_write(data, ": ", val_b64, val_b64_sz, "\n");
index 84c7f51de52110e47186bff8f02dbda45646c564..1453bf299aade9f0cd89ddfcf09ab8fca3c077a5 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -32,7 +32,6 @@
 #include "speedcheck.h"
 #include "pingpong.h"
 #include "multiif.h"
-#include "non-ascii.h"
 #include "vtls/vtls.h"
 
 /* The last 3 #include files should be in this order */
@@ -199,11 +198,6 @@ CURLcode Curl_pp_vsendf(struct Curl_easy *data,
   s = Curl_dyn_ptr(&pp->sendbuf);
   Curl_pp_init(data, pp);
 
-  result = Curl_convert_to_network(data, s, write_len);
-  /* Curl_convert_to_network calls failf if unsuccessful */
-  if(result)
-    return result;
-
 #ifdef HAVE_GSSAPI
   conn->data_prot = PROT_CMD;
 #endif
@@ -324,11 +318,6 @@ CURLcode Curl_pp_readresp(struct Curl_easy *data,
       if(result == CURLE_AGAIN)
         return CURLE_OK; /* return */
 
-      if(!result && (gotbytes > 0))
-        /* convert from the network encoding */
-        result = Curl_convert_from_network(data, ptr, gotbytes);
-      /* Curl_convert_from_network calls failf if unsuccessful */
-
       if(result)
         /* Set outer result variable to this error. */
         keepon = FALSE;
index d4ca67877d7fb711ba5f7bf0793d826e14ca4e07..d2fd92a4bcb24289be7cdcda70e7bff35437f3bb 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -1423,7 +1423,7 @@ static CURLcode pop3_parse_url_path(struct Curl_easy *data)
   const char *path = &data->state.up.path[1]; /* skip leading path */
 
   /* URL decode the path for the message ID */
-  return Curl_urldecode(data, path, 0, &pop3->id, NULL, REJECT_CTRL);
+  return Curl_urldecode(path, 0, &pop3->id, NULL, REJECT_CTRL);
 }
 
 /***********************************************************************
@@ -1440,7 +1440,7 @@ static CURLcode pop3_parse_custom_request(struct Curl_easy *data)
 
   /* URL decode the custom request */
   if(custom)
-    result = Curl_urldecode(data, custom, 0, &pop3->custom, NULL, REJECT_CTRL);
+    result = Curl_urldecode(custom, 0, &pop3->custom, NULL, REJECT_CTRL);
 
   return result;
 }
index bcfa27a501ff4c17ed8f5eaa1343b53dd72dab2d..220c7dd7ba711574d61038e7e9daa575c4c2f9ab 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -41,7 +41,6 @@
 #include "vssh/ssh.h"
 #include "easyif.h"
 #include "multiif.h"
-#include "non-ascii.h"
 #include "strerror.h"
 #include "select.h"
 #include "strdup.h"
@@ -628,19 +627,14 @@ CURLcode Curl_client_write(struct Curl_easy *data,
 
   /* FTP data may need conversion. */
   if((type & CLIENTWRITE_BODY) &&
-    (conn->handler->protocol & PROTO_FAMILY_FTP) &&
-    conn->proto.ftpc.transfertype == 'A') {
-    /* convert from the network encoding */
-    CURLcode result = Curl_convert_from_network(data, ptr, len);
-    /* Curl_convert_from_network calls failf if unsuccessful */
-    if(result)
-      return result;
+     (conn->handler->protocol & PROTO_FAMILY_FTP) &&
+     conn->proto.ftpc.transfertype == 'A') {
 
 #ifdef CURL_DO_LINEEND_CONV
     /* convert end-of-line markers */
     len = convert_lineends(data, ptr, len);
 #endif /* CURL_DO_LINEEND_CONV */
-    }
+  }
 
   return chop_write(data, type, ptr, len);
 }
@@ -716,44 +710,6 @@ int Curl_debug(struct Curl_easy *data, curl_infotype type,
   if(data->set.verbose) {
     static const char s_infotype[CURLINFO_END][3] = {
       "* ", "< ", "> ", "{ ", "} ", "{ ", "} " };
-
-#ifdef CURL_DOES_CONVERSIONS
-    char *buf = NULL;
-    size_t conv_size = 0;
-
-    switch(type) {
-    case CURLINFO_HEADER_OUT:
-      buf = Curl_memdup(ptr, size);
-      if(!buf)
-        return 1;
-      conv_size = size;
-
-      /* Special processing is needed for this block if it
-       * contains both headers and data (separated by CRLFCRLF).
-       * We want to convert just the headers, leaving the data as-is.
-       */
-      if(size > 4) {
-        size_t i;
-        for(i = 0; i < size-4; i++) {
-          if(memcmp(&buf[i], "\x0d\x0a\x0d\x0a", 4) == 0) {
-            /* convert everything through this CRLFCRLF but no further */
-            conv_size = i + 4;
-            break;
-          }
-        }
-      }
-
-      Curl_convert_from_network(data, buf, conv_size);
-      /* Curl_convert_from_network calls failf if unsuccessful */
-      /* we might as well continue even if it fails...   */
-      ptr = buf; /* switch pointer to use my buffer instead */
-      break;
-    default:
-      /* leave everything else as-is */
-      break;
-    }
-#endif /* CURL_DOES_CONVERSIONS */
-
     if(data->set.fdebug) {
       Curl_set_in_callback(data, true);
       rc = (*data->set.fdebug)(data, type, ptr, size, data->set.debugdata);
@@ -766,20 +722,11 @@ int Curl_debug(struct Curl_easy *data, curl_infotype type,
       case CURLINFO_HEADER_IN:
         fwrite(s_infotype[type], 2, 1, data->set.err);
         fwrite(ptr, size, 1, data->set.err);
-#ifdef CURL_DOES_CONVERSIONS
-        if(size != conv_size) {
-          /* we had untranslated data so we need an explicit newline */
-          fwrite("\n", 1, 1, data->set.err);
-        }
-#endif
         break;
       default: /* nada */
         break;
       }
     }
-#ifdef CURL_DOES_CONVERSIONS
-    free(buf);
-#endif
   }
   return rc;
 }
index c8350aa3ff8e3e7b1e4d0cb50769cfbd7a3befc0..6bd1a531c1f4ee4db0dfd39a62da90b7453a117c 100644 (file)
@@ -1643,24 +1643,6 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
      */
     data->set.seek_client = va_arg(param, void *);
     break;
-  case CURLOPT_CONV_FROM_NETWORK_FUNCTION:
-    /*
-     * "Convert from network encoding" callback
-     */
-    data->set.convfromnetwork = va_arg(param, curl_conv_callback);
-    break;
-  case CURLOPT_CONV_TO_NETWORK_FUNCTION:
-    /*
-     * "Convert to network encoding" callback
-     */
-    data->set.convtonetwork = va_arg(param, curl_conv_callback);
-    break;
-  case CURLOPT_CONV_FROM_UTF8_FUNCTION:
-    /*
-     * "Convert from UTF-8 encoding" callback
-     */
-    data->set.convfromutf8 = va_arg(param, curl_conv_callback);
-    break;
   case CURLOPT_IOCTLFUNCTION:
     /*
      * I/O control callback. Might be NULL.
index fd49cf6aaf6ebed63087504146dc8b4ad0f85034..bada68ee0da1b7341c3f5001c4a55338cb7776eb 100644 (file)
--- a/lib/smb.c
+++ b/lib/smb.c
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 2016 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 2016 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
  * Copyright (C) 2014, Bill Nagel <wnagel@tycoint.com>, Exacq Technologies
  *
  * This software is licensed as described in the file COPYING, which
@@ -459,10 +459,10 @@ static CURLcode smb_send_setup(struct Curl_easy *data)
   if(byte_count > sizeof(msg.bytes))
     return CURLE_FILESIZE_EXCEEDED;
 
-  Curl_ntlm_core_mk_lm_hash(data, conn->passwd, lm_hash);
+  Curl_ntlm_core_mk_lm_hash(conn->passwd, lm_hash);
   Curl_ntlm_core_lm_resp(lm_hash, smbc->challenge, lm);
 #ifdef USE_NTRESPONSES
-  Curl_ntlm_core_mk_nt_hash(data, conn->passwd, nt_hash);
+  Curl_ntlm_core_mk_nt_hash(conn->passwd, nt_hash);
   Curl_ntlm_core_lm_resp(nt_hash, smbc->challenge, nt);
 #else
   memset(nt, 0, sizeof(nt));
@@ -989,7 +989,7 @@ static CURLcode smb_parse_url_path(struct Curl_easy *data,
   char *slash;
 
   /* URL decode the path */
-  CURLcode result = Curl_urldecode(data, data->state.up.path, 0, &path, NULL,
+  CURLcode result = Curl_urldecode(data->state.up.path, 0, &path, NULL,
                                    REJECT_CTRL);
   if(result)
     return result;
index 6c0829378350eb7ecb7906acc8e94634bbe39e85..dbae801b1e7d384e9cb6872bcdff2b7ad354f751 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -1724,8 +1724,7 @@ static CURLcode smtp_parse_url_path(struct Curl_easy *data)
   }
 
   /* URL decode the path and use it as the domain in our EHLO */
-  return Curl_urldecode(data, path, 0, &smtpc->domain, NULL,
-                        REJECT_CTRL);
+  return Curl_urldecode(path, 0, &smtpc->domain, NULL, REJECT_CTRL);
 }
 
 /***********************************************************************
@@ -1742,7 +1741,7 @@ static CURLcode smtp_parse_custom_request(struct Curl_easy *data)
 
   /* URL decode the custom request */
   if(custom)
-    result = Curl_urldecode(data, custom, 0, &smtp->custom, NULL, REJECT_CTRL);
+    result = Curl_urldecode(custom, 0, &smtp->custom, NULL, REJECT_CTRL);
 
   return result;
 }
index 955e3c79eadb00e225d994d6b8d38fc85694bcb6..dd46ca1ba0e51869885f82b68d71f7bfb777bcc5 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
 
 static char raw_tolower(char in);
 
-/* Portable, consistent toupper (remember EBCDIC). Do not use toupper() because
-   its behavior is altered by the current locale. */
+/* Portable, consistent toupper. Do not use toupper() because its behavior is
+   altered by the current locale. */
 char Curl_raw_toupper(char in)
 {
-#if !defined(CURL_DOES_CONVERSIONS)
   if(in >= 'a' && in <= 'z')
     return (char)('A' + in - 'a');
-#else
-  switch(in) {
-  case 'a':
-    return 'A';
-  case 'b':
-    return 'B';
-  case 'c':
-    return 'C';
-  case 'd':
-    return 'D';
-  case 'e':
-    return 'E';
-  case 'f':
-    return 'F';
-  case 'g':
-    return 'G';
-  case 'h':
-    return 'H';
-  case 'i':
-    return 'I';
-  case 'j':
-    return 'J';
-  case 'k':
-    return 'K';
-  case 'l':
-    return 'L';
-  case 'm':
-    return 'M';
-  case 'n':
-    return 'N';
-  case 'o':
-    return 'O';
-  case 'p':
-    return 'P';
-  case 'q':
-    return 'Q';
-  case 'r':
-    return 'R';
-  case 's':
-    return 'S';
-  case 't':
-    return 'T';
-  case 'u':
-    return 'U';
-  case 'v':
-    return 'V';
-  case 'w':
-    return 'W';
-  case 'x':
-    return 'X';
-  case 'y':
-    return 'Y';
-  case 'z':
-    return 'Z';
-  }
-#endif
-
   return in;
 }
 
 
-/* Portable, consistent tolower (remember EBCDIC). Do not use tolower() because
-   its behavior is altered by the current locale. */
+/* Portable, consistent tolower. Do not use tolower() because its behavior is
+   altered by the current locale. */
 static char raw_tolower(char in)
 {
-#if !defined(CURL_DOES_CONVERSIONS)
   if(in >= 'A' && in <= 'Z')
     return (char)('a' + in - 'A');
-#else
-  switch(in) {
-  case 'A':
-    return 'a';
-  case 'B':
-    return 'b';
-  case 'C':
-    return 'c';
-  case 'D':
-    return 'd';
-  case 'E':
-    return 'e';
-  case 'F':
-    return 'f';
-  case 'G':
-    return 'g';
-  case 'H':
-    return 'h';
-  case 'I':
-    return 'i';
-  case 'J':
-    return 'j';
-  case 'K':
-    return 'k';
-  case 'L':
-    return 'l';
-  case 'M':
-    return 'm';
-  case 'N':
-    return 'n';
-  case 'O':
-    return 'o';
-  case 'P':
-    return 'p';
-  case 'Q':
-    return 'q';
-  case 'R':
-    return 'r';
-  case 'S':
-    return 's';
-  case 'T':
-    return 't';
-  case 'U':
-    return 'u';
-  case 'V':
-    return 'v';
-  case 'W':
-    return 'w';
-  case 'X':
-    return 'x';
-  case 'Y':
-    return 'y';
-  case 'Z':
-    return 'z';
-  }
-#endif
-
   return in;
 }
 
-
 /*
  * Curl_strcasecompare() is for doing "raw" case insensitive strings. This is
  * meant to be locale independent and only compare strings we know are safe
@@ -171,9 +54,6 @@ static char raw_tolower(char in)
  * https://daniel.haxx.se/blog/2008/10/15/strcasecmp-in-turkish/ for some
  * further explanation to why this function is necessary.
  *
- * The function is capable of comparing a-z case insensitively even for
- * non-ascii.
- *
  * @unittest: 1301
  */
 
index 10dc6988174f420ff60f4c40b16a3714f5e96194..bbd6cd85dd4fb7debd5926526ebf9661f5f80e6b 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -28,8 +28,7 @@
  * Only "raw" case insensitive strings. This is meant to be locale independent
  * and only compare strings we know are safe for this.
  *
- * The function is capable of comparing a-z case insensitively even for
- * non-ascii.
+ * The function is capable of comparing a-z case insensitively.
  */
 
 #define strcasecompare(a,b) Curl_strcasecompare(a,b)
index 48f087d03688d675d881a1f6f9fce0cb558ce327..781e26b69fb792b1e7eeb7390d19fd21a9659f7f 100644 (file)
@@ -266,9 +266,6 @@ curl_easy_strerror(CURLcode error)
   case CURLE_CONV_FAILED:
     return "Conversion failed";
 
-  case CURLE_CONV_REQD:
-    return "Caller must register CURLOPT_CONV_ callback options";
-
   case CURLE_REMOTE_FILE_NOT_FOUND:
     return "Remote file not found";
 
@@ -332,6 +329,7 @@ curl_easy_strerror(CURLcode error)
   case CURLE_OBSOLETE51:
   case CURLE_OBSOLETE57:
   case CURLE_OBSOLETE62:
+  case CURLE_OBSOLETE76:
   case CURL_LAST:
     break;
   }
index f8c68441cac97b0251e1cdaf2de35399ccb5ecd0..d2d8025654344f8b97bc4967330982bc77ca9477 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -463,7 +463,7 @@ static CURLcode tftp_send_first(struct tftp_state_data *state,
     /* As RFC3617 describes the separator slash is not actually part of the
        file name so we skip the always-present first letter of the path
        string. */
-    result = Curl_urldecode(data, &state->data->state.up.path[1], 0,
+    result = Curl_urldecode(&state->data->state.up.path[1], 0,
                             &filename, NULL, REJECT_ZERO);
     if(result)
       return result;
index 22704fa158329b24ce00de52a7d4ead422d12705..8477bdeaab768466bcbf58162a02dd30ca423242 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -73,7 +73,6 @@
 #include "select.h"
 #include "multiif.h"
 #include "connect.h"
-#include "non-ascii.h"
 #include "http2.h"
 #include "mime.h"
 #include "strcase.h"
@@ -165,20 +164,6 @@ CURLcode Curl_fillreadbuffer(struct Curl_easy *data, size_t bytes,
   curl_read_callback readfunc = NULL;
   void *extra_data = NULL;
 
-#ifdef CURL_DOES_CONVERSIONS
-  bool sending_http_headers = FALSE;
-  struct connectdata *conn = data->conn;
-
-  if(conn->handler->protocol&(PROTO_FAMILY_HTTP|CURLPROTO_RTSP)) {
-    const struct HTTP *http = data->req.p.http;
-
-    if(http->sending == HTTPSEND_REQUEST)
-      /* We're sending the HTTP request headers, not the data.
-         Remember that so we don't re-translate them into garbage. */
-      sending_http_headers = TRUE;
-  }
-#endif
-
 #ifndef CURL_DISABLE_HTTP
   if(data->state.trailers_state == TRAILERS_INITIALIZED) {
     struct curl_slist *trailers = NULL;
@@ -347,26 +332,6 @@ CURLcode Curl_fillreadbuffer(struct Curl_easy *data, size_t bytes,
       }
     }
 
-#ifdef CURL_DOES_CONVERSIONS
-    {
-      CURLcode result;
-      size_t length;
-      if(data->state.prefer_ascii)
-        /* translate the protocol and data */
-        length = nread;
-      else
-        /* just translate the protocol portion */
-        length = hexlen;
-      if(length) {
-        result = Curl_convert_to_network(data, data->req.upload_fromhere,
-                                         length);
-        /* Curl_convert_to_network calls failf if unsuccessful */
-        if(result)
-          return result;
-      }
-    }
-#endif /* CURL_DOES_CONVERSIONS */
-
 #ifndef CURL_DISABLE_HTTP
     if(data->state.trailers_state == TRAILERS_SENDING &&
        !trailers_left(data)) {
@@ -391,15 +356,6 @@ CURLcode Curl_fillreadbuffer(struct Curl_easy *data, size_t bytes,
     if(added_crlf)
       nread += strlen(endofline_network); /* for the added end of line */
   }
-#ifdef CURL_DOES_CONVERSIONS
-  else if((data->state.prefer_ascii) && (!sending_http_headers)) {
-    CURLcode result;
-    result = Curl_convert_to_network(data, data->req.upload_fromhere, nread);
-    /* Curl_convert_to_network calls failf if unsuccessful */
-    if(result)
-      return result;
-  }
-#endif /* CURL_DOES_CONVERSIONS */
 
   *nreadp = nread;
 
index c402b1957298ea3e45ead0e0e8b117e9aaa099d6..943f38a27af3932000dda606ca55f2702d662730 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -99,7 +99,6 @@ bool curl_win32_idn_to_ascii(const char *in, char **out);
 #include "easyif.h"
 #include "speedcheck.h"
 #include "warnless.h"
-#include "non-ascii.h"
 #include "getinfo.h"
 #include "urlapi-int.h"
 #include "system_win32.h"
@@ -445,7 +444,6 @@ CURLcode Curl_close(struct Curl_easy **datap)
   Curl_resolver_cleanup(data->state.async.resolver);
 
   Curl_http2_cleanup_dependencies(data);
-  Curl_convert_close(data);
 
   /* No longer a dirty share, if it exists */
   if(data->share) {
@@ -509,11 +507,6 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data)
   set->seek_func = ZERO_NULL;
   set->seek_client = ZERO_NULL;
 
-  /* conversion callbacks for non-ASCII hosts */
-  set->convfromnetwork = ZERO_NULL;
-  set->convtonetwork   = ZERO_NULL;
-  set->convfromutf8    = ZERO_NULL;
-
   set->filesize = -1;        /* we don't know the size */
   set->postfieldsize = -1;   /* unknown size */
   set->maxredirs = -1;       /* allow any amount by default */
@@ -677,7 +670,6 @@ CURLcode Curl_open(struct Curl_easy **curl)
   result = Curl_init_userdefined(data);
   if(!result) {
     Curl_dyn_init(&data->state.headerb, CURL_MAX_HTTP_HEADER);
-    Curl_convert_init(data);
     Curl_initinfo(data);
 
     /* most recent connection is not yet defined */
@@ -2030,7 +2022,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
     uc = curl_url_get(uh, CURLUPART_USER, &data->state.up.user, 0);
     if(!uc) {
       char *decoded;
-      result = Curl_urldecode(NULL, data->state.up.user, 0, &decoded, NULL,
+      result = Curl_urldecode(data->state.up.user, 0, &decoded, NULL,
                               conn->handler->flags&PROTOPT_USERPWDCTRL ?
                               REJECT_ZERO : REJECT_CTRL);
       if(result)
@@ -2049,7 +2041,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
     uc = curl_url_get(uh, CURLUPART_PASSWORD, &data->state.up.password, 0);
     if(!uc) {
       char *decoded;
-      result = Curl_urldecode(NULL, data->state.up.password, 0, &decoded, NULL,
+      result = Curl_urldecode(data->state.up.password, 0, &decoded, NULL,
                               conn->handler->flags&PROTOPT_USERPWDCTRL ?
                               REJECT_ZERO : REJECT_CTRL);
       if(result)
@@ -2545,14 +2537,14 @@ static CURLcode parse_proxy_auth(struct Curl_easy *data,
   CURLcode result = CURLE_OK;
 
   if(proxyuser) {
-    result = Curl_urldecode(data, proxyuser, 0, &conn->http_proxy.user, NULL,
+    result = Curl_urldecode(proxyuser, 0, &conn->http_proxy.user, NULL,
                             REJECT_ZERO);
     if(!result)
       result = Curl_setstropt(&data->state.aptr.proxyuser,
                               conn->http_proxy.user);
   }
   if(!result && proxypasswd) {
-    result = Curl_urldecode(data, proxypasswd, 0, &conn->http_proxy.passwd,
+    result = Curl_urldecode(proxypasswd, 0, &conn->http_proxy.passwd,
                             NULL, REJECT_ZERO);
     if(!result)
       result = Curl_setstropt(&data->state.aptr.proxypasswd,
index 66d6bf487f080e74a93e6621e954e4b1da91fe2e..ebbc37f28269364a991029eda36a09b8c84d3e6a 100644 (file)
@@ -804,8 +804,7 @@ static CURLUcode decode_host(char *hostname, char **outp)
   else {
     /* might be encoded */
     size_t dlen;
-    CURLcode result = Curl_urldecode(NULL, hostname, 0,
-                                     outp, &dlen, REJECT_CTRL);
+    CURLcode result = Curl_urldecode(hostname, 0, outp, &dlen, REJECT_CTRL);
     if(result)
       return CURLUE_BAD_HOSTNAME;
   }
@@ -1420,8 +1419,7 @@ CURLUcode curl_url_get(CURLU *u, CURLUPart what,
       size_t dlen;
       /* this unconditional rejection of control bytes is documented
          API behavior */
-      CURLcode res = Curl_urldecode(NULL, *part, 0, &decoded, &dlen,
-                                    REJECT_CTRL);
+      CURLcode res = Curl_urldecode(*part, 0, &decoded, &dlen, REJECT_CTRL);
       free(*part);
       if(res) {
         *part = NULL;
index b282cedd8a5bcdee5a48b7cac98564f4ecc67278..c5a96f183259798786d6048008084bed7fc43c6d 100644 (file)
@@ -352,10 +352,6 @@ typedef enum {
   GSS_AUTHSUCC
 } curlnegotiate;
 
-#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV)
-#include <iconv.h>
-#endif
-
 /* Struct used for GSSAPI (Kerberos V5) authentication */
 #if defined(USE_KERBEROS5)
 struct kerberos5data {
@@ -1664,13 +1660,6 @@ struct UserDefined {
   void *prereq_userp; /* pre-initial request user data */
 
   void *seek_client;    /* pointer to pass to the seek callback */
-  /* the 3 curl_conv_callback functions below are used on non-ASCII hosts */
-  /* function to convert from the network encoding: */
-  curl_conv_callback convfromnetwork;
-  /* function to convert to the network encoding: */
-  curl_conv_callback convtonetwork;
-  /* function to convert from UTF-8 encoding: */
-  curl_conv_callback convfromutf8;
 #ifndef CURL_DISABLE_HSTS
   curl_hstsread_callback hsts_read;
   void *hsts_read_userp;
@@ -1954,11 +1943,6 @@ struct Curl_easy {
   struct PureInfo info;        /* stats, reports and info data */
   struct curl_tlssessioninfo tsi; /* Information about the TLS session, only
                                      valid after a client has asked for it */
-#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV)
-  iconv_t outbound_cd;         /* for translating to the network encoding */
-  iconv_t inbound_cd;          /* for translating from the network encoding */
-  iconv_t utf8_cd;             /* for translating to UTF8 */
-#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */
 #ifdef USE_HYPER
   struct hyptransfer hyp;
 #endif
index d8aac66bdaff8c08ebf1394b30c16e6da4f926af..d4616095da4cad2e502165e4e5bd9be06523764a 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -40,7 +40,6 @@
 #include "warnless.h"
 #include "strtok.h"
 #include "strcase.h"
-#include "non-ascii.h" /* included for Curl_convert_... prototypes */
 #include "curl_printf.h"
 #include "rand.h"
 
 #define DIGEST_QOP_VALUE_STRING_AUTH      "auth"
 #define DIGEST_QOP_VALUE_STRING_AUTH_INT  "auth-int"
 #define DIGEST_QOP_VALUE_STRING_AUTH_CONF "auth-conf"
-
-/* The CURL_OUTPUT_DIGEST_CONV macro below is for non-ASCII machines.
-   It converts digest text to ASCII so the MD5 will be correct for
-   what ultimately goes over the network.
-*/
-#define CURL_OUTPUT_DIGEST_CONV(a, b)                  \
-  do {                                                 \
-    result = Curl_convert_to_network(a, b, strlen(b)); \
-    if(result) {                                       \
-      free(b);                                         \
-      return result;                                   \
-    }                                                  \
-  } while(0)
-#endif /* !USE_WINDOWS_SSPI */
+#endif
 
 bool Curl_auth_digest_get_pair(const char *str, char *value, char *content,
                                const char **endptr)
@@ -692,7 +678,7 @@ static CURLcode auth_create_digest_http_message(
     if(result)
       return result;
 
-    result = Curl_base64_encode(data, cnoncebuf, strlen(cnoncebuf),
+    result = Curl_base64_encode(cnoncebuf, strlen(cnoncebuf),
                                 &cnonce, &cnonce_sz);
     if(result)
       return result;
@@ -705,7 +691,6 @@ static CURLcode auth_create_digest_http_message(
     if(!hashthis)
       return CURLE_OUT_OF_MEMORY;
 
-    CURL_OUTPUT_DIGEST_CONV(data, hashthis);
     hash(hashbuf, (unsigned char *) hashthis, strlen(hashthis));
     free(hashthis);
     convert_to_ascii(hashbuf, (unsigned char *)userh);
@@ -726,7 +711,6 @@ static CURLcode auth_create_digest_http_message(
   if(!hashthis)
     return CURLE_OUT_OF_MEMORY;
 
-  CURL_OUTPUT_DIGEST_CONV(data, hashthis); /* convert on non-ASCII machines */
   hash(hashbuf, (unsigned char *) hashthis, strlen(hashthis));
   free(hashthis);
   convert_to_ascii(hashbuf, ha1);
@@ -739,7 +723,6 @@ static CURLcode auth_create_digest_http_message(
     if(!tmp)
       return CURLE_OUT_OF_MEMORY;
 
-    CURL_OUTPUT_DIGEST_CONV(data, tmp); /* Convert on non-ASCII machines */
     hash(hashbuf, (unsigned char *) tmp, strlen(tmp));
     free(tmp);
     convert_to_ascii(hashbuf, ha1);
@@ -778,7 +761,6 @@ static CURLcode auth_create_digest_http_message(
   if(!hashthis)
     return CURLE_OUT_OF_MEMORY;
 
-  CURL_OUTPUT_DIGEST_CONV(data, hashthis); /* convert on non-ASCII machines */
   hash(hashbuf, (unsigned char *) hashthis, strlen(hashthis));
   free(hashthis);
   convert_to_ascii(hashbuf, ha2);
@@ -794,7 +776,6 @@ static CURLcode auth_create_digest_http_message(
   if(!hashthis)
     return CURLE_OUT_OF_MEMORY;
 
-  CURL_OUTPUT_DIGEST_CONV(data, hashthis); /* convert on non-ASCII machines */
   hash(hashbuf, (unsigned char *) hashthis, strlen(hashthis));
   free(hashthis);
   convert_to_ascii(hashbuf, request_digest);
index 04f6590acfc9f24018de404f41f75ff170aa829b..cb25c49eb8539a8a85c4115475a682d1d057cb10 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -34,7 +34,6 @@
 #define DEBUG_ME 0
 
 #include "urldata.h"
-#include "non-ascii.h"
 #include "sendf.h"
 #include "curl_ntlm_core.h"
 #include "curl_gethostname.h"
@@ -558,7 +557,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
     if(result)
       return result;
 
-    result = Curl_ntlm_core_mk_nt_hash(data, passwdp, ntbuffer);
+    result = Curl_ntlm_core_mk_nt_hash(passwdp, ntbuffer);
     if(result)
       return result;
 
@@ -633,14 +632,14 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
     /* NTLM version 1 */
 
 #ifdef USE_NTRESPONSES
-    result = Curl_ntlm_core_mk_nt_hash(data, passwdp, ntbuffer);
+    result = Curl_ntlm_core_mk_nt_hash(passwdp, ntbuffer);
     if(result)
       return result;
 
     Curl_ntlm_core_lm_resp(ntbuffer, &ntlm->nonce[0], ntresp);
 #endif
 
-    result = Curl_ntlm_core_mk_lm_hash(data, passwdp, lmbuffer);
+    result = Curl_ntlm_core_mk_lm_hash(passwdp, lmbuffer);
     if(result)
       return result;
 
@@ -823,12 +822,6 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
 
   size += hostlen;
 
-  /* Convert domain, user, and host to ASCII but leave the rest as-is */
-  result = Curl_convert_to_network(data, (char *)&ntlmbuf[domoff],
-                                   size - domoff);
-  if(result)
-    return CURLE_CONV_FAILED;
-
   /* Return the binary blob. */
   result = Curl_bufref_memdup(out, ntlmbuf, size);
 
index 8e8932bd03ecb46f9ec2e986f9e977d7183aa22b..8c1a3edd041befb7bd07394f31b5f58ff8ed0a47 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -204,16 +204,14 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
  *
  * Returns CURLE_OK on success.
  */
-CURLcode Curl_auth_create_spnego_message(struct Curl_easy *data,
-                                         struct negotiatedata *nego,
+CURLcode Curl_auth_create_spnego_message(struct negotiatedata *nego,
                                          char **outptr, size_t *outlen)
 {
   CURLcode result;
   OM_uint32 minor_status;
 
   /* Base64 encode the already generated response */
-  result = Curl_base64_encode(data,
-                              nego->output_token.value,
+  result = Curl_base64_encode(nego->output_token.value,
                               nego->output_token.length,
                               outptr, outlen);
 
index 68bb17da596e876a925c67408bde92bef6297765..d219d8bb243265768345bc8ec8a8d69aebda03f8 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -301,27 +301,19 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
  *
  * Returns CURLE_OK on success.
  */
-CURLcode Curl_auth_create_spnego_message(struct Curl_easy *data,
-                                         struct negotiatedata *nego,
+CURLcode Curl_auth_create_spnego_message(struct negotiatedata *nego,
                                          char **outptr, size_t *outlen)
 {
-  CURLcode result;
-
   /* Base64 encode the already generated response */
-  result = Curl_base64_encode(data,
-                              (const char *) nego->output_token,
-                              nego->output_token_length,
-                              outptr, outlen);
-
-  if(result)
-    return result;
-
-  if(!*outptr || !*outlen) {
+  CURLcode result = Curl_base64_encode((const char *) nego->output_token,
+                                       nego->output_token_length, outptr,
+                                       outlen);
+  if(!result && (!*outptr || !*outlen)) {
     free(*outptr);
-    return CURLE_REMOTE_ACCESS_DENIED;
+    result = CURLE_REMOTE_ACCESS_DENIED;
   }
 
-  return CURLE_OK;
+  return result;
 }
 
 /*
index 47a7c0bc813f0fc3afc4c698e0e53b4a3862a662..6e1237834ac9aca14c34fdbb5257014963203e7f 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 2014 - 2021, Steve Holme, <steve_holme@hotmail.com>.
+ * Copyright (C) 2014 - 2022, Steve Holme, <steve_holme@hotmail.com>.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -219,8 +219,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
 
 /* This is used to generate a base64 encoded SPNEGO (Negotiate) response
    message */
-CURLcode Curl_auth_create_spnego_message(struct Curl_easy *data,
-                                         struct negotiatedata *nego,
+CURLcode Curl_auth_create_spnego_message(struct negotiatedata *nego,
                                          char **outptr, size_t *outlen);
 
 /* This is used to clean up the SPNEGO specifiec data */
index c84ef85fb3cbc986bc6d920368370e1c0e9df42d..e37253df2acb39aa9cecf93e812148023c2221eb 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
 #include <libpsl.h>
 #endif
 
-#if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS)
-#include <iconv.h>
-#endif
-
 #ifdef USE_LIBRTMP
 #include <librtmp/rtmp.h>
 #endif
@@ -106,7 +102,7 @@ static void zstd_version(char *buf, size_t bufsz)
  * zeros in the data.
  */
 
-#define VERSION_PARTS 17 /* number of substrings we can concatenate */
+#define VERSION_PARTS 16 /* number of substrings we can concatenate */
 
 char *curl_version(void)
 {
@@ -135,9 +131,6 @@ char *curl_version(void)
 #ifdef USE_LIBPSL
   char psl_version[40];
 #endif
-#if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS)
-  char iconv_version[40]="iconv";
-#endif
 #ifdef USE_SSH
   char ssh_version[40];
 #endif
@@ -206,15 +199,7 @@ char *curl_version(void)
   msnprintf(psl_version, sizeof(psl_version), "libpsl/%s", psl_get_version());
   src[i++] = psl_version;
 #endif
-#if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS)
-#ifdef _LIBICONV_VERSION
-  msnprintf(iconv_version, sizeof(iconv_version), "iconv/%d.%d",
-            _LIBICONV_VERSION >> 8, _LIBICONV_VERSION & 255);
-#else
-  /* version unknown, let the default stand */
-#endif /* _LIBICONV_VERSION */
-  src[i++] = iconv_version;
-#endif
+
 #ifdef USE_SSH
   Curl_ssh_version(ssh_version, sizeof(ssh_version));
   src[i++] = ssh_version;
@@ -433,9 +418,6 @@ static curl_version_info_data version_info = {
 #if defined(WIN32) && defined(UNICODE) && defined(_UNICODE)
   | CURL_VERSION_UNICODE
 #endif
-#if defined(CURL_DOES_CONVERSIONS)
-  | CURL_VERSION_CONV
-#endif
 #if defined(USE_TLS_SRP)
   | CURL_VERSION_TLSAUTH_SRP
 #endif
@@ -551,15 +533,6 @@ curl_version_info_data *curl_version_info(CURLversion stamp)
   version_info.features |= CURL_VERSION_IDN;
 #endif
 
-#if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS)
-#ifdef _LIBICONV_VERSION
-  version_info.iconv_ver_num = _LIBICONV_VERSION;
-#else
-  /* version unknown */
-  version_info.iconv_ver_num = -1;
-#endif /* _LIBICONV_VERSION */
-#endif
-
 #if defined(USE_SSH)
   Curl_ssh_version(ssh_buffer, sizeof(ssh_buffer));
   version_info.libssh_version = ssh_buffer;
index 581bc1be827da9ce5383415f8a7c00497caafaaf..f800bebc250d8d586d7a924f2507e88c5ad18ef4 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -661,7 +661,7 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data)
 
     /* The length of fingerprint is 32 bytes for SHA256.
      * See libssh2_hostkey_hash documentation. */
-    if(Curl_base64_encode(data, fingerprint, 32, &fingerprint_b64,
+    if(Curl_base64_encode(fingerprint, 32, &fingerprint_b64,
                           &fingerprint_b64_len) != CURLE_OK) {
       state(data, SSH_SESSION_FREE);
       sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION;
index 060531d54347feca30e3b163dbc6fbf83ee537db..806d3dcec7719d939d8b12ee06f0910d068161c5 100644 (file)
@@ -91,7 +91,6 @@
 #endif
 
 #include "warnless.h"
-#include "non-ascii.h" /* for Curl_convert_from_utf8 prototype */
 
 /* The last #include files should be: */
 #include "curl_memory.h"
@@ -1610,40 +1609,11 @@ static void ossl_close_all(struct Curl_easy *data)
 /* ====================================================== */
 
 /*
- * Match subjectAltName against the host name. This requires a conversion
- * in CURL_DOES_CONVERSIONS builds.
+ * Match subjectAltName against the host name.
  */
 static bool subj_alt_hostcheck(struct Curl_easy *data,
                                const char *match_pattern, const char *hostname,
                                const char *dispname)
-#ifdef CURL_DOES_CONVERSIONS
-{
-  bool res = FALSE;
-
-  /* Curl_cert_hostcheck uses host encoding, but we get ASCII from
-     OpenSSl.
-   */
-  char *match_pattern2 = strdup(match_pattern);
-
-  if(match_pattern2) {
-    if(Curl_convert_from_network(data, match_pattern2,
-                                strlen(match_pattern2)) == CURLE_OK) {
-      if(Curl_cert_hostcheck(match_pattern2, hostname)) {
-        res = TRUE;
-        infof(data,
-                " subjectAltName: host \"%s\" matched cert's \"%s\"",
-                dispname, match_pattern2);
-      }
-    }
-    free(match_pattern2);
-  }
-  else {
-    failf(data,
-        "SSL: out of memory when allocating temporary for subjectAltName");
-  }
-  return res;
-}
-#else
 {
 #ifdef CURL_DISABLE_VERBOSE_STRINGS
   (void)dispname;
@@ -1656,8 +1626,6 @@ static bool subj_alt_hostcheck(struct Curl_easy *data,
   }
   return FALSE;
 }
-#endif
-
 
 /* Quote from RFC2818 section 3.1 "Server Identity"
 
@@ -1845,16 +1813,6 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn,
 
     if(peer_CN == nulstr)
        peer_CN = NULL;
-    else {
-      /* convert peer_CN from UTF8 */
-      CURLcode rc = Curl_convert_from_utf8(data, (char *)peer_CN,
-                                           strlen((char *)peer_CN));
-      /* Curl_convert_from_utf8 calls failf if unsuccessful */
-      if(rc) {
-        OPENSSL_free(peer_CN);
-        return rc;
-      }
-    }
 
     if(result)
       /* error already detected, pass through */
index b3bd87303ff14bf10343663c37dbfaf6b0c993be..41714d54b24172e83f3d5c1b9dc15b0cf83e5bc4 100644 (file)
@@ -995,7 +995,7 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data,
     if(encode != CURLE_OK)
       return encode;
 
-    encode = Curl_base64_encode(data, (char *)sha256sumdigest,
+    encode = Curl_base64_encode((char *)sha256sumdigest,
                                 CURL_SHA256_DIGEST_LENGTH, &encoded,
                                 &encodedlen);
     Curl_safefree(sha256sumdigest);
index 0341543a2b4f1c8604a1c497b7e0152fdfc2a41a..64cf5f15d2c25b8a11237ba0d512659bc1c0ece0 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -1119,7 +1119,7 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data,
     return result;
 
   /* Generate PEM certificate. */
-  result = Curl_base64_encode(data, cert.certificate.beg,
+  result = Curl_base64_encode(cert.certificate.beg,
                               cert.certificate.end - cert.certificate.beg,
                               &cp1, &cl1);
   if(result)
diff --git a/scripts/zuul/iconv-env.sh b/scripts/zuul/iconv-env.sh
deleted file mode 100755 (executable)
index 659a6be..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#***************************************************************************
-#                                  _   _ ____  _
-#  Project                     ___| | | |  _ \| |
-#                             / __| | | | |_) | |
-#                            | (__| |_| |  _ <| |___
-#                             \___|\___/|_| \_\_____|
-#
-# Copyright (C) 1998 - 2021, 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 https://curl.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 COPYING file.
-#
-# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
-# KIND, either express or implied.
-#
-###########################################################################
-export CPPFLAGS="-DCURL_DOES_CONVERSIONS -DHAVE_ICONV -DCURL_ICONV_CODESET_OF_HOST='\"ISO8859-1\"'"
index ccc75fc73948e0988890178f18a0bbf0c82268d6..1a6bc810911e15bfab6ab26bf83ed3ad2ecf200c 100755 (executable)
@@ -94,14 +94,6 @@ if [ "$T" = "tidy" ]; then
   make tidy
 fi
 
-if [ "$T" = "iconv" ]; then
-  source scripts/zuul/iconv-env.sh
-  ./configure --enable-debug --enable-werror $C
-  make
-  make examples
-  make test-nonflaky
-fi
-
 if [ "$T" = "cmake" ]; then
   cmake -H. -Bbuild -DCURL_WERROR=ON $C
   cmake --build build
index 153a6265447330e4323c320a155b2d089ae56d79..7761ba50035aa7ae7113affc08baf0d536b72d31 100644 (file)
@@ -59,7 +59,6 @@ CURL_CFILES = \
   tool_cb_see.c \
   tool_cb_wrt.c \
   tool_cfgable.c \
-  tool_convert.c \
   tool_dirhie.c \
   tool_doswin.c \
   tool_easysrc.c \
@@ -102,7 +101,6 @@ CURL_HFILES = \
   tool_cb_see.h \
   tool_cb_wrt.h \
   tool_cfgable.h \
-  tool_convert.h \
   tool_dirhie.h \
   tool_doswin.h \
   tool_easysrc.h \
index 6e82e385260a35f30a3c99568eabd4fed2fc59a6..4682abd23b50a89de8f53747807fd9817b0bb1f3 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -26,7 +26,6 @@
 #include "curlx.h"
 
 #include "tool_cfgable.h"
-#include "tool_convert.h"
 #include "tool_msgs.h"
 #include "tool_cb_dbg.h"
 #include "tool_util.h"
@@ -162,29 +161,6 @@ int tool_debug_cb(CURL *handle, curl_infotype type,
     return 0;
   }
 
-#ifdef CURL_DOES_CONVERSIONS
-  /* Special processing is needed for CURLINFO_HEADER_OUT blocks
-   * if they contain both headers and data (separated by CRLFCRLF).
-   * We dump the header text and then switch type to CURLINFO_DATA_OUT.
-   */
-  if((type == CURLINFO_HEADER_OUT) && (size > 4)) {
-    size_t i;
-    for(i = 0; i < size - 4; i++) {
-      if(memcmp(&data[i], "\r\n\r\n", 4) == 0) {
-        /* dump everything through the CRLFCRLF as a sent header */
-        text = "=> Send header";
-        dump(timebuf, text, output, (unsigned char *)data, i + 4,
-             config->tracetype, type);
-        data += i + 3;
-        size -= i + 4;
-        type = CURLINFO_DATA_OUT;
-        data += 1;
-        break;
-      }
-    }
-  }
-#endif /* CURL_DOES_CONVERSIONS */
-
   switch(type) {
   case CURLINFO_TEXT:
     fprintf(output, "%s== Info: %.*s", timebuf, (int)size, data);
@@ -253,21 +229,9 @@ static void dump(const char *timebuf, const char *text,
         i += (c + 2 - width);
         break;
       }
-#ifdef CURL_DOES_CONVERSIONS
-      /* repeat the 0D0A check above but use the host encoding for CRLF */
-      if((tracetype == TRACE_ASCII) &&
-         (i + c + 1 < size) && (ptr[i + c] == '\r') &&
-         (ptr[i + c + 1] == '\n')) {
-        i += (c + 2 - width);
-        break;
-      }
-      /* convert to host encoding and print this character */
-      fprintf(stream, "%c", convert_char(infotype, ptr[i + c]));
-#else
       (void)infotype;
       fprintf(stream, "%c", ((ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80)) ?
               ptr[i + c] : UNPRINTABLE_CHAR);
-#endif /* CURL_DOES_CONVERSIONS */
       /* check again for 0D0A, to avoid an extra \n if it's at width */
       if((tracetype == TRACE_ASCII) &&
          (i + c + 2 < size) && (ptr[i + c + 1] == 0x0D) &&
diff --git a/src/tool_convert.c b/src/tool_convert.c
deleted file mode 100644 (file)
index 04818e9..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/***************************************************************************
- *                                  _   _ ____  _
- *  Project                     ___| | | |  _ \| |
- *                             / __| | | | |_) | |
- *                            | (__| |_| |  _ <| |___
- *                             \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2021, 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 https://curl.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 COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ***************************************************************************/
-#include "tool_setup.h"
-
-#ifdef CURL_DOES_CONVERSIONS
-
-#ifdef HAVE_ICONV
-#  include <iconv.h>
-#endif
-
-#include "tool_convert.h"
-
-#include "memdebug.h" /* keep this as LAST include */
-
-#ifdef HAVE_ICONV
-
-/* curl tool iconv conversion descriptors */
-static iconv_t inbound_cd  = (iconv_t)-1;
-static iconv_t outbound_cd = (iconv_t)-1;
-
-/* set default codesets for iconv */
-#ifndef CURL_ICONV_CODESET_OF_NETWORK
-#  define CURL_ICONV_CODESET_OF_NETWORK "ISO8859-1"
-#endif
-
-/*
- * convert_to_network() is a curl tool function to convert
- * from the host encoding to ASCII on non-ASCII platforms.
- */
-CURLcode convert_to_network(char *buffer, size_t length)
-{
-  /* translate from the host encoding to the network encoding */
-  char *input_ptr, *output_ptr;
-  size_t res, in_bytes, out_bytes;
-
-  /* open an iconv conversion descriptor if necessary */
-  if(outbound_cd == (iconv_t)-1) {
-    outbound_cd = iconv_open(CURL_ICONV_CODESET_OF_NETWORK,
-                             CURL_ICONV_CODESET_OF_HOST);
-    if(outbound_cd == (iconv_t)-1) {
-      return CURLE_CONV_FAILED;
-    }
-  }
-  /* call iconv */
-  input_ptr = output_ptr = buffer;
-  in_bytes = out_bytes = length;
-  res = iconv(outbound_cd, &input_ptr,  &in_bytes,
-              &output_ptr, &out_bytes);
-  if((res == (size_t)-1) || (in_bytes)) {
-    return CURLE_CONV_FAILED;
-  }
-
-  return CURLE_OK;
-}
-
-/*
- * convert_from_network() is a curl tool function
- * for performing ASCII conversions on non-ASCII platforms.
- */
-CURLcode convert_from_network(char *buffer, size_t length)
-{
-  /* translate from the network encoding to the host encoding */
-  char *input_ptr, *output_ptr;
-  size_t res, in_bytes, out_bytes;
-
-  /* open an iconv conversion descriptor if necessary */
-  if(inbound_cd == (iconv_t)-1) {
-    inbound_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST,
-                            CURL_ICONV_CODESET_OF_NETWORK);
-    if(inbound_cd == (iconv_t)-1) {
-      return CURLE_CONV_FAILED;
-    }
-  }
-  /* call iconv */
-  input_ptr = output_ptr = buffer;
-  in_bytes = out_bytes = length;
-  res = iconv(inbound_cd, &input_ptr,  &in_bytes,
-              &output_ptr, &out_bytes);
-  if((res == (size_t)-1) || (in_bytes)) {
-    return CURLE_CONV_FAILED;
-  }
-
-  return CURLE_OK;
-}
-
-void convert_cleanup(void)
-{
-  /* close iconv conversion descriptors */
-  if(inbound_cd != (iconv_t)-1)
-    (void)iconv_close(inbound_cd);
-  if(outbound_cd != (iconv_t)-1)
-    (void)iconv_close(outbound_cd);
-}
-
-#endif /* HAVE_ICONV */
-
-char convert_char(curl_infotype infotype, char this_char)
-{
-/* determine how this specific character should be displayed */
-  switch(infotype) {
-  case CURLINFO_DATA_IN:
-  case CURLINFO_DATA_OUT:
-  case CURLINFO_SSL_DATA_IN:
-  case CURLINFO_SSL_DATA_OUT:
-    /* data, treat as ASCII */
-    if(this_char < 0x20 || this_char >= 0x7f) {
-      /* non-printable ASCII, use a replacement character */
-      return UNPRINTABLE_CHAR;
-    }
-    /* printable ASCII hex value: convert to host encoding */
-    (void)convert_from_network(&this_char, 1);
-    /* FALLTHROUGH */
-  default:
-    /* treat as host encoding */
-    if(ISPRINT(this_char)
-       &&  (this_char != '\t')
-       &&  (this_char != '\r')
-       &&  (this_char != '\n')) {
-      /* printable characters excluding tabs and line end characters */
-      return this_char;
-    }
-    break;
-  }
-  /* non-printable, use a replacement character  */
-  return UNPRINTABLE_CHAR;
-}
-
-#endif /* CURL_DOES_CONVERSIONS */
diff --git a/src/tool_convert.h b/src/tool_convert.h
deleted file mode 100644 (file)
index 59db764..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef HEADER_CURL_TOOL_CONVERT_H
-#define HEADER_CURL_TOOL_CONVERT_H
-/***************************************************************************
- *                                  _   _ ____  _
- *  Project                     ___| | | |  _ \| |
- *                             / __| | | | |_) | |
- *                            | (__| |_| |  _ <| |___
- *                             \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2020, 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 https://curl.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 COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ***************************************************************************/
-#include "tool_setup.h"
-
-#ifdef CURL_DOES_CONVERSIONS
-
-#ifdef HAVE_ICONV
-
-CURLcode convert_to_network(char *buffer, size_t length);
-CURLcode convert_from_network(char *buffer, size_t length);
-void convert_cleanup(void);
-
-#endif /* HAVE_ICONV */
-
-char convert_char(curl_infotype infotype, char this_char);
-
-#endif /* CURL_DOES_CONVERSIONS */
-
-#if !defined(CURL_DOES_CONVERSIONS) || !defined(HAVE_ICONV)
-#define convert_cleanup() Curl_nop_stmt
-#endif
-
-#endif /* HEADER_CURL_TOOL_CONVERT_H */
index 3661a979e4790b51f80b6762bd4fe242e6e90038..844b18d154e5a593768e68ca3f1f27a477901771 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -28,7 +28,6 @@
 #include "curlx.h"
 
 #include "tool_cfgable.h"
-#include "tool_convert.h"
 #include "tool_msgs.h"
 #include "tool_binmode.h"
 #include "tool_getparam.h"
@@ -268,25 +267,7 @@ static CURLcode tool2curlparts(CURL *curl, struct tool_mime *m,
         break;
 
       case TOOLMIME_DATA:
-#ifdef CURL_DOES_CONVERSIONS
-        /* Our data is always textual: convert it to ASCII. */
-        {
-          size_t size = strlen(m->data);
-          char *cp = malloc(size + 1);
-
-          if(!cp)
-            ret = CURLE_OUT_OF_MEMORY;
-          else {
-            memcpy(cp, m->data, size + 1);
-            ret = convert_to_network(cp, size);
-            if(!ret)
-              ret = curl_mime_data(part, cp, CURL_ZERO_TERMINATED);
-            free(cp);
-          }
-        }
-#else
         ret = curl_mime_data(part, m->data, CURL_ZERO_TERMINATED);
-#endif
         break;
 
       case TOOLMIME_FILE:
index 9bf1c594cf0257d2e2417ec7d6627ca7ca80681c..56964394b76c7b1e9f4269fad1221628ddee984d 100644 (file)
@@ -30,7 +30,6 @@
 #include "tool_binmode.h"
 #include "tool_cfgable.h"
 #include "tool_cb_prg.h"
-#include "tool_convert.h"
 #include "tool_filetime.h"
 #include "tool_formparse.h"
 #include "tool_getparam.h"
@@ -1521,16 +1520,6 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
       if(subletter == 'f')
         config->jsoned = TRUE;
 
-#ifdef CURL_DOES_CONVERSIONS
-      if(subletter != 'b') {
-        /* NOT forced binary, convert to ASCII */
-        if(convert_to_network(postdata, strlen(postdata))) {
-          Curl_safefree(postdata);
-          return PARAM_NO_MEM;
-        }
-      }
-#endif
-
       if(config->postfields) {
         /* we already have a string, we append this one with a separating
            &-letter */
index 7db2e93590d1f333d1a005e1c38897a6eaf51238..d6d8e9911a2f861755f529a488e2a3cb504c66bc 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -41,7 +41,6 @@
 #include "curlx.h"
 
 #include "tool_cfgable.h"
-#include "tool_convert.h"
 #include "tool_doswin.h"
 #include "tool_msgs.h"
 #include "tool_operate.h"
@@ -211,7 +210,6 @@ static void main_free(struct GlobalConfig *config)
   /* Cleanup the easy handle */
   /* Main cleanup */
   curl_global_cleanup();
-  convert_cleanup();
 #ifdef USE_NSS
   if(PR_Initialized()) {
     /* prevent valgrind from reporting still reachable mem from NSPR arenas */
index 0a209bf6598b7f268709957aeb16dfa58fbd4e59..afe54d5f328ed5fc0f1f7071f604766d256cf132 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -28,7 +28,6 @@
 #include "curlx.h"
 
 #include "tool_cfgable.h"
-#include "tool_convert.h"
 #include "tool_doswin.h"
 #include "tool_operhlp.h"
 
index 4c86eb321dd8c26e0ffc8c4790884a33e334cc35..0b5975abc13d83b313d975d979d0afb3e5ddc687 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -30,7 +30,6 @@
 #include "tool_cfgable.h"
 #include "tool_easysrc.h"
 #include "tool_setopt.h"
-#include "tool_convert.h"
 #include "tool_msgs.h"
 
 #include "memdebug.h" /* keep this as LAST include */
@@ -474,25 +473,7 @@ static CURLcode libcurl_generate_mime_part(CURL *curl,
     break;
 
   case TOOLMIME_DATA:
-#ifdef CURL_DOES_CONVERSIONS
-    /* Data will be set in ASCII, thus issue a comment with clear text. */
-    escaped = c_escape(part->data, ZERO_TERMINATED);
-    NULL_CHECK(escaped);
-    CODE1("/* \"%s\" */", escaped);
-
-    /* Our data is always textual: convert it to ASCII. */
-    {
-      size_t size = strlen(part->data);
-      char *cp = malloc(size + 1);
-
-      NULL_CHECK(cp);
-      memcpy(cp, part->data, size + 1);
-      ret = convert_to_network(cp, size);
-      data = cp;
-    }
-#else
     data = part->data;
-#endif
     if(!ret) {
       Curl_safefree(escaped);
       escaped = c_escape(data, ZERO_TERMINATED);
@@ -566,11 +547,6 @@ static CURLcode libcurl_generate_mime_part(CURL *curl,
   }
 
 nomem:
-#ifdef CURL_DOES_CONVERSIONS
-  if(data)
-    free((char *) data);
-#endif
-
   Curl_safefree(escaped);
   return ret;
 }
index aa7d4b609be49cafc7f444b9153c0aef26792be8..5157e36b7f93538b042f2137a6dfab6d1e239f5a 100644 (file)
@@ -108,7 +108,7 @@ e72: TFTP: Unknown transfer ID
 e73: Remote file already exists
 e74: TFTP: No such user
 e75: Conversion failed
-e76: Caller must register CURLOPT_CONV_ callback options
+e76: Unknown error
 e77: Problem with the SSL CA cert (path? access rights?)
 e78: Remote file not found
 e79: Error in the SSH layer
index c3a4986c2623f0b57043afd655662d16f3b278a3..af1ee87c6dc439bffdc88841b5b311c073202fbc 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -79,11 +79,6 @@ int test(char *URL)
   /* Now specify we want to POST data */
   test_setopt(curl, CURLOPT_POST, 1L);
 
-#ifdef CURL_DOES_CONVERSIONS
-  /* Convert the POST data to ASCII */
-  test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
-#endif
-
   /* Set the expected POST size */
   test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)pooh.sizeleft);
 
index b5391fb8eaa5580fd6780615cfb55ca07604f8ae..7e00a5383667f277b5d702f8cf52a34d8de41ec5 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -75,11 +75,6 @@ int test(char *URL)
   /* Now specify we want to POST data */
   test_setopt(curl, CURLOPT_POST, 1L);
 
-#ifdef CURL_DOES_CONVERSIONS
-  /* Convert the POST data to ASCII */
-  test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
-#endif
-
   /* Set the expected POST size */
   test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)pooh.sizeleft);
 
index b3dd0ab843b9c90f6f62b8f0ed04030c61957605..2b8da207d92b1f29c72860969b178c5154da05b4 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -93,11 +93,6 @@ int test(char *URL)
   /* Now specify we want to POST data */
   test_setopt(curl, CURLOPT_POST, 1L);
 
-#ifdef CURL_DOES_CONVERSIONS
-  /* Convert the POST data to ASCII */
-  test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
-#endif
-
   /* we want to use our own read function */
   test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
 
index 5b571122335c714e98dbe597ae56e0c60e3e41c4..a9c17e1f978adfdeb8a553db6b8193a2ac61dc87 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
 #include "memdebug.h"
 
 static char teststring[] =
-#ifdef CURL_DOES_CONVERSIONS
-  /* ASCII representation with escape sequences for non-ASCII platforms */
-{ '\x54', '\x68', '\x69', '\x73', '\x00', '\x20', '\x69', '\x73', '\x20',
-  '\x74', '\x65', '\x73', '\x74', '\x20', '\x62', '\x69', '\x6e', '\x61',
-  '\x72', '\x79', '\x20', '\x64', '\x61', '\x74', '\x61', '\x20', '\x77',
-  '\x69', '\x74', '\x68', '\x20', '\x61', '\x6e', '\x20', '\x65', '\x6d',
-  '\x62', '\x65', '\x64', '\x64', '\x65', '\x64', '\x20', '\x4e', '\x55',
-  '\x4c'};
-#else
 {   'T', 'h', 'i', 's', '\0', ' ', 'i', 's', ' ', 't', 'e', 's', 't', ' ',
     'b', 'i', 'n', 'a', 'r', 'y', ' ', 'd', 'a', 't', 'a', ' ',
     'w', 'i', 't', 'h', ' ', 'a', 'n', ' ',
     'e', 'm', 'b', 'e', 'd', 'd', 'e', 'd', ' ', 'N', 'U', 'L'};
-#endif
-
 
 int test(char *URL)
 {
index 57a9d84dc959bf117319f136afeb609e42a1be1c..6f0834b6f38532809d4206a38389417f28792954 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
 
 #include "memdebug.h"
 
-#ifdef CURL_DOES_CONVERSIONS
-   /* ASCII representation with escape sequences for non-ASCII platforms */
-#  define UPLOADTHIS "\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
-#  define UPLOADTHIS "this is the blurb we want to upload\n"
-#endif
+#define UPLOADTHIS "this is the blurb we want to upload\n"
 
 #ifndef LIB548
 static size_t readcallback(char  *ptr,
index 7e56ae7eb0b73e7d0cbe094cc435a46fb4a52fd4..21db982fd6d501fe2e27cba99a82df87bca5034d 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -190,11 +190,6 @@ int test(char *URL)
   /* Post */
   test_setopt(curl, CURLOPT_POST, 1L);
 
-#ifdef CURL_DOES_CONVERSIONS
-  /* Convert the POST data to ASCII */
-  test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
-#endif
-
   /* Setup read callback */
   test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof(databuf));
   test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
index 31b2bdba69a882c1ccf58880c150037293767542..fc569a3069097c0f95e06f7bce8739b68efbebf2 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -92,10 +92,6 @@ int test(char *URL)
   test_setopt(curl, CURLOPT_URL, URL);
   test_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
   test_setopt(curl, CURLOPT_POST, 1L);
-#ifdef CURL_DOES_CONVERSIONS
-  /* Convert the POST data to ASCII */
-  test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
-#endif
   test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)POSTLEN);
   test_setopt(curl, CURLOPT_VERBOSE, 1L);
   test_setopt(curl, CURLOPT_HEADER, 1L);
index aebbb1b555ffb133892a1a2da175dafb54afee05..696ec258f1a24e4ad189d2c1ed8d60a456eebd98 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
 #include "memdebug.h"
 
 static char data[]=
-#ifdef CURL_DOES_CONVERSIONS
-  /* ASCII representation with escape sequences for non-ASCII platforms */
-  "\x74\x68\x69\x73\x20\x69\x73\x20\x77\x68\x61\x74\x20\x77\x65\x20\x70"
-  "\x6f\x73\x74\x20\x74\x6f\x20\x74\x68\x65\x20\x73\x69\x6c\x6c\x79\x20"
-  "\x77\x65\x62\x20\x73\x65\x72\x76\x65\x72\x0a";
-#else
   "this is what we post to the silly web server\n";
-#endif
 
 struct WriteThis {
   char *readptr;
@@ -123,14 +116,7 @@ static int once(char *URL, bool oldstyle)
   formrc = curl_formadd(&formpost,
                         &lastptr,
                         CURLFORM_COPYNAME, "filename",
-#ifdef CURL_DOES_CONVERSIONS
-                        /* ASCII representation with escape
-                           sequences for non-ASCII platforms */
-                        CURLFORM_COPYCONTENTS,
-                           "\x70\x6f\x73\x74\x69\x74\x32\x2e\x63",
-#else
                         CURLFORM_COPYCONTENTS, "postit2.c",
-#endif
                         CURLFORM_END);
 
   if(formrc)
@@ -140,13 +126,7 @@ static int once(char *URL, bool oldstyle)
   formrc = curl_formadd(&formpost,
                         &lastptr,
                         CURLFORM_COPYNAME, "submit",
-#ifdef CURL_DOES_CONVERSIONS
-                        /* ASCII representation with escape
-                           sequences for non-ASCII platforms */
-                        CURLFORM_COPYCONTENTS, "\x73\x65\x6e\x64",
-#else
                         CURLFORM_COPYCONTENTS, "send",
-#endif
                         CURLFORM_CONTENTTYPE, "text/plain",
                         CURLFORM_END);
 
index 85e1d62a4c5e7af2ae9452b899620cb727276db5..fff466c988eed9a9365dd9db02588d9e9c3e9ee0 100644 (file)
 #define TEST_HANG_TIMEOUT 60 * 1000
 
 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(char  *ptr,
                            size_t size,
index 82a986b452a91d86166fcce7603a7f374c598056..81503d5109880ede3e8cd30dc511bc610c61deaa 100644 (file)
@@ -61,15 +61,8 @@ int test(char *URL)
   if(!res) {
     /* we are connected, now get a HTTP document the raw way */
     const char *request =
-#ifdef CURL_DOES_CONVERSIONS
-      /* ASCII representation with escape sequences for non-ASCII platforms */
-      "\x47\x45\x54\x20\x2f\x35\x35\x36\x20\x48\x54\x54\x50\x2f\x31\x2e"
-      "\x31\x0d\x0a\x48\x6f\x73\x74\x3a\x20\x6e\x69\x6e\x6a\x61\x0d\x0a"
-      "\x0d\x0a";
-#else
       "GET /556 HTTP/1.1\r\n"
       "Host: ninja\r\n\r\n";
-#endif
     size_t iolen = 0;
 
     res = curl_easy_send(curl, request, strlen(request), &iolen);
index ec3bc01e9eebff143d05e5c2c84997321c71cce0..4a49520fff8102ab771e57ff8c4c97b13b162927 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -71,11 +71,6 @@ int test(char *URL)
   /* Now specify we want to POST data */
   test_setopt(curl, CURLOPT_POST, 1L);
 
-#ifdef CURL_DOES_CONVERSIONS
-  /* Convert the POST data to ASCII */
-  test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
-#endif
-
   /* Set the expected POST size */
   test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)data_size);
   test_setopt(curl, CURLOPT_POSTFIELDS, data);
index 46894fa9a52a8b25bbeeb8a7abf96bcff713b31f..91ef3a859df971ca69645869836056b0b71996d5 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -117,11 +117,6 @@ int test(char *URL)
   /* Now specify we want to POST data */
   test_setopt(curl, CURLOPT_POST, 1L);
 
-#ifdef CURL_DOES_CONVERSIONS
-  /* Convert the POST data to ASCII */
-  test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
-#endif
-
   /* we want to use our own read function */
   test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
 
index 3c75108e29a51cc61ae4f2f3dbfe90ffd3b25330..ed8c2eb57f9c5e1002e4006b93bb1464b374036e 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
 #include "memdebug.h"
 
 static char data[]=
-#ifdef CURL_DOES_CONVERSIONS
-  /* ASCII representation with escape sequences for non-ASCII platforms */
-  "\x64\x75\x6d\x6d\x79\x0a";
-#else
   "dummy\n";
-#endif
 
 struct WriteThis {
   char *readptr;
@@ -178,15 +173,8 @@ static int once(char *URL, bool oldstyle)
   /* Fill in the filename field */
   res = curl_mime_name(part, "filename");
   if(!res)
-    res = curl_mime_data(part,
-#ifdef CURL_DOES_CONVERSIONS
-                         /* ASCII representation with escape
-                            sequences for non-ASCII platforms */
-                         "\x70\x6f\x73\x74\x69\x74\x32\x2e\x63",
-#else
-                          "postit2.c",
-#endif
-                          CURL_ZERO_TERMINATED);
+    res = curl_mime_data(part, "postit2.c",
+                         CURL_ZERO_TERMINATED);
 
   if(res)
     printf("curl_mime_xxx(3) = %s\n", curl_easy_strerror(res));
@@ -202,15 +190,8 @@ static int once(char *URL, bool oldstyle)
   }
   res = curl_mime_name(part, "submit");
   if(!res)
-    res = curl_mime_data(part,
-#ifdef CURL_DOES_CONVERSIONS
-                         /* ASCII representation with escape
-                            sequences for non-ASCII platforms */
-                         "\x73\x65\x6e\x64",
-#else
-                          "send",
-#endif
-                          CURL_ZERO_TERMINATED);
+    res = curl_mime_data(part, "send",
+                         CURL_ZERO_TERMINATED);
 
   if(res)
     printf("curl_mime_xxx(4) = %s\n", curl_easy_strerror(res));
index f0e6b81cd3ca25d41b82acd798d6b900d0d10c59..e2de8d1940d5a8dc2f89ff52609d7c93717181e6 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
 #include "memdebug.h"
 
 static char data[] =
-#ifdef CURL_DOES_CONVERSIONS
-  /* ASCII representation with escape sequences for non-ASCII platforms */
-  "\x74\x68\x69\x73\x20\x69\x73\x20\x77\x68\x61\x74\x20\x77\x65\x20\x70"
-  "\x6f\x73\x74\x20\x74\x6f\x20\x74\x68\x65\x20\x73\x69\x6c\x6c\x79\x20"
-  "\x77\x65\x62\x20\x73\x65\x72\x76\x65\x72";
-#else
   "this is what we post to the silly web server";
-#endif
 
 static const char name[] = "fieldname";
 
index e7e957c46a9ba9c4faa6c7b0471bbf0ec59a6c61..0218d8ff3a4482cb00ac8095cc737eb3bcb007c4 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
 #include "memdebug.h"
 
 static char data[]=
-#ifdef CURL_DOES_CONVERSIONS
-  /* ASCII representation with escape sequences for non-ASCII platforms */
-  "\x64\x75\x6d\x6d\x79\x0a";
-#else
   "dummy\n";
-#endif
 
 struct WriteThis {
   char *readptr;
index d30b9534e5fb6960f47499893dc73ccb5136854c..e1f2d615758c9e02903745481023d4ce288056d0 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
 #include "memdebug.h"
 
 static char data[]=
-#ifdef CURL_DOES_CONVERSIONS
-  /* ASCII representation with escape sequences for non-ASCII platforms */
-  "\x64\x75\x6d\x6d\x79";
-#else
   "dummy";
-#endif
 
 struct WriteThis {
   char *readptr;
index bd8ae3b3a92a500b0b97c3f085bffc20ad424ede..80e04490b384936b039c1a2b39f6ffa2a7c6f8e0 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
 
 #include "memdebug.h"
 
-static char data[]=
-#ifdef CURL_DOES_CONVERSIONS
-  /* ASCII representation with escape sequences for non-ASCII platforms */
-  "\x64\x75\x6d\x6d\x79";
-#else
-  "dummy";
-#endif
+static char data[]= "dummy";
 
 struct WriteThis {
   char *readptr;
index 81e705c1525d2e91d11c27cc4f2f0bf9ec99f6b8..cfa8be28571c87e625cc877bfd4ef21e4b875134 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -364,66 +364,8 @@ void clear_advisor_read_lock(const char *filename)
    its behavior is altered by the current locale. */
 static char raw_toupper(char in)
 {
-#if !defined(CURL_DOES_CONVERSIONS)
   if(in >= 'a' && in <= 'z')
     return (char)('A' + in - 'a');
-#else
-  switch(in) {
-  case 'a':
-    return 'A';
-  case 'b':
-    return 'B';
-  case 'c':
-    return 'C';
-  case 'd':
-    return 'D';
-  case 'e':
-    return 'E';
-  case 'f':
-    return 'F';
-  case 'g':
-    return 'G';
-  case 'h':
-    return 'H';
-  case 'i':
-    return 'I';
-  case 'j':
-    return 'J';
-  case 'k':
-    return 'K';
-  case 'l':
-    return 'L';
-  case 'm':
-    return 'M';
-  case 'n':
-    return 'N';
-  case 'o':
-    return 'O';
-  case 'p':
-    return 'P';
-  case 'q':
-    return 'Q';
-  case 'r':
-    return 'R';
-  case 's':
-    return 'S';
-  case 't':
-    return 'T';
-  case 'u':
-    return 'U';
-  case 'v':
-    return 'V';
-  case 'w':
-    return 'W';
-  case 'x':
-    return 'X';
-  case 'y':
-    return 'Y';
-  case 'z':
-    return 'Z';
-  }
-#endif
-
   return in;
 }
 
index af337cedffb814dbe0f51f69795aadf90aaad236..0192df7eb1f4e61f448f28b3155bf04bbd2512c0 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -55,50 +55,50 @@ size_t size = 0;
 unsigned char anychar = 'x';
 CURLcode rc;
 
-rc = Curl_base64_encode(data, "i", 1, &output, &size);
+rc = Curl_base64_encode("i", 1, &output, &size);
 fail_unless(rc == CURLE_OK, "return code should be CURLE_OK");
 fail_unless(size == 4, "size should be 4");
 verify_memory(output, "aQ==", 4);
 Curl_safefree(output);
 
-rc = Curl_base64_encode(data, "ii", 2, &output, &size);
+rc = Curl_base64_encode("ii", 2, &output, &size);
 fail_unless(rc == CURLE_OK, "return code should be CURLE_OK");
 fail_unless(size == 4, "size should be 4");
 verify_memory(output, "aWk=", 4);
 Curl_safefree(output);
 
-rc = Curl_base64_encode(data, "iii", 3, &output, &size);
+rc = Curl_base64_encode("iii", 3, &output, &size);
 fail_unless(rc == CURLE_OK, "return code should be CURLE_OK");
 fail_unless(size == 4, "size should be 4");
 verify_memory(output, "aWlp", 4);
 Curl_safefree(output);
 
-rc = Curl_base64_encode(data, "iiii", 4, &output, &size);
+rc = Curl_base64_encode("iiii", 4, &output, &size);
 fail_unless(rc == CURLE_OK, "return code should be CURLE_OK");
 fail_unless(size == 8, "size should be 8");
 verify_memory(output, "aWlpaQ==", 8);
 Curl_safefree(output);
 
-rc = Curl_base64_encode(data, "\xff\x01\xfe\x02", 4, &output, &size);
+rc = Curl_base64_encode("\xff\x01\xfe\x02", 4, &output, &size);
 fail_unless(rc == CURLE_OK, "return code should be CURLE_OK");
 fail_unless(size == 8, "size should be 8");
 verify_memory(output, "/wH+Ag==", 8);
 Curl_safefree(output);
 
-rc = Curl_base64url_encode(data, "\xff\x01\xfe\x02", 4, &output, &size);
+rc = Curl_base64url_encode("\xff\x01\xfe\x02", 4, &output, &size);
 fail_unless(rc == CURLE_OK, "return code should be CURLE_OK");
 fail_unless(size == 8, "size should be 8");
 verify_memory(output, "_wH-Ag==", 8);
 Curl_safefree(output);
 
-rc = Curl_base64url_encode(data, "iiii", 4, &output, &size);
+rc = Curl_base64url_encode("iiii", 4, &output, &size);
 fail_unless(rc == CURLE_OK, "return code should be CURLE_OK");
 fail_unless(size == 8, "size should be 8");
 verify_memory(output, "aWlpaQ==", 8);
 Curl_safefree(output);
 
 /* 0 length makes it do strlen() */
-rc = Curl_base64_encode(data, "iiii", 0, &output, &size);
+rc = Curl_base64_encode("iiii", 0, &output, &size);
 fail_unless(rc == CURLE_OK, "return code should be CURLE_OK");
 fail_unless(size == 8, "size should be 8");
 verify_memory(output, "aWlpaQ==", 8);
index 506a120b2b004cd92b78799c417c1aa1f405b239..0321131793f68f66a434d6a61345ff739cd000ab 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -51,20 +51,20 @@ UNITTEST_START
                           defined(USE_WIN32_CRYPTO))
   unsigned char output[21];
   unsigned char *testp = output;
-  Curl_ntlm_core_mk_nt_hash(easy, "1", output);
+  Curl_ntlm_core_mk_nt_hash("1", output);
 
   verify_memory(testp,
               "\x69\x94\x3c\x5e\x63\xb4\xd2\xc1\x04\xdb"
               "\xbc\xc1\x51\x38\xb7\x2b\x00\x00\x00\x00\x00", 21);
 
-  Curl_ntlm_core_mk_nt_hash(easy, "hello-you-fool", output);
+  Curl_ntlm_core_mk_nt_hash("hello-you-fool", output);
 
   verify_memory(testp,
               "\x39\xaf\x87\xa6\x75\x0a\x7a\x00\xba\xa0"
               "\xd3\x4f\x04\x9e\xc1\xd0\x00\x00\x00\x00\x00", 21);
 
 /* !checksrc! disable LONGLINE 2 */
-  Curl_ntlm_core_mk_nt_hash(easy, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", output);
+  Curl_ntlm_core_mk_nt_hash("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", output);
 
   verify_memory(testp,
                 "\x36\x9d\xae\x06\x84\x7e\xe1\xc1\x4a\x94\x39\xea\x6f\x44\x8c\x65\x00\x00\x00\x00\x00", 21);
index b7df3ba191fd211429ee0cc80022682f10ad38c0..2de71af7e3e764869b05267f027cab23a3bda284 100644 (file)
         CPPFLAGS: -isystem /usr/include/nss
         NOTESTS: 1
 
-- job:
-    name: curl-iconv-with-openssl
-    parent: curl-base
-    vars:
-      curl_env:
-        CC: gcc-8
-        CXX: g++-8
-        T: iconv
-        C: >-
-          --with-openssl
-
 - job:
     name: curl-cmake-boringssl-quiche
     parent: curl-base
       - curl-debug-clang-disable-alt-svc-with-openssl
       - curl-debug-clang-with-gnutls
       - curl-debug-clang-with-nss
-      - curl-iconv-with-openssl
       - curl-cmake-boringssl-quiche
       - curl-cmake-ngtcp2
       - curl-torture