History

Merge commit '6ee1cb5740e7490151db7dcec7e20ceaf8a2fe1f'

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

Michael Niedermayer committed 12 years ago

Commit 08a110c2 parents 215db29 6ee1cb54 files · +8 −4Browse files

Unified · Split

4 files
  1. libavformat/network.h +4 −0
  2. libavformat/sctp.c +2 −2
  3. libavformat/tcp.c +1 −1
  4. libavformat/unix.c +1 −1
libavformat/network.h+4−0
@@ -111,6 +111,10 @@ struct sockaddr_storage { · 110 unmodified lines
111};111};
112#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */112#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
113 113
114#ifndef MSG_NOSIGNAL
115#define MSG_NOSIGNAL 0
116#endif
117
114#if !HAVE_STRUCT_ADDRINFO118#if !HAVE_STRUCT_ADDRINFO
115struct addrinfo {119struct addrinfo {
116 int ai_flags;120 int ai_flags;
libavformat/sctp.c+2−2
@@ -143,7 +143,7 @@ static int ff_sctp_send(int s, const void *msg, size_t len, · 142 unmodified lines
143 memcpy(CMSG_DATA(cmsg), sinfo, sizeof(struct sctp_sndrcvinfo));143 memcpy(CMSG_DATA(cmsg), sinfo, sizeof(struct sctp_sndrcvinfo));
144 }144 }
145 145
146 return sendmsg(s, &outmsg, flags);146 return sendmsg(s, &outmsg, flags | MSG_NOSIGNAL);
147}147}
148 148
149typedef struct SCTPContext {149typedef struct SCTPContext {
@@ -302,7 +302,7 @@ static int sctp_write(URLContext *h, const uint8_t *buf, int size) · 152 unmodified lines
302 }302 }
303 ret = ff_sctp_send(s->fd, buf + 2, size - 2, &info, MSG_EOR);303 ret = ff_sctp_send(s->fd, buf + 2, size - 2, &info, MSG_EOR);
304 } else304 } else
305 ret = send(s->fd, buf, size, 0);305 ret = send(s->fd, buf, size, MSG_NOSIGNAL);
306 306
307 return ret < 0 ? ff_neterrno() : ret;307 return ret < 0 ? ff_neterrno() : ret;
308}308}
libavformat/tcp.c+1−1
@@ -186,7 +186,7 @@ static int tcp_write(URLContext *h, const uint8_t *buf, int size) · 185 unmodified lines
186 if (ret)186 if (ret)
187 return ret;187 return ret;
188 }188 }
189 ret = send(s->fd, buf, size, 0);189 ret = send(s->fd, buf, size, MSG_NOSIGNAL);
190 return ret < 0 ? ff_neterrno() : ret;190 return ret < 0 ? ff_neterrno() : ret;
191}191}
192 192
libavformat/unix.c+1−1
@@ -123,7 +123,7 @@ static int unix_write(URLContext *h, const uint8_t *buf, int size) · 122 unmodified lines
123 if (ret < 0)123 if (ret < 0)
124 return ret;124 return ret;
125 }125 }
126 ret = send(s->fd, buf, size, 0);126 ret = send(s->fd, buf, size, MSG_NOSIGNAL);
127 return ret < 0 ? ff_neterrno() : ret;127 return ret < 0 ? ff_neterrno() : ret;
128}128}
129 129

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t