mirror of
https://github.com/haiwen/libsearpc.git
synced 2025-08-01 04:57:11 +00:00
Merge pull request #35 from haiwen/revert-30-patch-1
Revert "Fix variable types and pointer sizes"
This commit is contained in:
commit
d19a3d1a2c
@ -221,7 +221,7 @@ static void* named_pipe_client_handler(void *arg)
|
||||
|
||||
while (1) {
|
||||
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));
|
||||
break;
|
||||
}
|
||||
@ -252,7 +252,7 @@ static void* named_pipe_client_handler(void *arg)
|
||||
g_free (service);
|
||||
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_free (ret_str);
|
||||
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);
|
||||
size_t json_len = strlen(json_str);
|
||||
|
||||
size_t len = json_len;
|
||||
if (pipe_write_n(client->pipe_fd, &len, sizeof(size_t)) < 0) {
|
||||
uint32_t len = json_len;
|
||||
if (pipe_write_n(client->pipe_fd, &len, sizeof(uint32_t)) < 0) {
|
||||
g_warning("failed to send rpc call: %s", strerror(errno));
|
||||
free (json_str);
|
||||
return NULL;
|
||||
@ -361,7 +361,7 @@ char *searpc_named_pipe_send(void *arg, const gchar *fcall_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));
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user