Skip to content
Snippets Groups Projects
Commit c9ebbe5a authored by deuce's avatar deuce
Browse files

Switch back to rcvtimeo based timeouts but have option to make

type a preference (when prefereces are implemented)
parent d4f6f810
Branches
Tags
No related merge requests found
......@@ -5,6 +5,8 @@
static SOCKET rlogin_socket=INVALID_SOCKET;
int rcvtimeo=1;
int rlogin_recv(char *buffer, size_t buflen)
{
int r;
......@@ -51,7 +53,6 @@ int rlogin_connect(char *addr, int port, char *ruser, char *passwd, int bedumb)
char nil=0;
char *p;
unsigned int neta;
unsigned long l;
for(p=addr;*p;p++)
if(*p!='.' && !isdigit(*p))
......@@ -93,9 +94,22 @@ int rlogin_connect(char *addr, int port, char *ruser, char *passwd, int bedumb)
return(-1);
}
l=1;
ioctlsocket(rlogin_socket, FIONBIO,&l);
/* fcntl(rlogin_socket, F_SETFL, fcntl(rlogin_socket, F_GETFL)|O_NONBLOCK); */
if(rcvtimeo) {
#ifdef _WIN32
int tv=10;
#else
struct timeval tv;
tv.tv_sec=0;
tv.tv_usec=10000;
#endif
setsockopt(rlogin_socket,SOL_SOCKET,SO_RCVTIMEO,&tv,sizeof(tv));
}
else {
unsigned long l=1;
ioctlsocket(rlogin_socket, FIONBIO,&l);
}
if(!bedumb) {
rlogin_send("",1,1000);
......
......@@ -4,6 +4,7 @@
#include <sockwrap.h>
extern SOCKET rlogin_socket;
extern int rcvtimeo;
int rlogin_recv(char *buffer, size_t buflen);
int rlogin_send(char *buffer, size_t buflen, unsigned int timeout);
......
......@@ -2,6 +2,7 @@
#include <ciolib.h>
#include <keys.h>
#include "rlogin.h"
#include "term.h"
#include "uifcinit.h"
#include "menu.h"
......@@ -117,6 +118,7 @@ void doterm(void)
}
}
SLEEP(1);
if(!rcvtimeo)
SLEEP(1);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment