Browse Source

Merge commit '6ee1cb5740e7490151db7dcec7e20ceaf8a2fe1f'

* commit '6ee1cb5740e7490151db7dcec7e20ceaf8a2fe1f':
  libavformat: use MSG_NOSIGNAL when applicable

Merged-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4
Michael Niedermayer 11 years ago
parent
commit
08a110ca87
4 changed files with 8 additions and 4 deletions
  1. +4
    -0
      libavformat/network.h
  2. +2
    -2
      libavformat/sctp.c
  3. +1
    -1
      libavformat/tcp.c
  4. +1
    -1
      libavformat/unix.c

+ 4
- 0
libavformat/network.h View File

@@ -111,6 +111,10 @@ struct sockaddr_storage {
};
#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */

#ifndef MSG_NOSIGNAL
#define MSG_NOSIGNAL 0
#endif

#if !HAVE_STRUCT_ADDRINFO
struct addrinfo {
int ai_flags;


+ 2
- 2
libavformat/sctp.c View File

@@ -143,7 +143,7 @@ static int ff_sctp_send(int s, const void *msg, size_t len,
memcpy(CMSG_DATA(cmsg), sinfo, sizeof(struct sctp_sndrcvinfo));
}

return sendmsg(s, &outmsg, flags);
return sendmsg(s, &outmsg, flags | MSG_NOSIGNAL);
}

typedef struct SCTPContext {
@@ -302,7 +302,7 @@ static int sctp_write(URLContext *h, const uint8_t *buf, int size)
}
ret = ff_sctp_send(s->fd, buf + 2, size - 2, &info, MSG_EOR);
} else
ret = send(s->fd, buf, size, 0);
ret = send(s->fd, buf, size, MSG_NOSIGNAL);

return ret < 0 ? ff_neterrno() : ret;
}


+ 1
- 1
libavformat/tcp.c View File

@@ -186,7 +186,7 @@ static int tcp_write(URLContext *h, const uint8_t *buf, int size)
if (ret)
return ret;
}
ret = send(s->fd, buf, size, 0);
ret = send(s->fd, buf, size, MSG_NOSIGNAL);
return ret < 0 ? ff_neterrno() : ret;
}



+ 1
- 1
libavformat/unix.c View File

@@ -123,7 +123,7 @@ static int unix_write(URLContext *h, const uint8_t *buf, int size)
if (ret < 0)
return ret;
}
ret = send(s->fd, buf, size, 0);
ret = send(s->fd, buf, size, MSG_NOSIGNAL);
return ret < 0 ? ff_neterrno() : ret;
}



Loading…
Cancel
Save