diff --git a/.travis.yml b/.travis.yml index 9bddb02..596e2fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,6 @@ before_install: script: - ./configure - make -j8 - - make check + - make check -j8 notifications: email: false diff --git a/lib/searpc-named-pipe-transport.c b/lib/searpc-named-pipe-transport.c index 23d1c2a..8726f5b 100644 --- a/lib/searpc-named-pipe-transport.c +++ b/lib/searpc-named-pipe-transport.c @@ -220,11 +220,17 @@ static void* named_pipe_client_handler(void *arg) g_debug ("start to serve on pipe client\n"); while (1) { + len = 0; if (pipe_read_n(connfd, &len, sizeof(uint32_t)) < 0) { g_warning("failed to read rpc request size: %s", strerror(errno)); break; } + if (len == 0) { + g_debug("EOF reached, pipe connection lost"); + break; + } + while (bufsize < len) { bufsize *= 2; buf = realloc(buf, bufsize); diff --git a/tests/searpc.c b/tests/searpc.c index 28d1a3e..65df0a0 100644 --- a/tests/searpc.c +++ b/tests/searpc.c @@ -370,7 +370,6 @@ test_searpc__pipe_simple_call (void) g_free (result); /* error should return */ - result = NULL; result = searpc_client_call__string (client_with_pipe_transport, "get_substring", &error, 2, "string", "hello", "int", 10); cl_assert (error->message);