Some trivial changes
This commit is contained in:
17
lib/file.c
17
lib/file.c
@@ -68,7 +68,7 @@
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* WIN32 */
|
||||
|
||||
#include "strtoofft.h"
|
||||
#include "urldata.h"
|
||||
@@ -90,6 +90,9 @@
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
|
||||
#define MSDOS_FILESYSTEM 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 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);
|
||||
struct FILEPROTO *file;
|
||||
int fd;
|
||||
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
|
||||
#ifdef MSDOS_FILESYSTEM
|
||||
int i;
|
||||
char *actual_path;
|
||||
#endif
|
||||
@@ -217,7 +220,7 @@ static CURLcode file_connect(struct connectdata *conn, bool *done)
|
||||
file->fd = -1;
|
||||
}
|
||||
|
||||
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
|
||||
#ifdef MSDOS_FILESYSTEM
|
||||
/* If the first character is a slash, and there's
|
||||
something that looks like a drive at the beginning of
|
||||
the path, skip the slash. If we remove the initial
|
||||
@@ -279,7 +282,7 @@ static CURLcode file_done(struct connectdata *conn,
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
|
||||
#ifdef MSDOS_FILESYSTEM
|
||||
#define DIRSEP '\\'
|
||||
#else
|
||||
#define DIRSEP '/'
|
||||
@@ -319,13 +322,13 @@ static CURLcode file_upload(struct connectdata *conn)
|
||||
else {
|
||||
int fd;
|
||||
|
||||
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
|
||||
#ifdef MSDOS_FILESYSTEM
|
||||
fd = open(file->path, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY,
|
||||
conn->data->set.new_file_perms);
|
||||
#else /* !(WIN32 || MSDOS || __EMX__) */
|
||||
#else
|
||||
fd = open(file->path, O_WRONLY|O_CREAT|O_TRUNC,
|
||||
conn->data->set.new_file_perms);
|
||||
#endif /* !(WIN32 || MSDOS || __EMX__) */
|
||||
#endif
|
||||
if(fd < 0) {
|
||||
failf(data, "Can't open %s for writing", file->path);
|
||||
return CURLE_WRITE_ERROR;
|
||||
|
||||
@@ -110,6 +110,9 @@
|
||||
#define NIFLAGS NI_NUMERICHOST | NI_NUMERICSERV
|
||||
#endif
|
||||
|
||||
/* Default response timeout in milliseconds */
|
||||
#define RESP_TIMEOUT (3600*1000)
|
||||
|
||||
#ifdef CURL_DISABLE_VERBOSE_STRINGS
|
||||
#define ftp_pasv_verbose(a,b,c,d) do { } while(0)
|
||||
#endif
|
||||
@@ -3053,7 +3056,7 @@ static CURLcode ftp_connect(struct connectdata *conn,
|
||||
/* We always support persistant connections on ftp */
|
||||
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
|
||||
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;
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -104,6 +104,8 @@
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
/* Default proxy timeout in milliseconds */
|
||||
#define PROXY_TIMEOUT (3600*1000)
|
||||
|
||||
/*
|
||||
* Forward declarations.
|
||||
@@ -1221,7 +1223,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
|
||||
CURLcode result;
|
||||
int res;
|
||||
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_off_t cl=0;
|
||||
bool closeConnection = FALSE;
|
||||
|
||||
Reference in New Issue
Block a user