|
|
@ -745,6 +745,8 @@ json_t *json_rpc_call(connsock_t *cs, const char *rpc_req) |
|
|
|
double elapsed; |
|
|
|
double elapsed; |
|
|
|
int len, ret; |
|
|
|
int len, ret; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Serialise all calls in case we use cs from multiple threads */ |
|
|
|
|
|
|
|
cksem_wait(&cs->sem); |
|
|
|
if (unlikely(cs->fd < 0)) { |
|
|
|
if (unlikely(cs->fd < 0)) { |
|
|
|
LOGWARNING("FD %d invalid in %s", cs->fd, __func__); |
|
|
|
LOGWARNING("FD %d invalid in %s", cs->fd, __func__); |
|
|
|
goto out; |
|
|
|
goto out; |
|
|
@ -839,6 +841,7 @@ out_empty: |
|
|
|
out: |
|
|
|
out: |
|
|
|
free(http_req); |
|
|
|
free(http_req); |
|
|
|
dealloc(cs->buf); |
|
|
|
dealloc(cs->buf); |
|
|
|
|
|
|
|
cksem_post(&cs->sem); |
|
|
|
return val; |
|
|
|
return val; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|