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
111111 };
112112 #endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
113113
114+#ifndef MSG_NOSIGNAL
115+#define MSG_NOSIGNAL 0
116+#endif
117+
114118 #if !HAVE_STRUCT_ADDRINFO
115119 struct addrinfo {
116120 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
143143 memcpy(CMSG_DATA(cmsg), sinfo, sizeof(struct sctp_sndrcvinfo));
144144 }
145145
146− return sendmsg(s, &outmsg, flags);
146+ return sendmsg(s, &outmsg, flags | MSG_NOSIGNAL);
147147 }
148148
149149 typedef struct SCTPContext {
@@ -302,7 +302,7 @@ static int sctp_write(URLContext *h, const uint8_t *buf, int size) · 152 unmodified lines
302302 }
303303 ret = ff_sctp_send(s->fd, buf + 2, size - 2, &info, MSG_EOR);
304304 } else
305− ret = send(s->fd, buf, size, 0);
305+ ret = send(s->fd, buf, size, MSG_NOSIGNAL);
306306
307307 return ret < 0 ? ff_neterrno() : ret;
308308 }
libavformat/tcp.c+1−1
@@ -186,7 +186,7 @@ static int tcp_write(URLContext *h, const uint8_t *buf, int size) · 185 unmodified lines
186186 if (ret)
187187 return ret;
188188 }
189− ret = send(s->fd, buf, size, 0);
189+ ret = send(s->fd, buf, size, MSG_NOSIGNAL);
190190 return ret < 0 ? ff_neterrno() : ret;
191191 }
192192
libavformat/unix.c+1−1
@@ -123,7 +123,7 @@ static int unix_write(URLContext *h, const uint8_t *buf, int size) · 122 unmodified lines
123123 if (ret < 0)
124124 return ret;
125125 }
126− ret = send(s->fd, buf, size, 0);
126+ ret = send(s->fd, buf, size, MSG_NOSIGNAL);
127127 return ret < 0 ? ff_neterrno() : ret;
128128 }
129129

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