Skip to content

Commit

Permalink
Re-try the writing on EAGAIN.
Browse files Browse the repository at this point in the history
As the UDP sockets were moved to non blocking, sendto() may generate EAGAIN if the prev write operation was not yet completed by the stack.
  • Loading branch information
bogdan-iancu authored and razvancrainea committed Sep 11, 2015
1 parent c1c277a commit cb18eb6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/proto_udp/proto_udp.c
Expand Up @@ -213,7 +213,7 @@ static int proto_udp_send(struct socket_info* source,
if (n==-1){
LM_ERR("sendto(sock,%p,%d,0,%p,%d): %s(%d)\n", buf,len,to,tolen,
strerror(errno),errno);
if (errno==EINTR) goto again;
if (errno==EINTR || errno==EAGAIN) goto again;
if (errno==EINVAL) {
LM_CRIT("invalid sendtoparameters\n"
"one possible reason is the server is bound to localhost and\n"
Expand Down

0 comments on commit cb18eb6

Please sign in to comment.