aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2008-04-17 00:45:33 +0000
committerDan Fandrich <dan@coneharvesters.com>2008-04-17 00:45:33 +0000
commit09777a4fc2ed0f2b09447eb89fb8cd4b99278944 (patch)
tree6bacd3d36ad24891153d55d573d776ca25065ce9 /lib
parent03310713467b678812067b3edab82b23ed6b1c04 (diff)
Some trivial changes
Diffstat (limited to 'lib')
-rw-r--r--lib/file.c17
-rw-r--r--lib/ftp.c7
-rw-r--r--lib/http.c4
3 files changed, 18 insertions, 10 deletions
diff --git a/lib/file.c b/lib/file.c
index 1e8374693..c79c635ec 100644
--- a/lib/file.c
+++ b/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;
diff --git a/lib/ftp.c b/lib/ftp.c
index 769bc8b14..473fffb2f 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -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);
diff --git a/lib/http.c b/lib/http.c
index cb330c6cf..f8ef9a4ea 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -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;