mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 17:31:46 -05:00
Some trivial changes
This commit is contained in:
parent
0331071346
commit
09777a4fc2
@ -99,7 +99,7 @@ typedef void CURL;
|
|||||||
|
|
||||||
#ifdef CURL_HIDDEN_SYMBOLS
|
#ifdef CURL_HIDDEN_SYMBOLS
|
||||||
/*
|
/*
|
||||||
* This definition is used to make external definitions visibile in the
|
* This definition is used to make external definitions visible in the
|
||||||
* shared library when symbols are hidden by default. It makes no
|
* shared library when symbols are hidden by default. It makes no
|
||||||
* difference when compiling applications whether this is set or not,
|
* difference when compiling applications whether this is set or not,
|
||||||
* only when compiling the library.
|
* only when compiling the library.
|
||||||
@ -115,7 +115,7 @@ typedef void CURL;
|
|||||||
* platforms. We also provide a CURL_FORMAT_OFF_T define to use in *printf
|
* platforms. We also provide a CURL_FORMAT_OFF_T define to use in *printf
|
||||||
* format strings when outputting a variable of type curl_off_t.
|
* format strings when outputting a variable of type curl_off_t.
|
||||||
*
|
*
|
||||||
* Note: "pocc -Ze" is MSVC compatibily mode and this sets _MSC_VER!
|
* Note: "pocc -Ze" is MSVC compatibility mode and this sets _MSC_VER!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if (defined(_MSC_VER) && !defined(__POCC__)) || (defined(__LCC__) && defined(WIN32))
|
#if (defined(_MSC_VER) && !defined(__POCC__)) || (defined(__LCC__) && defined(WIN32))
|
||||||
@ -211,7 +211,7 @@ struct curl_httppost {
|
|||||||
do not free in formfree */
|
do not free in formfree */
|
||||||
#define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */
|
#define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */
|
||||||
#define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */
|
#define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */
|
||||||
#define HTTPPOST_CALLBACK (1<<6) /* upload fiel contents by using the
|
#define HTTPPOST_CALLBACK (1<<6) /* upload file contents by using the
|
||||||
regular read callback to get the data
|
regular read callback to get the data
|
||||||
and pass the given pointer as custom
|
and pass the given pointer as custom
|
||||||
pointer */
|
pointer */
|
||||||
@ -237,7 +237,7 @@ typedef int (*curl_progress_callback)(void *clientp,
|
|||||||
#define CURL_MAX_WRITE_SIZE 16384
|
#define CURL_MAX_WRITE_SIZE 16384
|
||||||
#endif
|
#endif
|
||||||
/* This is a magic return code for the write callback that, when returned,
|
/* This is a magic return code for the write callback that, when returned,
|
||||||
will signal libcurl to pause receving on the current transfer. */
|
will signal libcurl to pause receiving on the current transfer. */
|
||||||
#define CURL_WRITEFUNC_PAUSE 0x10000001
|
#define CURL_WRITEFUNC_PAUSE 0x10000001
|
||||||
typedef size_t (*curl_write_callback)(char *buffer,
|
typedef size_t (*curl_write_callback)(char *buffer,
|
||||||
size_t size,
|
size_t size,
|
||||||
@ -678,7 +678,7 @@ typedef enum {
|
|||||||
|
|
||||||
/* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
|
/* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
|
||||||
* how large the file being sent really is. That allows better error
|
* how large the file being sent really is. That allows better error
|
||||||
* checking and better verifies that the upload was succcessful. -1 means
|
* checking and better verifies that the upload was successful. -1 means
|
||||||
* unknown size.
|
* unknown size.
|
||||||
*
|
*
|
||||||
* For large file support, there is also a _LARGE version of the key
|
* For large file support, there is also a _LARGE version of the key
|
||||||
@ -690,7 +690,7 @@ typedef enum {
|
|||||||
/* POST static input fields. */
|
/* POST static input fields. */
|
||||||
CINIT(POSTFIELDS, OBJECTPOINT, 15),
|
CINIT(POSTFIELDS, OBJECTPOINT, 15),
|
||||||
|
|
||||||
/* Set the referer page (needed by some CGIs) */
|
/* Set the referrer page (needed by some CGIs) */
|
||||||
CINIT(REFERER, OBJECTPOINT, 16),
|
CINIT(REFERER, OBJECTPOINT, 16),
|
||||||
|
|
||||||
/* Set the FTP PORT string (interface name, named or numerical IP address)
|
/* Set the FTP PORT string (interface name, named or numerical IP address)
|
||||||
@ -749,7 +749,7 @@ typedef enum {
|
|||||||
"cookie awareness" */
|
"cookie awareness" */
|
||||||
CINIT(COOKIEFILE, OBJECTPOINT, 31),
|
CINIT(COOKIEFILE, OBJECTPOINT, 31),
|
||||||
|
|
||||||
/* What version to specifly try to use.
|
/* What version to specifically try to use.
|
||||||
See CURL_SSLVERSION defines below. */
|
See CURL_SSLVERSION defines below. */
|
||||||
CINIT(SSLVERSION, LONG, 32),
|
CINIT(SSLVERSION, LONG, 32),
|
||||||
|
|
||||||
@ -810,7 +810,7 @@ typedef enum {
|
|||||||
/* Data passed to the progress callback */
|
/* Data passed to the progress callback */
|
||||||
CINIT(PROGRESSDATA, OBJECTPOINT, 57),
|
CINIT(PROGRESSDATA, OBJECTPOINT, 57),
|
||||||
|
|
||||||
/* We want the referer field set automatically when following locations */
|
/* We want the referrer field set automatically when following locations */
|
||||||
CINIT(AUTOREFERER, LONG, 58),
|
CINIT(AUTOREFERER, LONG, 58),
|
||||||
|
|
||||||
/* Port of the proxy, can be set in the proxy string as well with:
|
/* Port of the proxy, can be set in the proxy string as well with:
|
||||||
@ -907,7 +907,7 @@ typedef enum {
|
|||||||
CURL_HTTP_VERSION* enums set below. */
|
CURL_HTTP_VERSION* enums set below. */
|
||||||
CINIT(HTTP_VERSION, LONG, 84),
|
CINIT(HTTP_VERSION, LONG, 84),
|
||||||
|
|
||||||
/* Specificly switch on or off the FTP engine's use of the EPSV command. By
|
/* Specifically switch on or off the FTP engine's use of the EPSV command. By
|
||||||
default, that one will always be attempted before the more traditional
|
default, that one will always be attempted before the more traditional
|
||||||
PASV command. */
|
PASV command. */
|
||||||
CINIT(FTP_USE_EPSV, LONG, 85),
|
CINIT(FTP_USE_EPSV, LONG, 85),
|
||||||
@ -977,11 +977,11 @@ typedef enum {
|
|||||||
CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
|
CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
|
||||||
|
|
||||||
/* Continue to send authentication (user+password) when following locations,
|
/* Continue to send authentication (user+password) when following locations,
|
||||||
even when hostname changed. This can potentionally send off the name
|
even when hostname changed. This can potentially send off the name
|
||||||
and password to whatever host the server decides. */
|
and password to whatever host the server decides. */
|
||||||
CINIT(UNRESTRICTED_AUTH, LONG, 105),
|
CINIT(UNRESTRICTED_AUTH, LONG, 105),
|
||||||
|
|
||||||
/* Specificly switch on or off the FTP engine's use of the EPRT command ( it
|
/* Specifically switch on or off the FTP engine's use of the EPRT command ( it
|
||||||
also disables the LPRT attempt). By default, those ones will always be
|
also disables the LPRT attempt). By default, those ones will always be
|
||||||
attempted before the good old traditional PORT command. */
|
attempted before the good old traditional PORT command. */
|
||||||
CINIT(FTP_USE_EPRT, LONG, 106),
|
CINIT(FTP_USE_EPRT, LONG, 106),
|
||||||
@ -1162,7 +1162,7 @@ typedef enum {
|
|||||||
CINIT(CONNECTTIMEOUT_MS, LONG, 156),
|
CINIT(CONNECTTIMEOUT_MS, LONG, 156),
|
||||||
|
|
||||||
/* set to zero to disable the libcurl's decoding and thus pass the raw body
|
/* set to zero to disable the libcurl's decoding and thus pass the raw body
|
||||||
data to the appliction even when it is encoded/compressed */
|
data to the application even when it is encoded/compressed */
|
||||||
CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
|
CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
|
||||||
CINIT(HTTP_CONTENT_DECODING, LONG, 158),
|
CINIT(HTTP_CONTENT_DECODING, LONG, 158),
|
||||||
|
|
||||||
@ -1321,7 +1321,7 @@ typedef enum {
|
|||||||
|
|
||||||
CFINIT(STREAM),
|
CFINIT(STREAM),
|
||||||
|
|
||||||
CURLFORM_LASTENTRY /* the last unusued */
|
CURLFORM_LASTENTRY /* the last unused */
|
||||||
} CURLformoption;
|
} CURLformoption;
|
||||||
|
|
||||||
#undef CFINIT /* done */
|
#undef CFINIT /* done */
|
||||||
@ -1367,7 +1367,7 @@ typedef enum {
|
|||||||
*
|
*
|
||||||
* DESCRIPTION
|
* DESCRIPTION
|
||||||
*
|
*
|
||||||
* Pretty advanved function for building multi-part formposts. Each invoke
|
* Pretty advanced function for building multi-part formposts. Each invoke
|
||||||
* adds one part that together construct a full post. Then use
|
* adds one part that together construct a full post. Then use
|
||||||
* CURLOPT_HTTPPOST to send it off to libcurl.
|
* CURLOPT_HTTPPOST to send it off to libcurl.
|
||||||
*/
|
*/
|
||||||
@ -1622,7 +1622,7 @@ typedef enum {
|
|||||||
/* Different data locks for a single share */
|
/* Different data locks for a single share */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CURL_LOCK_DATA_NONE = 0,
|
CURL_LOCK_DATA_NONE = 0,
|
||||||
/* CURL_LOCK_DATA_SHARE is used internaly to say that
|
/* CURL_LOCK_DATA_SHARE is used internally to say that
|
||||||
* the locking is just made to change the internal state of the share
|
* the locking is just made to change the internal state of the share
|
||||||
* itself.
|
* itself.
|
||||||
*/
|
*/
|
||||||
@ -1664,7 +1664,7 @@ typedef enum {
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
CURLSHOPT_NONE, /* don't use */
|
CURLSHOPT_NONE, /* don't use */
|
||||||
CURLSHOPT_SHARE, /* specify a data type to share */
|
CURLSHOPT_SHARE, /* specify a data type to share */
|
||||||
CURLSHOPT_UNSHARE, /* specify shich data type to stop sharing */
|
CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
|
||||||
CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
|
CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
|
||||||
CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
|
CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
|
||||||
CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock
|
CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock
|
||||||
@ -1689,7 +1689,7 @@ typedef enum {
|
|||||||
} CURLversion;
|
} CURLversion;
|
||||||
|
|
||||||
/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
|
/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
|
||||||
basicly all programs ever, that want to get version information. It is
|
basically all programs ever that want to get version information. It is
|
||||||
meant to be a built-in version number for what kind of struct the caller
|
meant to be a built-in version number for what kind of struct the caller
|
||||||
expects. If the struct ever changes, we redefine the NOW to another enum
|
expects. If the struct ever changes, we redefine the NOW to another enum
|
||||||
from above. */
|
from above. */
|
||||||
|
17
lib/file.c
17
lib/file.c
@ -68,7 +68,7 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif /* WIN32 */
|
||||||
|
|
||||||
#include "strtoofft.h"
|
#include "strtoofft.h"
|
||||||
#include "urldata.h"
|
#include "urldata.h"
|
||||||
@ -90,6 +90,9 @@
|
|||||||
/* The last #include file should be: */
|
/* The last #include file should be: */
|
||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
|
|
||||||
|
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
|
||||||
|
#define MSDOS_FILESYSTEM 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Forward declarations.
|
* Forward declarations.
|
||||||
@ -186,7 +189,7 @@ static CURLcode file_connect(struct connectdata *conn, bool *done)
|
|||||||
char *real_path = curl_easy_unescape(data, data->state.path, 0, NULL);
|
char *real_path = curl_easy_unescape(data, data->state.path, 0, NULL);
|
||||||
struct FILEPROTO *file;
|
struct FILEPROTO *file;
|
||||||
int fd;
|
int fd;
|
||||||
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
|
#ifdef MSDOS_FILESYSTEM
|
||||||
int i;
|
int i;
|
||||||
char *actual_path;
|
char *actual_path;
|
||||||
#endif
|
#endif
|
||||||
@ -217,7 +220,7 @@ static CURLcode file_connect(struct connectdata *conn, bool *done)
|
|||||||
file->fd = -1;
|
file->fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
|
#ifdef MSDOS_FILESYSTEM
|
||||||
/* If the first character is a slash, and there's
|
/* If the first character is a slash, and there's
|
||||||
something that looks like a drive at the beginning of
|
something that looks like a drive at the beginning of
|
||||||
the path, skip the slash. If we remove the initial
|
the path, skip the slash. If we remove the initial
|
||||||
@ -279,7 +282,7 @@ static CURLcode file_done(struct connectdata *conn,
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
|
#ifdef MSDOS_FILESYSTEM
|
||||||
#define DIRSEP '\\'
|
#define DIRSEP '\\'
|
||||||
#else
|
#else
|
||||||
#define DIRSEP '/'
|
#define DIRSEP '/'
|
||||||
@ -319,13 +322,13 @@ static CURLcode file_upload(struct connectdata *conn)
|
|||||||
else {
|
else {
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
|
#ifdef MSDOS_FILESYSTEM
|
||||||
fd = open(file->path, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY,
|
fd = open(file->path, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY,
|
||||||
conn->data->set.new_file_perms);
|
conn->data->set.new_file_perms);
|
||||||
#else /* !(WIN32 || MSDOS || __EMX__) */
|
#else
|
||||||
fd = open(file->path, O_WRONLY|O_CREAT|O_TRUNC,
|
fd = open(file->path, O_WRONLY|O_CREAT|O_TRUNC,
|
||||||
conn->data->set.new_file_perms);
|
conn->data->set.new_file_perms);
|
||||||
#endif /* !(WIN32 || MSDOS || __EMX__) */
|
#endif
|
||||||
if(fd < 0) {
|
if(fd < 0) {
|
||||||
failf(data, "Can't open %s for writing", file->path);
|
failf(data, "Can't open %s for writing", file->path);
|
||||||
return CURLE_WRITE_ERROR;
|
return CURLE_WRITE_ERROR;
|
||||||
|
@ -110,6 +110,9 @@
|
|||||||
#define NIFLAGS NI_NUMERICHOST | NI_NUMERICSERV
|
#define NIFLAGS NI_NUMERICHOST | NI_NUMERICSERV
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Default response timeout in milliseconds */
|
||||||
|
#define RESP_TIMEOUT (3600*1000)
|
||||||
|
|
||||||
#ifdef CURL_DISABLE_VERBOSE_STRINGS
|
#ifdef CURL_DISABLE_VERBOSE_STRINGS
|
||||||
#define ftp_pasv_verbose(a,b,c,d) do { } while(0)
|
#define ftp_pasv_verbose(a,b,c,d) do { } while(0)
|
||||||
#endif
|
#endif
|
||||||
@ -3053,7 +3056,7 @@ static CURLcode ftp_connect(struct connectdata *conn,
|
|||||||
/* We always support persistant connections on ftp */
|
/* We always support persistant connections on ftp */
|
||||||
conn->bits.close = FALSE;
|
conn->bits.close = FALSE;
|
||||||
|
|
||||||
ftpc->response_time = 3600000; /* set default response time-out */
|
ftpc->response_time = RESP_TIMEOUT; /* set default response time-out */
|
||||||
|
|
||||||
#ifndef CURL_DISABLE_HTTP
|
#ifndef CURL_DISABLE_HTTP
|
||||||
if(conn->bits.tunnel_proxy && conn->bits.httpproxy) {
|
if(conn->bits.tunnel_proxy && conn->bits.httpproxy) {
|
||||||
@ -3230,7 +3233,7 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
|
|||||||
*/
|
*/
|
||||||
long old_time = ftpc->response_time;
|
long old_time = ftpc->response_time;
|
||||||
|
|
||||||
ftpc->response_time = 60000; /* give it only a minute for now */
|
ftpc->response_time = 60*1000; /* give it only a minute for now */
|
||||||
|
|
||||||
result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
|
result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
|
||||||
|
|
||||||
|
@ -104,6 +104,8 @@
|
|||||||
/* The last #include file should be: */
|
/* The last #include file should be: */
|
||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
|
|
||||||
|
/* Default proxy timeout in milliseconds */
|
||||||
|
#define PROXY_TIMEOUT (3600*1000)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Forward declarations.
|
* Forward declarations.
|
||||||
@ -1221,7 +1223,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
|
|||||||
CURLcode result;
|
CURLcode result;
|
||||||
int res;
|
int res;
|
||||||
long timeout =
|
long timeout =
|
||||||
data->set.timeout?data->set.timeout:3600000; /* in milliseconds */
|
data->set.timeout?data->set.timeout:PROXY_TIMEOUT; /* in milliseconds */
|
||||||
curl_socket_t tunnelsocket = conn->sock[sockindex];
|
curl_socket_t tunnelsocket = conn->sock[sockindex];
|
||||||
curl_off_t cl=0;
|
curl_off_t cl=0;
|
||||||
bool closeConnection = FALSE;
|
bool closeConnection = FALSE;
|
||||||
|
@ -184,7 +184,7 @@ static bool ttyecho(bool enable, int fd)
|
|||||||
static struct_term noecho;
|
static struct_term noecho;
|
||||||
#endif
|
#endif
|
||||||
if(!enable) {
|
if(!enable) {
|
||||||
/* dissable echo by extracting the current 'withecho' mode and remove the
|
/* disable echo by extracting the current 'withecho' mode and remove the
|
||||||
ECHO bit and set back the struct */
|
ECHO bit and set back the struct */
|
||||||
#ifdef HAVE_TERMIOS_H
|
#ifdef HAVE_TERMIOS_H
|
||||||
tcgetattr(fd, &withecho);
|
tcgetattr(fd, &withecho);
|
||||||
|
@ -93,10 +93,10 @@ static const struct variable replacements[]={
|
|||||||
{NULL, VAR_NONE}
|
{NULL, VAR_NONE}
|
||||||
};
|
};
|
||||||
|
|
||||||
void ourWriteOut(CURL *curl, char *writeinfo)
|
void ourWriteOut(CURL *curl, const char *writeinfo)
|
||||||
{
|
{
|
||||||
FILE *stream = stdout;
|
FILE *stream = stdout;
|
||||||
char *ptr=writeinfo;
|
const char *ptr=writeinfo;
|
||||||
char *stringp;
|
char *stringp;
|
||||||
long longinfo;
|
long longinfo;
|
||||||
double doubleinfo;
|
double doubleinfo;
|
||||||
|
@ -23,6 +23,6 @@
|
|||||||
* $Id$
|
* $Id$
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
void ourWriteOut(CURL *curl, char *out);
|
void ourWriteOut(CURL *curl, const char *out);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user