diff -ruN 1.7.41_26/svdrp.c 1.7.41_28/svdrp.c --- 1.7.41_26/svdrp.c 2013-03-18 22:43:59.000000000 +0100 +++ 1.7.41_28/svdrp.c 2013-03-18 23:03:34.000000000 +0100 @@ -410,6 +410,7 @@ length = BUFSIZ; cmdLine = MALLOC(char, length); lastActivity = 0; + executing = false; isyslog("SVDRP listening on port %d", Port); } @@ -1823,7 +1824,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) { @@ -1834,7 +1836,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.7.41_26/svdrp.h 1.7.41_28/svdrp.h --- 1.7.41_26/svdrp.h 2013-03-18 22:43:59.000000000 +0100 +++ 1.7.41_28/svdrp.h 2013-03-18 23:03:34.000000000 +0100 @@ -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)));