mirror of
https://github.com/haiwen/libsearpc.git
synced 2025-09-19 17:25:06 +00:00
Fixed a bug in named pipe transport.
This commit is contained in:
@@ -13,6 +13,6 @@ before_install:
|
|||||||
script:
|
script:
|
||||||
- ./configure
|
- ./configure
|
||||||
- make -j8
|
- make -j8
|
||||||
- make check
|
- make check -j8
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
@@ -220,11 +220,17 @@ static void* named_pipe_client_handler(void *arg)
|
|||||||
g_debug ("start to serve on pipe client\n");
|
g_debug ("start to serve on pipe client\n");
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
len = 0;
|
||||||
if (pipe_read_n(connfd, &len, sizeof(uint32_t)) < 0) {
|
if (pipe_read_n(connfd, &len, sizeof(uint32_t)) < 0) {
|
||||||
g_warning("failed to read rpc request size: %s", strerror(errno));
|
g_warning("failed to read rpc request size: %s", strerror(errno));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (len == 0) {
|
||||||
|
g_debug("EOF reached, pipe connection lost");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
while (bufsize < len) {
|
while (bufsize < len) {
|
||||||
bufsize *= 2;
|
bufsize *= 2;
|
||||||
buf = realloc(buf, bufsize);
|
buf = realloc(buf, bufsize);
|
||||||
|
@@ -370,7 +370,6 @@ test_searpc__pipe_simple_call (void)
|
|||||||
g_free (result);
|
g_free (result);
|
||||||
|
|
||||||
/* error should return */
|
/* error should return */
|
||||||
result = NULL;
|
|
||||||
result = searpc_client_call__string (client_with_pipe_transport, "get_substring", &error,
|
result = searpc_client_call__string (client_with_pipe_transport, "get_substring", &error,
|
||||||
2, "string", "hello", "int", 10);
|
2, "string", "hello", "int", 10);
|
||||||
cl_assert (error->message);
|
cl_assert (error->message);
|
||||||
|
Reference in New Issue
Block a user