1
0
mirror of https://github.com/haiwen/libsearpc.git synced 2025-08-10 08:51:34 +00:00

Merge pull request #35 from haiwen/revert-30-patch-1

Revert "Fix variable types and pointer sizes"
This commit is contained in:
Jiaqiang Xu 2018-11-15 14:29:41 +08:00 committed by GitHub
commit d19a3d1a2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,7 +221,7 @@ static void* named_pipe_client_handler(void *arg)
while (1) { while (1) {
len = 0; len = 0;
if (pipe_read_n(connfd, &len, sizeof(size_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;
} }
@ -252,7 +252,7 @@ static void* named_pipe_client_handler(void *arg)
g_free (service); g_free (service);
g_free (body); g_free (body);
if (pipe_write_n(connfd, &ret_len, sizeof(size_t)) < 0) { if (pipe_write_n(connfd, &ret_len, sizeof(uint32_t)) < 0) {
g_warning("failed to send rpc response(%s): %s", ret_str, strerror(errno)); g_warning("failed to send rpc response(%s): %s", ret_str, strerror(errno));
g_free (ret_str); g_free (ret_str);
break; break;
@ -346,8 +346,8 @@ char *searpc_named_pipe_send(void *arg, const gchar *fcall_str,
char *json_str = request_to_json(data->service, fcall_str, fcall_len); char *json_str = request_to_json(data->service, fcall_str, fcall_len);
size_t json_len = strlen(json_str); size_t json_len = strlen(json_str);
size_t len = json_len; uint32_t len = json_len;
if (pipe_write_n(client->pipe_fd, &len, sizeof(size_t)) < 0) { if (pipe_write_n(client->pipe_fd, &len, sizeof(uint32_t)) < 0) {
g_warning("failed to send rpc call: %s", strerror(errno)); g_warning("failed to send rpc call: %s", strerror(errno));
free (json_str); free (json_str);
return NULL; return NULL;
@ -361,7 +361,7 @@ char *searpc_named_pipe_send(void *arg, const gchar *fcall_str,
free (json_str); free (json_str);
if (pipe_read_n(client->pipe_fd, &len, sizeof(size_t)) < 0) { if (pipe_read_n(client->pipe_fd, &len, sizeof(uint32_t)) < 0) {
g_warning("failed to read rpc response: %s", strerror(errno)); g_warning("failed to read rpc response: %s", strerror(errno));
return NULL; return NULL;
} }