From 193d4e3947c9ea199cb01901923d423f161f0847 Mon Sep 17 00:00:00 2001 From: rd235 Date: Thu, 19 May 2005 20:23:32 +0000 Subject: [PATCH] bugfix in vde_plug (hangup was not correctly managed, sometimes vde_plug entered a CPU consuming loop instead of terminating). git-svn-id: https://vde.svn.sourceforge.net/svnroot/vde/trunk@36 d37a7db1-d92d-0410-89df-f68f52f87b57 --- vde/vde_plug.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vde/vde_plug.c b/vde/vde_plug.c index 748f5f3..3b8778f 100644 --- a/vde/vde_plug.c +++ b/vde/vde_plug.c @@ -392,6 +392,10 @@ int main(int argc, char **argv) break; if (pollv[0].revents & POLLIN) { nx=read(STDIN_FILENO,bufin,sizeof(bufin)); + /* if POLLIN but not data it means that the stream has been + * closed at the other end */ + if (nx==0) + break; splitpacket(bufin,nx,fddata,&dataout); //sendto(fddata,bufin,nx,0,(struct sockaddr *) &dataout,sizeof(dataout)); -- 2.11.4.GIT