diff options
Diffstat (limited to 'WWW/Library/Implementation')
-rw-r--r-- | WWW/Library/Implementation/HTFTP.c | 96 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTFormat.c | 2 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTMIME.c | 4 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTMLDTD.h | 14 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTNews.c | 4 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTStream.h | 2 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTTCP.c | 9 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTVMS_WaisUI.h | 4 |
8 files changed, 43 insertions, 92 deletions
diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c index 20cafe2e..a4418474 100644 --- a/WWW/Library/Implementation/HTFTP.c +++ b/WWW/Library/Implementation/HTFTP.c @@ -38,11 +38,6 @@ ** and code to parse dates and sizes on most hosts. ** 27 Mar 93 (FM) Added code for getting dates and sizes on VMS hosts. ** -** Options: -** LISTEN We listen, the other guy connects for data. -** Otherwise, other way round, but problem finding our -** internet address! -** ** Notes: ** Portions Copyright 1994 Trustees of Dartmouth College ** Code for recognizing different FTP servers and @@ -52,15 +47,6 @@ */ /* -** If LISTEN is not defined, PASV is used instead of PORT, and not -** all FTP servers support PASV, so define it unless there is no -** alternative for your system. -*/ -#ifndef NOPORT -#define LISTEN /* @@@@ Test LJM */ -#endif /* !NOPORT */ - -/* BUGS: @@@ Limit connection cache size! Error reporting to user. 400 & 500 errors are ack'ed by user with windows. @@ -81,9 +67,7 @@ BUGS: @@@ Limit connection cache size! #include <HTFTP.h> /* Implemented here */ #include <HTTCP.h> - -/* this define should be in HTFont.h :( */ -#define HT_NON_BREAK_SPACE ((char)1) /* For now */ +#include <HTFont.h> #define REPEAT_PORT /* Give the port number for each file */ #define REPEAT_LISTEN /* Close each listen socket and open a new one */ @@ -109,6 +93,7 @@ BUGS: @@@ Limit connection cache size! #endif /* !IPORT_FTP */ #include <LYUtils.h> +#include <LYGlobalDefs.h> #include <LYStrings.h> #include <LYLeaks.h> @@ -189,14 +174,11 @@ PRIVATE int interrupted_in_next_data_char = FALSE; PRIVATE unsigned short port_number = FIRST_TCP_PORT; #endif /* POLL_PORTS */ -#ifdef LISTEN PRIVATE int master_socket = -1; /* Listening socket = invalid */ PRIVATE char port_command[255]; /* Command for setting the port */ PRIVATE fd_set open_sockets; /* Mask of active channels */ PRIVATE int num_sockets; /* Number of sockets to scan */ -#else PRIVATE unsigned short passive_port; /* Port server specified for data */ -#endif /* LISTEN */ #define NEXT_CHAR HTGetCharacter() /* Use function in HTFormat.c */ @@ -1053,8 +1035,6 @@ PRIVATE int get_connection ARGS2( } -#ifdef LISTEN - /* Close Master (listening) socket ** ------------------------------- ** @@ -1211,7 +1191,7 @@ PRIVATE int get_listen_socket NOARGS #ifdef REPEAT_LISTEN if (master_socket >= 0) (void) close_master_socket(); -#endif /* REPEAD_LISTEN */ +#endif /* REPEAT_LISTEN */ master_socket = new_socket; @@ -1251,7 +1231,6 @@ PRIVATE int get_listen_socket NOARGS return master_socket; /* Good */ } /* get_listen_socket */ -#endif /* LISTEN */ PRIVATE char * months[12] = { "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" @@ -2891,21 +2870,20 @@ PUBLIC int HTFTPLoad ARGS4( if (status < 0) return status; -#ifdef LISTEN - status = get_listen_socket(); - if (status < 0) { - NETCLOSE (control->socket); - control->socket = -1; - close_master_socket (); - /* HT_INTERRUPTED would fall through, if we could interrupt - somehow in the middle of it, which we currently can't. */ - return status; - } + if (!ftp_passive) { + status = get_listen_socket(); + if (status < 0) { + NETCLOSE (control->socket); + control->socket = -1; + close_master_socket (); + /* HT_INTERRUPTED would fall through, if we could interrupt + somehow in the middle of it, which we currently can't. */ + return status; + } #ifdef REPEAT_PORT -/* Inform the server of the port number we will listen on -*/ - { + /* Inform the server of the port number we will listen on + */ status = response(port_command); if (status == HT_INTERRUPTED) { CTRACE((tfp, "HTFTP: Interrupted in response (port_command)\n")); @@ -2921,16 +2899,12 @@ PUBLIC int HTFTPLoad ARGS4( return -status; /* bad reply */ } CTRACE((tfp, "HTFTP: Port defined.\n")); - } #endif /* REPEAT_PORT */ -#else /* Use PASV */ -/* Tell the server to be passive -*/ - { + } else { /* Tell the server to be passive */ char command[LINE_LENGTH+1]; char *p; - int reply, h0, h1, h2, h3, p0, p1; /* Parts of reply */ - int status; + int h0, h1, h2, h3, p0, p1; /* Parts of reply */ + data_soc = status; status = send_cmd_1("PASV"); @@ -2945,19 +2919,18 @@ PUBLIC int HTFTPLoad ARGS4( while (--p > response_text && '0' <= *p && *p <= '9') ; /* null body */ - status = sscanf(p+1, "%d,%d,%d,%d,%d,%d", - &h0, &h1, &h2, &h3, &p0, &p1); - if (status < 4) { - fprintf(tfp, "HTFTP: PASV reply has no inet address!\n"); - return -99; - } - passive_port = (p0<<8) + p1; - CTRACE((tfp, "HTFTP: Server is listening on port %d\n", - passive_port)); + status = sscanf(p+1, "%d,%d,%d,%d,%d,%d", + &h0, &h1, &h2, &h3, &p0, &p1); + if (status < 4) { + fprintf(tfp, "HTFTP: PASV reply has no inet address!\n"); + return -99; + } + passive_port = (p0<<8) + p1; + CTRACE((tfp, "HTFTP: Server is listening on port %d\n", + passive_port)); + /* Open connection for data: */ -/* Open connection for data: -*/ sprintf(command, "ftp://%d.%d.%d.%d:%d/",h0,h1,h2,h3,passive_port); status = HTDoConnect(name, "FTP", passive_port, &data_soc); @@ -2970,7 +2943,6 @@ PUBLIC int HTFTPLoad ARGS4( CTRACE((tfp, "FTP data connected, socket %d\n", data_soc)); } -#endif /* use PASV */ status = 0; break; /* No more retries */ @@ -3460,10 +3432,8 @@ PUBLIC int HTFTPLoad ARGS4( } listen: -#ifdef LISTEN -/* Wait for the connection -*/ - { + if(!ftp_passive) { + /* Wait for the connection */ struct sockaddr_in soc_address; int soc_addrlen=sizeof(soc_address); #ifdef SOCKS @@ -3482,10 +3452,8 @@ listen: } CTRACE((tfp, "TCP: Accepted new socket %d\n", status)); data_soc = status; - } -#else -/* @@ */ -#endif /* LISTEN */ + } /* !ftp_passive */ + if ((status = send_cmd_nowait("QUIT")) == 1) outstanding++; if (isDirectory) { diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c index b4def6e6..37a3172e 100644 --- a/WWW/Library/Implementation/HTFormat.c +++ b/WWW/Library/Implementation/HTFormat.c @@ -1418,7 +1418,7 @@ PRIVATE CONST HTStreamClass HTErrorStreamClass = HTErrorStream_write }; -PUBLIC HTStream * HTErrorStream (void) +PUBLIC HTStream * HTErrorStream NOARGS { CTRACE((tfp, "ErrorStream. Created\n")); HTBaseStreamInstance.isa = &HTErrorStreamClass; /* The rest is random */ diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c index 48d3b55a..ca024e41 100644 --- a/WWW/Library/Implementation/HTMIME.c +++ b/WWW/Library/Implementation/HTMIME.c @@ -166,7 +166,7 @@ PUBLIC void HTMIME_TrimDoubleQuotes ARGS1( value[i] = cp[(i +1)]; } -PRIVATE int pumpData (HTStream * me) +PRIVATE int pumpData ARGS1(HTStream *, me) { if (strchr(HTAtom_name(me->format), ';') != NULL) { char *cp = NULL, *cp1, *cp2, *cp3 = NULL, *cp4; @@ -437,7 +437,7 @@ PRIVATE int pumpData (HTStream * me) return HT_OK; } -PRIVATE int dispatchField (HTStream * me) +PRIVATE int dispatchField ARGS1(HTStream *, me) { int i, j; char *cp; diff --git a/WWW/Library/Implementation/HTMLDTD.h b/WWW/Library/Implementation/HTMLDTD.h index 9167fb2a..d732e7b4 100644 --- a/WWW/Library/Implementation/HTMLDTD.h +++ b/WWW/Library/Implementation/HTMLDTD.h @@ -13,19 +13,7 @@ #define HTMLDTD_H #include <SGML.h> - -/* -** Lynx internal character representations. -*/ -#ifndef HT_NON_BREAK_SPACE -#define HT_NON_BREAK_SPACE ((char)1) /* For now */ -#endif /* !HT_NON_BREAK_SPACE */ -#ifndef HT_EN_SPACE -#define HT_EN_SPACE ((char)2) /* For now */ -#endif /* !HT_EN_SPACE */ -#ifndef LY_SOFT_HYPHEN -#define LY_SOFT_HYPHEN ((char)7) -#endif /* !LY_SOFT_HYPHEN */ +#include <HTFont.h> /* ** Valid mane chars for tag parsing. diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c index c37f07e0..68457ffd 100644 --- a/WWW/Library/Implementation/HTNews.c +++ b/WWW/Library/Implementation/HTNews.c @@ -16,13 +16,11 @@ #include <HTCJK.h> #include <HTMIME.h> +#include <HTFont.h> #include <HTTCP.h> #include <LYUtils.h> #include <LYStrings.h> -/* this define should be in HTFont.h :( */ -#define HT_NON_BREAK_SPACE ((char)1) /* For now */ - #define NEWS_PORT 119 /* See rfc977 */ #define SNEWS_PORT 563 /* See Lou Montulli */ #define APPEND /* Use append methods */ diff --git a/WWW/Library/Implementation/HTStream.h b/WWW/Library/Implementation/HTStream.h index a9c4703d..868e0f41 100644 --- a/WWW/Library/Implementation/HTStream.h +++ b/WWW/Library/Implementation/HTStream.h @@ -63,7 +63,7 @@ typedef struct _HTStreamClass { example from the network. */ -extern HTStream * HTErrorStream (void); +extern HTStream * HTErrorStream NOPARAMS; #endif /* HTSTREAM_H */ diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c index 36c8ef2d..505ed74f 100644 --- a/WWW/Library/Implementation/HTTCP.c +++ b/WWW/Library/Implementation/HTTCP.c @@ -1598,17 +1598,18 @@ PUBLIC int HTDoConnect ARGS4( /* ** Protect against an infinite loop. */ - if (tries++ >= 180000) { - HTAlert(gettext("Connection failed for 180,000 tries.")); + if ((tries++/10) >= connect_timeout) { + HTAlert(gettext("Connection failed (too many retries).")); return HT_NO_DATA; } #ifdef _WINDOWS_NSL - timeout.tv_sec = 100; + timeout.tv_sec = connect_timeout; + timeout.tv_usec = 0; #else timeout.tv_sec = 0; -#endif /* _WINDOWS_NSL */ timeout.tv_usec = 100000; +#endif /* _WINDOWS_NSL */ FD_ZERO(&writefds); FD_SET((unsigned) *s, &writefds); #ifdef SOCKS diff --git a/WWW/Library/Implementation/HTVMS_WaisUI.h b/WWW/Library/Implementation/HTVMS_WaisUI.h index 150e108d..474b943d 100644 --- a/WWW/Library/Implementation/HTVMS_WaisUI.h +++ b/WWW/Library/Implementation/HTVMS_WaisUI.h @@ -183,10 +183,6 @@ typedef unsigned long data_tag; #define ACCEPT TRUE #define REJECT FALSE -/* values for SearchAPDU replace indicator element */ -#define ON TRUE -#define OFF FALSE - /* values for SearchResponseAPDU search status element */ #define SUCCESS 0 /* intuitive huh? */ #define FAILURE 1 |