won't:will not
couldn't:could not
\bwill\b:rewrite to present tense
+32bit=32-bit
+64bit=64-bit
+32 bit\b=32-bit
+64 bit\b=64-bit
+64-bits:64 bits or 64-bit
+32-bits:32 bits or 32-bit
`size_t` is not a fixed size. `time_t` can be signed or unsigned and have
different sizes. Relying on variable sizes is a red flag.
-Also remember that endianness and >= 32 bit accesses to unaligned addresses
+Also remember that endianness and >= 32-bit accesses to unaligned addresses
are problematic areas.
## Integer overflows
-Be careful about integer overflows. Some variable types can be either 32 bit
-or 64 bit. Integer overflows must be detected and acted on *before* they
+Be careful about integer overflows. Some variable types can be either 32-bit
+or 64-bit. Integer overflows must be detected and acted on *before* they
happen.
## Dangerous use of functions
- axTLS
- PolarSSL
- NPN
- - Support for systems without 64 bit data types
+ - Support for systems without 64-bit data types
- NSS
- gskit
- mingw v1
4. Running Problems
4.2 Why do I get problems when I use & or % in the URL?
4.3 How can I use {, }, [ or ] to specify multiple URLs?
- 4.4 Why do I get downloaded data even though the web page does not exist?
+ 4.4 Why do I get downloaded data even though the webpage does not exist?
4.5 Why do I get return code XXX from an HTTP server?
4.5.1 "400 Bad Request"
4.5.2 "401 Unauthorized"
4.5.5 "405 Method Not Allowed"
4.5.6 "301 Moved Permanently"
4.6 Can you tell me what error code 142 means?
- 4.7 How do I keep user names and passwords secret in curl command lines?
+ 4.7 How do I keep usernames and passwords secret in curl command lines?
4.8 I found a bug
4.9 curl cannot authenticate to a server that requires NTLM?
4.10 My HTTP request using HEAD, PUT or DELETE does not work
5.6 What about Keep-Alive or persistent connections?
5.7 Link errors when building libcurl on Windows
5.8 libcurl.so.X: open failed: No such file or directory
- 5.9 How does libcurl resolve host names?
+ 5.9 How does libcurl resolve hostnames?
5.10 How do I prevent libcurl from writing the response to stdout?
5.11 How do I make libcurl not receive the whole HTTP response?
5.12 Can I make libcurl fake or hide my real IP address?
3.14 Does curl support JavaScript or PAC (automated proxy config)?
- Many web pages do magic stuff using embedded JavaScript. curl and libcurl
+ Many webpages do magic stuff using embedded JavaScript. curl and libcurl
have no built-in support for that, so it will be treated just like any other
contents.
curl --header "Host: www.example.com" http://127.0.0.1/
- You can also opt to add faked host name entries to curl with the --resolve
+ You can also opt to add faked hostname entries to curl with the --resolve
option. That has the added benefit that things like redirects will also work
properly. The above operation would instead be done as:
[WHATEVER]. This way you can for example send a DELETE by doing "curl -X
DELETE [URL]".
- It is thus pointless to do "curl -XGET [URL]" as GET would be used
- anyway. In the same vein it is pointless to do "curl -X POST -d data
- [URL]"... But you can make a fun and somewhat rare request that sends a
- request-body in a GET request with something like "curl -X GET -d data
- [URL]"
+ It is thus pointless to do "curl -XGET [URL]" as GET would be used anyway.
+ In the same vein it is pointless to do "curl -X POST -d data [URL]". You can
+ make a fun and somewhat rare request that sends a request-body in a GET
+ request with something like "curl -X GET -d data [URL]"
Note that -X does not actually change curl's behavior as it only modifies the
actual string sent in the request, but that may of course trigger a
curl -g 'www.example.com/weirdname[].html'
- 4.4 Why do I get downloaded data even though the web page does not exist?
+ 4.4 Why do I get downloaded data even though the webpage does not exist?
curl asks remote servers for the page you specify. If the page does not exist
at the server, the HTTP protocol defines how the server should respond and
appreciate a detailed bug report from you that describes how we could go
ahead and repeat this.
- 4.7 How do I keep user names and passwords secret in curl command lines?
+ 4.7 How do I keep usernames and passwords secret in curl command lines?
This problem has two sides:
When doing HTTP transfers, curl will perform exactly what you are asking it
to do and if successful it will not return an error. You can use curl to
test your web server's "file not found" page (that gets 404 back), you can
- use it to check your authentication protected web pages (that gets a 401
+ use it to check your authentication protected webpages (that gets a 401
back) and so on.
The specific HTTP response code does not constitute a problem or error for
5.6 What about Keep-Alive or persistent connections?
curl and libcurl have excellent support for persistent connections when
- transferring several files from the same server. curl will attempt to reuse
+ transferring several files from the same server. curl will attempt to reuse
connections for all URLs specified on the same command line/config file, and
libcurl will reuse connections for all transfers that are made using the
same libcurl handle.
'man ld.so' and 'man ld' will tell you more details
- 5.9 How does libcurl resolve host names?
+ 5.9 How does libcurl resolve hostnames?
libcurl supports a large number of name resolve functions. One of them is
picked at build-time and will be used unconditionally. Thus, if you want to
change name resolver function you must rebuild libcurl and tell it to use a
different function.
- - The non-IPv6 resolver that can use one of four different host name resolve
+ - The non-IPv6 resolver that can use one of four different hostname resolve
calls (depending on what your system supports):
A - gethostbyname()
This function returns -1 when it fails to parse the date string. Otherwise it
returns the number of seconds as described.
-On systems with a signed 32 bit time_t: if the year is larger than 2037 or
+On systems with a signed 32-bit time_t: if the year is larger than 2037 or
less than 1903, this function returns -1.
-On systems with an unsigned 32 bit time_t: if the year is larger than 2106 or
+On systems with an unsigned 32-bit time_t: if the year is larger than 2106 or
less than 1970, this function returns -1.
-On systems with 64 bit time_t: if the year is less than 1583, this function
+On systems with 64-bit time_t: if the year is less than 1583, this function
returns -1. (The Gregorian calendar was first introduced 1582 so no "real"
dates in this way of doing dates existed before then.)
marked for getting removed in a future.
The last version that featured the specific symbol. Using the symbol in source
-code will make it no longer compile error-free after that specified version.
+code makes it no longer compile error-free after that specified version.
This man page is automatically generated from the symbols-in-versions file.
HEADER
hide it or the server does not support the command that tells document time
etc) and the time of the document is unknown.
-You must tell libcurl to collect this information before the transfer is made,
-by using the CURLOPT_FILETIME(3) option to curl_easy_setopt(3) or
-you this unconditionally gets a -1 back.
+You must ask libcurl to collect this information before the transfer is made,
+by using the CURLOPT_FILETIME(3) option or you unconditionally get a -1 back.
-Consider using CURLINFO_FILETIME_T(3) to be able to extract dates beyond
-the year 2038 on systems using 32 bit longs (Windows).
+Consider CURLINFO_FILETIME_T(3) instead to be able to extract dates beyond the
+year 2038 on systems using 32-bit longs (Windows).
# EXAMPLE
# DESCRIPTION
Pass a pointer to a curl_off_t to receive the remote time of the retrieved
-document in number of seconds since January 1 1970 in the GMT/UTC time
-zone. If you get -1, it can be because of many reasons (it might be unknown,
-the server might hide it or the server does not support the command that tells
+document in number of seconds since January 1 1970 in the GMT/UTC time zone.
+If you get -1, it can be because of many reasons (it might be unknown, the
+server might hide it or the server does not support the command that tells
document time etc) and the time of the document is unknown.
You must ask libcurl to collect this information before the transfer is made,
-by using the CURLOPT_FILETIME(3) option to curl_easy_setopt(3) or
-you unconditionally get a -1 back.
+by using the CURLOPT_FILETIME(3) option or you unconditionally get a -1 back.
-This option is an alternative to CURLINFO_FILETIME(3) to allow systems
-with 32 bit long variables to extract dates outside of the 32bit timestamp
-range.
+This option is an alternative to CURLINFO_FILETIME(3) to allow systems with 32
+bit long variables to extract dates outside of the 32-bit timestamp range.
# EXAMPLE
since 1 Jan 1970, and the time is used in a condition as specified with
CURLOPT_TIMECONDITION(3).
-On systems with 32 bit 'long' variables (such as Windows), this option cannot
+On systems with 32-bit 'long' variables (such as Windows), this option cannot
set dates beyond the year 2038. Consider CURLOPT_TIMEVALUE_LARGE(3)
instead.
seconds since 1 Jan 1970, and the time is used in a condition as specified
with CURLOPT_TIMECONDITION(3).
-The difference between this option and CURLOPT_TIMEVALUE(3) is the type
-of the argument. On systems where 'long' is only 32 bit wide, this option has
-to be used to set dates beyond the year 2038.
+The difference between this option and CURLOPT_TIMEVALUE(3) is the type of the
+argument. On systems where 'long' is only 32 bits wide, this option has to be
+used to set dates beyond the year 2038.
# DEFAULT
}
else {
/* poll for name lookup done with exponential backoff up to 250ms */
- /* should be fine even if this converts to 32 bit */
+ /* should be fine even if this converts to 32-bit */
timediff_t elapsed = Curl_timediff(Curl_now(),
data->progress.t_startsingle);
if(elapsed < 0)
{
DES_cblock key;
- /* Expand the 56-bit key to 64-bits */
+ /* Expand the 56-bit key to 64 bits */
extend_key_56_to_64(key_56, (char *) &key);
/* Set the key parity to odd */
{
char key[8];
- /* Expand the 56-bit key to 64-bits */
+ /* Expand the 56-bit key to 64 bits */
extend_key_56_to_64(key_56, key);
/* Set the key parity to odd */
mbedtls_des_context ctx;
char key[8];
- /* Expand the 56-bit key to 64-bits */
+ /* Expand the 56-bit key to 64 bits */
extend_key_56_to_64(key_56, key);
/* Set the key parity to odd */
size_t out_len;
CCCryptorStatus err;
- /* Expand the 56-bit key to 64-bits */
+ /* Expand the 56-bit key to 64 bits */
extend_key_56_to_64(key_56, key);
/* Set the key parity to odd */
ctl.Func_ID = ENCRYPT_ONLY;
ctl.Data_Len = sizeof(key);
- /* Expand the 56-bit key to 64-bits */
+ /* Expand the 56-bit key to 64 bits */
extend_key_56_to_64(key_56, ctl.Crypto_Key);
/* Set the key parity to odd */
blob.hdr.aiKeyAlg = CALG_DES;
blob.len = sizeof(blob.key);
- /* Expand the 56-bit key to 64-bits */
+ /* Expand the 56-bit key to 64 bits */
extend_key_56_to_64(key_56, blob.key);
/* Set the key parity to odd */
#endif
#ifndef SIZEOF_TIME_T
-/* assume default size of time_t to be 32 bit */
+/* assume default size of time_t to be 32 bits */
#define SIZEOF_TIME_T 4
#endif
case CURLINFO_LASTSOCKET:
sockfd = Curl_getconnectinfo(data, NULL);
- /* note: this is not a good conversion for systems with 64 bit sockets and
- 32 bit longs */
+ /* note: this is not a good conversion for systems with 64-bit sockets and
+ 32-bit longs */
if(sockfd != CURL_SOCKET_BAD)
*param_longp = (long)sockfd;
else
/*
* The longest possible hexadecimal number we support in a chunked transfer.
* Neither RFC2616 nor the later HTTP specs define a maximum chunk size.
- * For 64 bit curl_off_t we support 16 digits. For 32 bit, 8 digits.
+ * For 64-bit curl_off_t we support 16 digits. For 32-bit, 8 digits.
*/
#define CHUNK_MAXNUM_LEN (SIZEOF_CURL_OFF_T * 2)
if(Curl_splaycomparekeys(multi->timetree->key, now) > 0) {
/* some time left before expiration */
timediff_t diff = Curl_timediff_ceil(multi->timetree->key, now);
- /* this should be safe even on 32 bit archs, as we don't use that
- overly long timeouts */
+ /* this should be safe even on 32-bit archs, as we don't use that overly
+ long timeouts */
*timeout_ms = (long)diff;
}
else
DEBUGASSERT(id < EXPIRE_LAST);
set = Curl_now();
- set.tv_sec += (time_t)(milli/1000); /* might be a 64 to 32 bit conversion */
+ set.tv_sec += (time_t)(milli/1000); /* might be a 64 to 32 bits conversion */
set.tv_usec += (int)(milli%1000)*1000;
if(set.tv_usec >= 1000000) {
#if (SIZEOF_TIME_T < 5)
#ifdef HAVE_TIME_T_UNSIGNED
- /* an unsigned 32 bit time_t can only hold dates to 2106 */
+ /* an unsigned 32-bit time_t can only hold dates to 2106 */
if(yearnum > 2105) {
*output = TIME_T_MAX;
return PARSEDATE_LATER;
}
#else
- /* a signed 32 bit time_t can only hold dates to the beginning of 2038 */
+ /* a signed 32-bit time_t can only hold dates to the beginning of 2038 */
if(yearnum > 2037) {
*output = TIME_T_MAX;
return PARSEDATE_LATER;
return PARSEDATE_FAIL; /* clearly an illegal date */
/* time2epoch() returns a time_t. time_t is often 32 bits, sometimes even on
- architectures that feature 64 bit 'long' but ultimately time_t is the
+ architectures that feature a 64 bits 'long' but ultimately time_t is the
correct data type to use.
*/
t = time2epoch(secnum, minnum, hournum, mdaynum, monnum, yearnum);
/*
* Use this scope id when using IPv6
* We always get longs when passed plain numericals so we should check
- * that the value fits into an unsigned 32 bit integer.
+ * that the value fits into an unsigned 32-bit integer.
*/
uarg = va_arg(param, unsigned long);
#if SIZEOF_LONG > 4
{
struct passwd *my_passwd;
-/* Hack needed to support 64 bit builds, decc_getpwnam is 32 bit only */
+/* Hack needed to support 64-bit builds, decc_getpwnam is 32-bit only */
#ifdef __DECC
# if __INITIAL_POINTER_SIZE
__char_ptr32 unix_path;
* Determine which string to integral data type conversion function we use
* to implement string conversion to our curl_off_t integral data type.
*
- * Notice that curl_off_t might be 64 or 32 bit wide, and that it might use
+ * Notice that curl_off_t might be 64 or 32 bits wide, and that it might use
* an underlying data type which might be 'long', 'int64_t', 'long long' or
* '__int64' and more remotely other data types.
*
#include "curl_setup.h"
-/* Use a larger type even for 32 bit time_t systems so that we can keep
+/* Use a larger type even for 32-bit time_t systems so that we can keep
microsecond accuracy in it */
typedef curl_off_t timediff_t;
#define CURL_FORMAT_TIMEDIFF_T CURL_FORMAT_CURL_OFF_T
curl_off_t payload_len; /* payload length of current frame */
curl_off_t payload_remain; /* remaining payload of current */
unsigned int xori; /* xor index */
- unsigned char mask[4]; /* 32 bit mask for this connection */
+ unsigned char mask[4]; /* 32-bit mask for this connection */
unsigned char firstbyte; /* first byte of frame we encode */
bool contfragment; /* set TRUE if the previous fragment sent was not final */
};