[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev FTP for DOS port (patch)
From: |
Doug Kaufman |
Subject: |
lynx-dev FTP for DOS port (patch) |
Date: |
Sat, 26 Jun 1999 00:08:26 -0700 (PDT) |
I have put the version of the WATTCP library as revised by Igor
Poretsky on my web and ftp servers for the use of anyone compiling
lynx with DJGPP. The changes are all by Igor. I am just making
space available for distribution. For ftp to function, a small
patch is necessary to the DJGPP makefiles. Following are the patch
to lynx and the patch to WATTCP. The latter is against the version
previously modified for lynx, which had been available from my sites
as "tcplibdj.zip". The new version now carries that name. The old
version has been renamed to "tcplibdj-old.zip". For the new package,
go to:
"http://www.rahul.net/dkaufman/tcplibdj.zip" or
"ftp://ftp.rahul.net/pub/dkaufman/tcplibdj.zip"
Doug
--- lynx2-8-3/WWW/Library/djgpp/makefile Fri Apr 23 07:56:36 1999
+++ lynx2-8-3/WWW/Library/djgpp/makefile.new Fri Jun 25 23:21:04 1999
@@ -8,7 +8,7 @@
#ASIS_MACH = hardware/os
CFLAGS = -O3 -DUSE_ZLIB -DDOSPATH -DNOUSERS -DDISP_PARTIAL \
--DSOURCE_CACHE -DUSE_PSRC \
+-DSOURCE_CACHE -DUSE_PSRC -DNOPORT \
-I../Implementation \
-I../../../djgpp/tcplib/include \
-I../../../djgpp/tcplib/include/tcp \
--- lynx2-8-3/WWW/Library/djgpp/makefile.sla Fri Jun 18 14:54:46 1999
+++ lynx2-8-3/WWW/Library/djgpp/makefile.sla.new Fri Jun 25 23:20:32 1999
@@ -8,7 +8,7 @@
#ASIS_MACH = hardware/os
CFLAGS = -O3 -DUSE_SLANG -DUSE_ZLIB -DDOSPATH -DNOUSERS -DDISP_PARTIAL \
--DDIRED_SUPPORT -DSOURCE_CACHE -DUSE_PSRC \
+-DDIRED_SUPPORT -DSOURCE_CACHE -DUSE_PSRC -DNOPORT \
-I../Implementation \
-I../../../djgpp/tcplib/include \
-I../../../djgpp/tcplib/include/tcp \
--- djgpp/tcplib/tcpsrc/pcbootp.c Thu May 26 07:13:40 1994
+++ tcplib/tcpsrc/pcbootp.c Tue Jun 22 15:14:12 1999
@@ -28,6 +28,7 @@
extern longword set_timeout();
+#undef VM_RFC1048
#define VM_RFC1048 0x63825363L /* I think this is correct */
/*
--- djgpp/tcplib/tcpsrc/pcconfig.c Thu Jul 14 06:41:14 1994
+++ tcplib/tcpsrc/pcconfig.c Tue Jun 22 15:14:12 1999
@@ -62,7 +62,7 @@
eth_address temp_eth;
char *temp;
- if (( temp = _inet_atoeth( s, &temp_eth )) != NULL ) {
+ if (( temp = _inet_atoeth( s, (byte *)&temp_eth )) != NULL ) {
if (!memcmp( &temp_eth, &_eth_addr, sizeof( eth_address ))) {
my_ip_addr = inet_addr( temp );
}
--- djgpp/tcplib/tcpsrc/pcicmp.c Fri Apr 15 17:29:40 1994
+++ tcplib/tcpsrc/pcicmp.c Tue Jun 22 15:14:12 1999
@@ -25,7 +25,7 @@
/* constants */
-typedef struct icmp_unused {
+struct icmp_unused {
byte type;
byte code;
word checksum;
@@ -34,7 +34,7 @@
byte spares[ 8 ];
};
-typedef struct icmp_pointer {
+struct icmp_pointer {
byte type;
byte code;
word checksum;
@@ -42,14 +42,14 @@
byte unused[ 3 ];
in_Header ip;
};
-typedef struct icmp_ip {
+struct icmp_ip {
byte type;
byte code;
word checksum;
longword ipaddr;
in_Header ip;
};
-typedef struct icmp_echo {
+struct icmp_echo {
byte type;
byte code;
word checksum;
@@ -57,7 +57,7 @@
word sequence;
};
-typedef struct icmp_timestamp {
+struct icmp_timestamp {
byte type;
byte code;
word checksum;
@@ -68,7 +68,7 @@
longword transmit; /* transmit timestamp */
};
-typedef struct icmp_info {
+struct icmp_info {
byte type;
byte code;
word checksum;
@@ -85,7 +85,7 @@
struct icmp_info info;
} icmp_pkt;
-typedef struct _pkt {
+struct _pkt {
in_Header in;
icmp_pkt icmp;
in_Header data;
@@ -233,7 +233,7 @@
break;
#else
/* format the packet with the request's hardware address */
- pkt = (struct _pkt*)(_eth_formatpacket( _eth_hardware(ip), 8));
+ pkt = (struct _pkt*)(_eth_formatpacket( _eth_hardware((byte *)ip), 8));
#endif OLD
newicmp = &pkt->icmp;
--- djgpp/tcplib/tcpsrc/pcping.c Fri Apr 15 17:30:24 1994
+++ tcplib/tcpsrc/pcping.c Tue Jun 22 15:14:12 1999
@@ -1,7 +1,7 @@
#include <copyright.h>
#include <wattcp.h>
-typedef struct icmp_echo {
+struct icmp_echo {
byte type;
byte code;
word checksum;
@@ -10,7 +10,7 @@
longword index;
};
-typedef struct _pkt {
+struct _pkt {
in_Header in;
struct icmp_echo icmp;
in_Header data;
--- djgpp/tcplib/tcpsrc/pcsed.c Wed Apr 20 07:21:20 1994
+++ tcplib/tcpsrc/pcsed.c Tue Jun 22 15:14:12 1999
@@ -69,7 +69,7 @@
if (( _pktdevclass == PD_ETHER ) && ((len += 14) < ETH_MIN ))
len = ETH_MIN;
- return( pkt_send( &outbuf, len )); /* send to packet driver */
+ return( pkt_send( (char *)&outbuf, len )); /* send to packet driver */
}
/*
--- djgpp/tcplib/tcpsrc/pctcp.c Tue Feb 4 15:20:52 1997
+++ tcplib/tcpsrc/pctcp.c Tue Jun 22 16:02:56 1999
@@ -22,6 +22,7 @@
#include <dos.h>
#include <values.h>
#include <pc.h>
+#include <errno.h>
#include "osdep.h"
@@ -329,7 +330,7 @@
s->mss = _mss;
s->cwindow = 1;
s->wwindow = 0; /* slow start VJ algorithm */
- s->vj_sa = 36; /* about 250 ms */
+ s->vj_sa = 4; /* about 250 ms */
s->state = tcp_StateLISTEN;
if ( !timeout ) s->timeout = 0; /* forever... */
@@ -611,7 +612,8 @@
tcp_Retransmitter();
- return( (s) ? s->udp.ip_type : 0 );
+ if(kbhit()) { errno=EINTR; return(0); }
+ else return( (s) ? s->udp.ip_type : 0 );
}
void tcp_set_debug_state( x )
@@ -791,7 +793,7 @@
break;
/* icmp redirect for host */
case 5 : /* save his NEW network address */
- _arp_resolve(dummyip, &s->hisethaddr[0], 0);
+ _arp_resolve(dummyip, (eth_address
*)&s->hisethaddr[0], 0);
break;
}
@@ -920,7 +922,7 @@
&& intel16( up->dstPort ) == s->myport ) {
s->hisaddr = intel( ip->source );
s->hisport = intel16( up->srcPort );
- _arp_resolve(intel(ip->source), &s->hisethaddr[0], 0);
+ _arp_resolve(intel(ip->source), (eth_address
*)&s->hisethaddr[0], 0);
/* take on value of expected destination unless it */
/* is broadcast */
if ( ip->destination != 0xffffffffL )
@@ -1078,9 +1080,11 @@
#endif /* DEBUG */
}
s->karn_count = 0;
- if ( s->wwindow++ >= s->cwindow ) {
- s->cwindow++;
- s->wwindow = 0;
+ if ( s->wwindow != 255 ) {
+ if ( s->wwindow++ >= s->cwindow ) {
+ if ( s->cwindow != 255 ) s->cwindow++;
+ s->wwindow = 0;
+ }
}
}
/* all new */
@@ -1791,9 +1795,9 @@
while ( len > 0) {
if (proto) {
s->tcp.flags |= oldmode;
- offset += tcp_write( &(s->udp), &dp[ offset ], len);
+ offset += tcp_write( &(s->tcp), &dp[ offset ], len);
} else
- offset += udp_write( &(s->tcp), &dp[ offset ], len );
+ offset += udp_write( &(s->udp), &dp[ offset ], len );
len = oldlen - offset;
if (s->udp.usr_yield)(s->udp.usr_yield)();
if (!tcp_tick(s)) return( 0 );
@@ -1806,8 +1810,8 @@
sock_fastwrite(sock_type *s, byte *dp, int len)
{
return( ( s->udp.ip_type == UDP_PROTO ) ?
- udp_write( s, dp, len ) :
- tcp_write( s, dp, len) );
+ udp_write( &(s->udp), dp, len ) :
+ tcp_write( &(s->tcp), dp, len) );
}
int sock_setbuf( sock_type *s, byte *dp, int len )
@@ -1830,14 +1834,14 @@
if ( len < 0 ) return( 0 );
if ( s->udp.ip_type == UDP_PROTO ) {
do {
- written = udp_write( s, dp, len );
+ written = udp_write( &(s->udp), dp, len );
dp += written;
} while (len -= written > 0);
} else {
s->tcp.queue = dp;
s->tcp.queuelen = len;
s->tcp.datalen = len;
- tcp_send( s, __LINE__ ); /* start sending it */
+ tcp_send( &(s->tcp), __LINE__ ); /* start sending it */
}
return( len );
}
@@ -1853,7 +1857,7 @@
{
if ( s->tcp.ip_type == TCP_PROTO ) {
s->tcp.sock_mode &= ~TCP_LOCAL;
- tcp_Flush( s );
+ tcp_Flush( &(s->tcp) );
}
}
@@ -1987,7 +1991,7 @@
movmem( &src_p[ n ], src_p, *np -= n );
if (*np < 0) *np = 0;
- sock_update( s ); /* new window */
+ sock_update( &(s->tcp) ); /* new window */
return( len );
}
@@ -2036,10 +2040,10 @@
{
switch (s->udp.ip_type) {
case UDP_PROTO :
- udp_close( s );
+ udp_close( &(s->udp) );
break;
case TCP_PROTO :
- tcp_close( s );
+ tcp_close( &(s->tcp) );
tcp_tick( s );
break;
}
@@ -2060,10 +2064,10 @@
int *statusptr;
{
int status;
- ip_timer_init( s , timeoutseconds );
+ ip_timer_init( &(s->udp) , timeoutseconds );
do {
if ( s->tcp.ip_type == TCP_PROTO ) {
- if ( tcp_established( s )) {
+ if ( tcp_established( &(s->tcp) )) {
status = 0;
break;
}
@@ -2074,7 +2078,7 @@
status = -1; /* get an early reset */
break;
}
- if ( ip_timer_expired( s )) {
+ if ( ip_timer_expired( &(s->udp) )) {
s->tcp.err_msg = "Open timed out";
sock_close( s );
status = -1;
@@ -2098,7 +2102,7 @@
int *statusptr;
{
int status;
- ip_timer_init( s , timeoutseconds );
+ ip_timer_init( &(s->udp) , timeoutseconds );
sock_flush( s ); /* new enhancement */
@@ -2113,7 +2117,7 @@
status = 1;
break;
}
- if ( ip_timer_expired( s )) {
+ if ( ip_timer_expired( &(s->udp) )) {
s->tcp.err_msg = "Connection timed out";
sock_close( s );
status = -1;
@@ -2136,7 +2140,7 @@
int *statusptr;
{
int status;
- ip_timer_init( s , timeoutseconds );
+ ip_timer_init( &(s->udp) , timeoutseconds );
if (s->tcp.ip_type != TCP_PROTO ) {
if ( statusptr ) * statusptr = 1;
@@ -2151,9 +2155,9 @@
status = 1;
break;
}
- if ( ip_timer_expired( s )) {
+ if ( ip_timer_expired( &(s->udp) )) {
s->tcp.err_msg = "Connection timed out";
- sock_abort( s );
+ sock_abort( &(s->tcp) );
status = -1;
break;
}
--- djgpp/tcplib/tcpsrc/udp_dom.c Sun Jan 5 15:36:36 1997
+++ tcplib/tcpsrc/udp_dom.c Tue Jun 22 15:14:12 1999
@@ -167,7 +167,7 @@
* returns the number of bytes at src which should be skipped over.
* Includes the NULL terminator in its length count.
*/
-static unpackdom(char *dst,char *src,char *buf)
+static int unpackdom(char *dst,char *src,char *buf)
{
int i,j,retval;
char *savesrc;
@@ -227,7 +227,7 @@
udp_open( dom_sock, 997, towho, 53, NULL ); /* divide err */
- sock_write( dom_sock, question, ulen );
+ sock_write( (sock_type *)dom_sock, (byte *)question, ulen );
return( ulen);
}
@@ -279,7 +279,7 @@
if (nans > 0 &&
/* at least one answer */
(intel16(qp->h.flags) & DQR)) { /* response flag is set
*/
p = (byte *)&qp->x; /* where question starts */
- i = unpackdom(space,p,qp); /* unpack
question name */
+ i = unpackdom(space,p,(char *)qp); /*
unpack question name */
/* spec defines name then QTYPE + QCLASS = 4 bytes */
p += i+4;
/*
@@ -288,7 +288,7 @@
* we want to support later.
*/
while (nans-- > 0) { /* look at each
answer */
- i = unpackdom(space,p,qp); /* answer name to
unpack */
+ i = unpackdom(space,p,(char *)qp); /* answer name
to unpack */
/* n_puts(space);*/
p += i;
/* account for string */
rrp = (struct rrpart *)p; /* resource record here
*/
@@ -319,7 +319,7 @@
int i,uret;
longword desired;
- uret = sock_fastread(dom_sock, question, sizeof(struct useek ));
+ uret = sock_fastread((sock_type *)dom_sock, (byte *)question,
sizeof(struct useek ));
/* this does not happen */
if (uret < 0) {
/* netputevent(USERCLASS,DOMFAIL,-1); */
@@ -331,7 +331,7 @@
* check to see if the necessary information was in the UDP response
*/
- i = ddextract(question, &desired);
+ i = ddextract(question, (unsigned char *)&desired);
switch (i) {
case 3: return(0); /* name does not exist */
case 0: return(intel(desired)); /* we found the IP number */
@@ -411,7 +411,7 @@
if ( !*timedout )
response = udpdom(); /* process the received data */
- sock_close( dom_sock );
+ sock_close( (sock_type *)dom_sock );
return( response );
}
@@ -473,7 +473,7 @@
for ( i = 0; i < _last_nameserver ; ++i ) {
if (!timeout[i])
if (ip_address = Sdomain( name , count != -1 ,
- def_nameservers[i], &timeout[i] ))
+ def_nameservers[i], (int *)&timeout[i] ))
break; /* got name, bail out of loop */
}
--- djgpp/tcplib/tcpsys/socket.c Sat Nov 14 19:57:40 1998
+++ tcplib/tcpsys/socket.c Tue Jun 22 16:02:54 1999
@@ -35,7 +35,7 @@
#include <pc.h>
/* While it's not in the pc.h header..... */
#if defined(DJGPP) && (DJGPP >= 2)
-static int gettimeofday ( struct timeval *tp, struct timezone *tzp )
+int gettimeofday ( struct timeval *tp, struct timezone *tzp )
{
uclock_t ticks;
@@ -233,6 +233,13 @@
{
sock_close(&Socket[s]->s);
Socket[s]->lds = -1;
+/*
+ patch from Wayne Buttles to fix 'alert: socket failed' bug
+ untested in this compilation
+
+>> if (Socket[s]->type == SOCK_DGRAM)
+<< if ((Socket[s]->type == SOCK_DGRAM) || (Socket[s]->type == SOCK_STREAM))
+*/
if ((Socket[s]->type == SOCK_DGRAM) || (Socket[s]->type == SOCK_STREAM))
Status[s] = sFree;
return 0;
@@ -525,10 +532,10 @@
len = nbyte;
ss = &(Socket[s]->s);
- while (len > 0)
+ while ((len > 0) && (cnt==0))
{
- n = sock_fastread(ss, buf, len);
- if (n==0)
+ cnt = sock_fastread(ss, buf, len);
+ if (cnt==0)
{
if (!tcp_tick(&ss->tcp))
#ifdef TCPDEB /*debug*/
@@ -539,20 +546,7 @@
#else
return(cnt);
#endif
- n = sock_read(ss, buf, len);
- if (n==0)
- {
-#ifdef TCPDEB /*debug*/
- if (cnt) debug("read",cnt,buf-cnt);
-#endif
- if (cnt) return cnt;
- errno = EAGAIN;
- return -1;
- }
}
- cnt += n;
- buf += n;
- len -= n;
}
#ifdef TCPDEB /*debug*/
if (cnt) debug("read",cnt,buf-cnt);
@@ -874,7 +868,7 @@
n->sin_addr.s_addr = intel(Socket[s]->s.tcp.myaddr);
n->sin_port = intel16(Socket[s]->s.tcp.myport);
*mynamelen = sizeof(struct sockaddr_in);
- break;
+ return 0;
case sListn:
{
int ns;
--- djgpp/tcplib/include/tcp/bootp.h Mon Nov 4 04:41:48 1991
+++ tcplib/include/tcp/bootp.h Tue Jun 22 15:14:12 1999
@@ -11,7 +11,7 @@
/*
* structure for send and receives
*/
-typedef struct bootp {
+struct bootp {
byte bp_op; /* packet op code / message type. */
byte bp_htype; /* hardware address type, 1 = 10 mb ethernet */
byte bp_hlen; /* hardware address len, eg '6' for 10mb eth */
--- djgpp/tcplib/include/tcp/ethdev.h Fri Apr 29 06:42:56 1994
+++ tcplib/include/tcp/ethdev.h Tue Jun 22 15:14:12 1999
@@ -6,7 +6,7 @@
extern byte *_eth_FormatPacket(), *_eth_WaitPacket();
-typedef struct ether {
+struct ether {
byte dest[6] pack;
byte src[6] pack;
word type pack;
--- djgpp/tcplib/makefile Mon Sep 28 22:35:38 1998
+++ tcplib/makefile Tue May 18 10:31:20 1999
@@ -34,7 +34,7 @@
CFLAGS_OPTIMIZE = -O2
CFLAGS_DEBUG = -g
-all:: ping.exe htget.exe
+all:: ping.exe htget.exe ftp.exe
ping.exe: ping.o
$(CC) ping.o -g -L. -ltcp -o ping.exe
__
Doug Kaufman
Internet: address@hidden (preferred)
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- lynx-dev FTP for DOS port (patch),
Doug Kaufman <=