Handling of initial protocol error changed
The client accepts a long(er) response time when waiting for server to enable RFC2217 (telnet option). Bug in hangling of rx timeout fixed
This commit is contained in:
+5
-4
@@ -7,6 +7,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "telnet.h"
|
||||
#include "telnet_param.h"
|
||||
@@ -284,12 +285,12 @@ int telnet_open(tn_ctx_t *tcc, int mode)
|
||||
while (1)
|
||||
{
|
||||
res = tcc->srv_rx(tcc->cctx, 1000);
|
||||
if (res <= 0)
|
||||
return -1;
|
||||
if (res < 0)
|
||||
return errno;
|
||||
else if (tcc->mode_rfc2217)
|
||||
return 0;
|
||||
else if (t - time(NULL) > 2)
|
||||
return -1;
|
||||
else if (time(NULL) - t > 10)
|
||||
return EPROTO;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -470,9 +470,9 @@ static void ttynvt_open(fuse_req_t req, struct fuse_file_info *info)
|
||||
|
||||
res =
|
||||
telnet_open(tty->tn, ttynvt_param.raw ? TN_MODE_RAW : TN_MODE_TELNET);
|
||||
if (res < 0)
|
||||
if (res != 0)
|
||||
{
|
||||
errno = EPROTO;
|
||||
errno = res;
|
||||
goto open_err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user