Commit c217f497 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Turn cli write failuers into vtc_log(0) rather than asserts

parent 96d556a9
......@@ -33,6 +33,7 @@
#include <sys/socket.h>
#include <sys/resource.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <poll.h>
......@@ -96,9 +97,13 @@ varnish_ask_cli(const struct varnish *v, const char *cmd, char **repl)
if (cmd != NULL) {
vtc_dump(v->vl, 4, "CLI TX", cmd, -1);
i = write(v->cli_fd, cmd, strlen(cmd));
assert(i == strlen(cmd));
if (i != strlen(cmd))
vtc_log(v->vl, 0, "CLI write failed (%s) = %u %s",
cmd, errno, strerror(errno));
i = write(v->cli_fd, "\n", 1);
assert(i == 1);
if (i != 1)
vtc_log(v->vl, 0, "CLI write failed (%s) = %u %s",
cmd, errno, strerror(errno));
}
i = VCLI_ReadResult(v->cli_fd, &retval, &r, 30.0);
if (i != 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment