projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
29e3c6c
)
memcached: Check for closed connection to avoid deadloop
author
Pavel Rochnyack
<pavel2000@ngs.ru>
Sun, 10 Dec 2017 20:24:33 +0000
(
03:24
+0700)
committer
Pavel Rochnyack
<pavel2000@ngs.ru>
Sun, 10 Dec 2017 20:28:49 +0000
(
03:28
+0700)
Check for 'recv(...) == 0' condition was missing.
src/memcached.c
patch
|
blob
|
history
diff --git
a/src/memcached.c
b/src/memcached.c
index
1cd5a30
..
d2827a4
100644
(file)
--- a/
src/memcached.c
+++ b/
src/memcached.c
@@
-291,6
+291,12
@@
static int memcached_query_daemon(char *buffer, size_t buffer_size,
close(st->fd);
st->fd = -1;
return -1;
+ } else if (status == 0) {
+ ERROR("memcached plugin: Instance \"%s\": Connection closed by peer",
+ st->name);
+ close(st->fd);
+ st->fd = -1;
+ return -1;
}
buffer_fill += (size_t)status;