Skip to content
Snippets Groups Projects
Commit 08094133 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Handle read errors in Protocols.LysKOM.Raw.

If there is a network outage, con->read() will return 0 (not the empty
string) after a (long) while.  Treat that properly by calling
connection_lost() in that case as well.

Fixed a backrace in conwrite by returning 0 if the connection
is closed.

(cherry picked from commit 7cdea47d)
parent e12e2f09
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,7 @@ protected inline int conwrite(string what)
#ifdef LYSKOM_DEBUG
werror("-> %O\n",what);
#endif
if (!con) return 0;
int i=con->write(what)==sizeof(what);
if (!i) { werror("write failed!!!\n"); _exit(1); }
return i;
......@@ -282,6 +283,7 @@ void read_thread()
}
recv(0,s);
}
connection_lost();
}
#if constant(thread_create) && !LYSKOM_UNTHREADED
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment