Loading CHANGES +4 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,10 @@ Changelog Daniel (11 November 2004) - Dan Fandrich added --disable-verbose to the configure script to allow builds without verbose strings in the code, to save some 12KB space. Makes sense only for systems with very little memory resources. - Jeff Phillips found out that a date string with a year beyond 2038 could crash the new date parser on systems with 32bit time_t. We now check for this case and deal with it. Loading configure.ac +32 −10 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ AC_SUBST(PKGADD_NAME) AC_SUBST(PKGADD_VENDOR) dnl dnl initialize all the info variables to 'no' dnl initialize all the info variables curl_ssl_msg="no (--with-ssl)" curl_zlib_msg="no (--with-zlib)" curl_krb4_msg="no (--with-krb4*)" Loading @@ -65,6 +65,7 @@ dnl initialize all the info variables to 'no' curl_ipv6_msg="no (--enable-ipv6)" curl_idn_msg="no (--with-libidn)" curl_manual_msg="no (--enable-manual)" curl_verbose_msg="enabled (--disable-verbose)" dnl dnl Detect the canonical host and target build environment Loading Loading @@ -1426,6 +1427,26 @@ int main(void) AC_MSG_RESULT(no) ) dnl ************************************************************ dnl disable verbose text strings dnl AC_MSG_CHECKING([whether to enable verbose strings]) AC_ARG_ENABLE(verbose, AC_HELP_STRING([--enable-verbose],[Enable verbose strings]) AC_HELP_STRING([--disable-verbose],[Disable verbose strings]), [ case "$enableval" in no) AC_MSG_RESULT(no) AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings]) AC_SUBST(CURL_DISABLE_VERBOSE_STRINGS) curl_verbose_msg="no" ;; *) AC_MSG_RESULT(yes) ;; esac ], AC_MSG_RESULT(yes) ) dnl ************************************************************ dnl lame option to switch on debug options dnl Loading Loading @@ -1497,4 +1518,5 @@ AC_MSG_NOTICE([Configured to build curl/libcurl: IDN support: ${curl_idn_msg} Build libcurl: Shared=${enable_shared}, Static=${enable_static} Built-in manual: ${curl_manual_msg} Verbose errors: ${curl_verbose_msg} ]) lib/krb4.c +3 −3 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ krb4_auth(void *app_data, struct connectdata *conn) if(ret == KDC_PR_UNKNOWN) ret = mk_auth(d, &adat, "rcmd", host, checksum); if(ret) { Curl_infof(data, "%s\n", krb_get_err_text(ret)); infof(data, "%s\n", krb_get_err_text(ret)); return AUTH_CONTINUE; } Loading @@ -232,7 +232,7 @@ krb4_auth(void *app_data, struct connectdata *conn) if (krb_get_our_ip_for_realm(krb_realmofhost(host), &natAddr) != KSUCCESS && krb_get_our_ip_for_realm(NULL, &natAddr) != KSUCCESS) Curl_infof(data, "Can't get address for realm %s\n", infof(data, "Can't get address for realm %s\n", krb_realmofhost(host)); else { if (natAddr.s_addr != localaddr->sin_addr.s_addr) { Loading @@ -242,7 +242,7 @@ krb4_auth(void *app_data, struct connectdata *conn) #else char *ip = (char *)inet_ntoa(natAddr); #endif Curl_infof(data, "Using NAT IP address (%s) for kerberos 4\n", ip); infof(data, "Using NAT IP address (%s) for kerberos 4\n", ip); localaddr->sin_addr = natAddr; } } Loading lib/sendf.h +10 −0 Original line number Diff line number Diff line Loading @@ -28,7 +28,17 @@ CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *, void Curl_infof(struct SessionHandle *, const char *fmt, ...); void Curl_failf(struct SessionHandle *, const char *fmt, ...); #if defined(CURL_DISABLE_VERBOSE_STRINGS) #if defined(__GNUC__) /* Variable argument macros is a C99 feature long supported by gcc */ #define infof(...) /*ignore*/ #else /* Cast the args to void to make them a noop, side effects notwithstanding */ #define infof (void) #endif #else #define infof Curl_infof #endif #define failf Curl_failf #define CLIENTWRITE_BODY 1 Loading lib/strerror.c +35 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ extern char *strerror_r(int errnum, char *buf, size_t buflen); const char * curl_easy_strerror(CURLcode error) { #ifndef CURL_DISABLE_VERBOSE_STRINGS switch (error) { case CURLE_OK: return "no error"; Loading Loading @@ -252,11 +253,18 @@ curl_easy_strerror(CURLcode error) * is why it is here, and not at the start of the switch. */ return "unknown error"; #else if (error == CURLE_OK) return "no error"; else return "error"; #endif } const char * curl_multi_strerror(CURLMcode error) { #ifndef CURL_DISABLE_VERBOSE_STRINGS switch (error) { case CURLM_CALL_MULTI_PERFORM: return "please call curl_multi_perform() soon"; Loading @@ -281,11 +289,18 @@ curl_multi_strerror(CURLMcode error) } return "unknown error"; #else if (error == CURLM_OK) return "no error"; else return "error"; #endif } const char * curl_share_strerror(CURLSHcode error) { #ifndef CURL_DISABLE_VERBOSE_STRINGS switch (error) { case CURLSHE_OK: return "no error"; Loading @@ -307,6 +322,12 @@ curl_share_strerror(CURLSHcode error) } return "CURLSH unknown"; #else if (error == CURLSHE_OK) return "no error"; else return "error"; #endif } #if defined(WIN32) && !defined(__CYGWIN__) Loading @@ -318,6 +339,7 @@ get_winsock_error (int err, char *buf, size_t len) { char *p; #ifndef CURL_DISABLE_VERBOSE_STRINGS switch (err) { case WSAEINTR: p = "Call interrupted."; Loading Loading @@ -485,6 +507,12 @@ get_winsock_error (int err, char *buf, size_t len) default: return NULL; } #else if (error == CURLE_OK) return NULL; else p = "error"; #endif strncpy (buf, p, len); buf [len-1] = '\0'; return buf; Loading Loading @@ -594,6 +622,7 @@ const char *Curl_idn_strerror (struct connectdata *conn, int err) buf = conn->syserr_buf; max = sizeof(conn->syserr_buf)-1; #ifndef CURL_DISABLE_VERBOSE_STRINGS switch ((Idna_rc)err) { case IDNA_SUCCESS: str = "No error"; Loading Loading @@ -636,6 +665,12 @@ const char *Curl_idn_strerror (struct connectdata *conn, int err) str = NULL; break; } #else if ((Idna_rc)err == IDNA_SUCCESS) str = "No error"; else str = "error"; #endif if (str) strncpy(buf, str, max); buf[max] = '\0'; Loading Loading
CHANGES +4 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,10 @@ Changelog Daniel (11 November 2004) - Dan Fandrich added --disable-verbose to the configure script to allow builds without verbose strings in the code, to save some 12KB space. Makes sense only for systems with very little memory resources. - Jeff Phillips found out that a date string with a year beyond 2038 could crash the new date parser on systems with 32bit time_t. We now check for this case and deal with it. Loading
configure.ac +32 −10 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ AC_SUBST(PKGADD_NAME) AC_SUBST(PKGADD_VENDOR) dnl dnl initialize all the info variables to 'no' dnl initialize all the info variables curl_ssl_msg="no (--with-ssl)" curl_zlib_msg="no (--with-zlib)" curl_krb4_msg="no (--with-krb4*)" Loading @@ -65,6 +65,7 @@ dnl initialize all the info variables to 'no' curl_ipv6_msg="no (--enable-ipv6)" curl_idn_msg="no (--with-libidn)" curl_manual_msg="no (--enable-manual)" curl_verbose_msg="enabled (--disable-verbose)" dnl dnl Detect the canonical host and target build environment Loading Loading @@ -1426,6 +1427,26 @@ int main(void) AC_MSG_RESULT(no) ) dnl ************************************************************ dnl disable verbose text strings dnl AC_MSG_CHECKING([whether to enable verbose strings]) AC_ARG_ENABLE(verbose, AC_HELP_STRING([--enable-verbose],[Enable verbose strings]) AC_HELP_STRING([--disable-verbose],[Disable verbose strings]), [ case "$enableval" in no) AC_MSG_RESULT(no) AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings]) AC_SUBST(CURL_DISABLE_VERBOSE_STRINGS) curl_verbose_msg="no" ;; *) AC_MSG_RESULT(yes) ;; esac ], AC_MSG_RESULT(yes) ) dnl ************************************************************ dnl lame option to switch on debug options dnl Loading Loading @@ -1497,4 +1518,5 @@ AC_MSG_NOTICE([Configured to build curl/libcurl: IDN support: ${curl_idn_msg} Build libcurl: Shared=${enable_shared}, Static=${enable_static} Built-in manual: ${curl_manual_msg} Verbose errors: ${curl_verbose_msg} ])
lib/krb4.c +3 −3 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ krb4_auth(void *app_data, struct connectdata *conn) if(ret == KDC_PR_UNKNOWN) ret = mk_auth(d, &adat, "rcmd", host, checksum); if(ret) { Curl_infof(data, "%s\n", krb_get_err_text(ret)); infof(data, "%s\n", krb_get_err_text(ret)); return AUTH_CONTINUE; } Loading @@ -232,7 +232,7 @@ krb4_auth(void *app_data, struct connectdata *conn) if (krb_get_our_ip_for_realm(krb_realmofhost(host), &natAddr) != KSUCCESS && krb_get_our_ip_for_realm(NULL, &natAddr) != KSUCCESS) Curl_infof(data, "Can't get address for realm %s\n", infof(data, "Can't get address for realm %s\n", krb_realmofhost(host)); else { if (natAddr.s_addr != localaddr->sin_addr.s_addr) { Loading @@ -242,7 +242,7 @@ krb4_auth(void *app_data, struct connectdata *conn) #else char *ip = (char *)inet_ntoa(natAddr); #endif Curl_infof(data, "Using NAT IP address (%s) for kerberos 4\n", ip); infof(data, "Using NAT IP address (%s) for kerberos 4\n", ip); localaddr->sin_addr = natAddr; } } Loading
lib/sendf.h +10 −0 Original line number Diff line number Diff line Loading @@ -28,7 +28,17 @@ CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *, void Curl_infof(struct SessionHandle *, const char *fmt, ...); void Curl_failf(struct SessionHandle *, const char *fmt, ...); #if defined(CURL_DISABLE_VERBOSE_STRINGS) #if defined(__GNUC__) /* Variable argument macros is a C99 feature long supported by gcc */ #define infof(...) /*ignore*/ #else /* Cast the args to void to make them a noop, side effects notwithstanding */ #define infof (void) #endif #else #define infof Curl_infof #endif #define failf Curl_failf #define CLIENTWRITE_BODY 1 Loading
lib/strerror.c +35 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ extern char *strerror_r(int errnum, char *buf, size_t buflen); const char * curl_easy_strerror(CURLcode error) { #ifndef CURL_DISABLE_VERBOSE_STRINGS switch (error) { case CURLE_OK: return "no error"; Loading Loading @@ -252,11 +253,18 @@ curl_easy_strerror(CURLcode error) * is why it is here, and not at the start of the switch. */ return "unknown error"; #else if (error == CURLE_OK) return "no error"; else return "error"; #endif } const char * curl_multi_strerror(CURLMcode error) { #ifndef CURL_DISABLE_VERBOSE_STRINGS switch (error) { case CURLM_CALL_MULTI_PERFORM: return "please call curl_multi_perform() soon"; Loading @@ -281,11 +289,18 @@ curl_multi_strerror(CURLMcode error) } return "unknown error"; #else if (error == CURLM_OK) return "no error"; else return "error"; #endif } const char * curl_share_strerror(CURLSHcode error) { #ifndef CURL_DISABLE_VERBOSE_STRINGS switch (error) { case CURLSHE_OK: return "no error"; Loading @@ -307,6 +322,12 @@ curl_share_strerror(CURLSHcode error) } return "CURLSH unknown"; #else if (error == CURLSHE_OK) return "no error"; else return "error"; #endif } #if defined(WIN32) && !defined(__CYGWIN__) Loading @@ -318,6 +339,7 @@ get_winsock_error (int err, char *buf, size_t len) { char *p; #ifndef CURL_DISABLE_VERBOSE_STRINGS switch (err) { case WSAEINTR: p = "Call interrupted."; Loading Loading @@ -485,6 +507,12 @@ get_winsock_error (int err, char *buf, size_t len) default: return NULL; } #else if (error == CURLE_OK) return NULL; else p = "error"; #endif strncpy (buf, p, len); buf [len-1] = '\0'; return buf; Loading Loading @@ -594,6 +622,7 @@ const char *Curl_idn_strerror (struct connectdata *conn, int err) buf = conn->syserr_buf; max = sizeof(conn->syserr_buf)-1; #ifndef CURL_DISABLE_VERBOSE_STRINGS switch ((Idna_rc)err) { case IDNA_SUCCESS: str = "No error"; Loading Loading @@ -636,6 +665,12 @@ const char *Curl_idn_strerror (struct connectdata *conn, int err) str = NULL; break; } #else if ((Idna_rc)err == IDNA_SUCCESS) str = "No error"; else str = "error"; #endif if (str) strncpy(buf, str, max); buf[max] = '\0'; Loading