diff -ruN 1/svdrp.c 2/svdrp.c --- 1/svdrp.c 2013-10-14 11:49:38.000000000 +0200 +++ 2/svdrp.c 2013-10-25 14:25:20.000000000 +0200 @@ -395,6 +395,7 @@ length = BUFSIZ; cmdLine = MALLOC(char, length); lastActivity = 0; + executing = false; isyslog("SVDRP listening on port %d", Port); } @@ -1742,7 +1743,8 @@ } if (NewConnection) lastActivity = time(NULL); - while (file.Ready(false)) { + if (!executing) + while (file.Ready(false)) { unsigned char c; int r = safe_read(file, &c, 1); if (r > 0) { @@ -1753,7 +1755,9 @@ // make sure the string is terminated: cmdLine[numChars] = 0; // showtime! + executing = true; Execute(cmdLine); + executing = false; numChars = 0; if (length > BUFSIZ) { free(cmdLine); // let's not tie up too much memory diff -ruN 1/svdrp.h 2/svdrp.h --- 1/svdrp.h 2013-09-14 15:24:50.000000000 +0200 +++ 2/svdrp.h 2013-10-25 14:25:20.000000000 +0200 @@ -50,6 +50,7 @@ char *cmdLine; time_t lastActivity; static char *grabImageDir; + bool executing; void Close(bool SendReply = false, bool Timeout = false); bool Send(const char *s, int length = -1); void Reply(int Code, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));