Work around for buggy ftelnet
This commit is contained in:
parent
cfa6b20d5d
commit
fb8056e084
9
bbs.c
9
bbs.c
@ -217,6 +217,8 @@ char s_getchar(int socket) {
|
|||||||
unsigned char c;
|
unsigned char c;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
|
do {
|
||||||
|
|
||||||
len = read(socket, &c, 1);
|
len = read(socket, &c, 1);
|
||||||
|
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
@ -238,13 +240,14 @@ char s_getchar(int socket) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c == '\r' || c == '\n') {
|
|
||||||
len = read(socket, &c, 1);
|
|
||||||
|
if (c == '\r') {
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
disconnect(socket);
|
disconnect(socket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} while (c == '\n');
|
||||||
usertimeout = 10;
|
usertimeout = 10;
|
||||||
return (char)c;
|
return (char)c;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user