Skip to content

Commit

Permalink
event_xmlrpc: only retry send/recv a couple of times if there are errors
Browse files Browse the repository at this point in the history
Credits go to Joseph Frazier (onsip) for spotting this
  • Loading branch information
razvancrainea committed Jun 2, 2015
1 parent 008b423 commit 05bc754
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/event_xmlrpc/xmlrpc_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ int xmlrpc_send(xmlrpc_send_t* xmlrpcs)

do {
rc = write(xmlrpc_pipe[1], &xmlrpcs, sizeof(xmlrpc_send_t *));
} while ((rc < 0 && (IS_ERR(EINTR)||IS_ERR(EAGAIN)||IS_ERR(EWOULDBLOCK)))
|| retries-- > 0);
} while (rc < 0 && (IS_ERR(EINTR) || retries-- > 0));

if (rc < 0) {
LM_ERR("unable to send xmlrpc send struct to worker\n");
Expand All @@ -114,7 +113,7 @@ static xmlrpc_send_t * xmlrpc_receive(void)

do {
rc = read(xmlrpc_pipe[0], &recv, sizeof(xmlrpc_send_t*));
} while ((rc < 0 && IS_ERR(EINTR)) || retries-- > 0);
} while (rc < 0 && (IS_ERR(EINTR) || retries-- > 0));

if (rc < 0) {
LM_ERR("cannot receive send param\n");
Expand Down

0 comments on commit 05bc754

Please sign in to comment.