1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-15 23:53:25 +00:00

Socat printed the "socket ... is at EOF" message multiple times

This commit is contained in:
Gerhard Rieger 2019-12-30 10:05:33 +01:00
parent 3be18bdc1f
commit 12f7833a8f
4 changed files with 49 additions and 5 deletions

View file

@ -1076,10 +1076,10 @@ int _socat(void) {
XIO_RDSTREAM(sock1)->fd); /*! */
mayrd1 = true;
polling = 1; /* do not hook this eof fd to poll for pollintv*/
} else {
} else if (XIO_RDSTREAM(sock1)->eof <= 2) {
Notice1("socket 1 (fd %d) is at EOF", XIO_GETRDFD(sock1));
xioshutdown(sock2, SHUT_WR);
XIO_RDSTREAM(sock1)->eof = 2;
XIO_RDSTREAM(sock1)->eof = 3;
XIO_RDSTREAM(sock1)->ignoreeof = false;
}
} else if (polling && XIO_RDSTREAM(sock1)->ignoreeof) {
@ -1099,10 +1099,10 @@ int _socat(void) {
XIO_RDSTREAM(sock2)->fd);
mayrd2 = true;
polling = 1; /* do not hook this eof fd to poll for pollintv*/
} else {
} else if (XIO_RDSTREAM(sock2)->eof <= 2) {
Notice1("socket 2 (fd %d) is at EOF", XIO_GETRDFD(sock2));
xioshutdown(sock1, SHUT_WR);
XIO_RDSTREAM(sock2)->eof = 2;
XIO_RDSTREAM(sock2)->eof = 3;
XIO_RDSTREAM(sock2)->ignoreeof = false;
}
} else if (polling && XIO_RDSTREAM(sock2)->ignoreeof) {