summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1cd64d0)
raw | patch | inline | side by side (parent: 1cd64d0)
author | M. Sean Finney <seanius@users.sourceforge.net> | |
Tue, 3 May 2005 01:52:19 +0000 (01:52 +0000) | ||
committer | M. Sean Finney <seanius@users.sourceforge.net> | |
Tue, 3 May 2005 01:52:19 +0000 (01:52 +0000) |
fix committed here adds on more piece of logic to the check to see if more data needs
to be read, avoiding the deadlock call. a better fix would be to not use these "voodoo"
heuristics and instead use poll() or select(), but that's quite a bit more complicated.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1170 f882894a-f735-0410-b71e-b25c423dba1c
to be read, avoiding the deadlock call. a better fix would be to not use these "voodoo"
heuristics and instead use poll() or select(), but that's quite a bit more complicated.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1170 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_tcp.c | patch | blob | history |
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index 979dfad88b0a19aba789d4084d9b56857dca931e..fd2fe66bc572a273e94eedf1c3322e0826f81bb1 100644 (file)
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
while ((i = my_recv ()) > 0) {
buffer[i] = '\0';
asprintf (&status, "%s%s", status, buffer);
- if (buffer[i-2] == '\r' && buffer[i-1] == '\n')
- break;
+ if (buffer[i-1] == '\n') {
+ if (buffer[i-2] == '\r' || i < MAXBUF-1)
+ break;
+ }
if (maxbytes>0 && strlen(status) >= (unsigned)maxbytes)
break;
}