<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thanks, I fired a PR in libdsm<div class=""><br class=""></div><div class=""><a href="https://github.com/videolabs/libdsm/issues/141" class="">https://github.com/videolabs/libdsm/issues/141</a><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">2020年2月21日 下午5:54,Thomas Guillem <thomas@gllm.fr> 写道:</div><br class="Apple-interchange-newline"><div class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">On Fri, Feb 21, 2020, at 08:33, Janboe Ye wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">From 16540219ff8416395bd7994a6bb2fa9c5ab9984f Mon Sep 17 00:00:00 2001<br class="">From: Janboe Ye <<a href="mailto:janboe.ye@gmail.com" class="">janboe.ye@gmail.com</a>><br class="">Date: Fri, 21 Feb 2020 15:25:22 +0800<br class="">Subject: [PATCH] fix sigpipe crash and recover when bad network<br class=""><br class="">dsm will send sigpipe when bad network conditional and crash app.<br class="">This will disable sigpipe and recovery after writing failure<br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Hello, you should do a PR on the libdsm project page instead:<span class="Apple-converted-space"> </span></span><a href="https://github.com/videolabs/libdsm/" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://github.com/videolabs/libdsm/</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class="">Signed-off-by: Janboe Ye <janboe.ye@gmail.com><br class="">---<br class="">.../0001-setsockopt-to-disable-sigpipe.patch  | 35 +++++++++++++++++++<br class="">contrib/src/libdsm/rules.mak                  |  1 +<br class="">modules/stream_filter/prefetch.c              |  6 ++--<br class="">3 files changed, 39 insertions(+), 3 deletions(-)<br class="">create mode 100644 contrib/src/libdsm/0001-setsockopt-to-disable-sigpipe.patch<br class=""><br class="">diff --git<span class="Apple-converted-space"> </span><br class="">a/contrib/src/libdsm/0001-setsockopt-to-disable-sigpipe.patch<span class="Apple-converted-space"> </span><br class="">b/contrib/src/libdsm/0001-setsockopt-to-disable-sigpipe.patch<br class="">new file mode 100644<br class="">index 0000000000..107c5f3f64<br class="">--- /dev/null<br class="">+++ b/contrib/src/libdsm/0001-setsockopt-to-disable-sigpipe.patch<br class="">@@ -0,0 +1,35 @@<br class="">+From b53b1242323c715cee018ac189b9863eccd95240 Mon Sep 17 00:00:00 2001<br class="">+From: Janboe Ye <janboe.ye@gmail.com><br class="">+Date: Fri, 21 Feb 2020 15:14:32 +0800<br class="">+Subject: [PATCH] setsockopt to disable sigpipe<br class="">+<br class="">+this signal will crash app when network goes wrong<br class="">+<br class="">+Signed-off-by: Janboe Ye <janboe.ye@gmail.com><br class="">+---<br class="">+ src/netbios_session.c | 7 +++++++<br class="">+ 1 file changed, 7 insertions(+)<br class="">+<br class="">+diff --git a/src/netbios_session.c b/src/netbios_session.c<br class="">+index a77cbc7..7ae4dd0 100644<br class="">+--- a/src/netbios_session.c<br class="">++++ b/src/netbios_session.c<br class="">+@@ -54,8 +54,15 @@<br class="">+<span class="Apple-converted-space"> </span><br class="">+ static int open_socket_and_connect(netbios_session *s)<br class="">+ {<br class="">++    int optval = 0;<br class="">+     if ((s->socket = socket(AF_INET, SOCK_STREAM, 0)) < 0)<br class="">+         goto error;<br class="">++<br class="">++    //Never generate SIGPIPE on broken write<br class="">++    optval = 1;<br class="">++    if (setsockopt(s->socket, SOL_SOCKET, SO_NOSIGPIPE, (void<span class="Apple-converted-space"> </span><br class="">*)&optval, sizeof(int)))<br class="">++        goto error;<br class="">++<br class="">+     if (connect(s->socket, (struct sockaddr *)&s->remote_addr,<span class="Apple-converted-space"> </span><br class="">sizeof(s->remote_addr)) <0)<br class="">+         goto error;<br class="">+<span class="Apple-converted-space"> </span><br class="">+--<span class="Apple-converted-space"> </span><br class="">+2.23.0<br class="">+<br class="">diff --git a/contrib/src/libdsm/rules.mak b/contrib/src/libdsm/rules.mak<br class="">index 1ea9b769b5..e7b9181865 100644<br class="">--- a/contrib/src/libdsm/rules.mak<br class="">+++ b/contrib/src/libdsm/rules.mak<br class="">@@ -24,6 +24,7 @@ libdsm: libdsm-$(LIBDSM_VERSION).tar.gz .sum-libdsm<br class=""><span class="Apple-tab-span" style="white-space: pre;">    </span>$(APPLY) $(SRC)/libdsm/fix-pc-generation.patch<br class=""><span class="Apple-tab-span" style="white-space: pre;">       </span>$(APPLY) $(SRC)/libdsm/fix-pipe-compat.patch<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>$(APPLY)<span class="Apple-converted-space"> </span><br class="">$(SRC)/libdsm/0001-compat-Don-t-use-_pipe-when-building-for-winstore.patch<br class="">+<span class="Apple-tab-span" style="white-space: pre;">  </span>$(APPLY) $(SRC)/libdsm/0001-setsockopt-to-disable-sigpipe.patch<br class=""><span class="Apple-tab-span" style="white-space: pre;">      </span>$(MOVE)<br class=""><br class="">DEPS_libdsm = libtasn1 iconv<br class="">diff --git a/modules/stream_filter/prefetch.c b/modules/stream_filter/prefetch.c<br class="">index a31f52c67f..1ae63094ea 100644<br class="">--- a/modules/stream_filter/prefetch.c<br class="">+++ b/modules/stream_filter/prefetch.c<br class="">@@ -238,13 +238,13 @@ static void *Thread(void *data)<br class="">           len = sys->buffer_size - offset;<br class=""><br class="">       ssize_t val = ThreadRead(stream, sys->buffer + offset, len);<br class="">-        if (val < 0)<br class="">-            continue;<br class="">-        if (val == 0)<br class="">+<br class="">+        if (val <= 0)<br class="">       {<br class="">           assert(len > 0);<br class="">           msg_Dbg(stream, "end of stream");<br class="">           sys->eof = true;<br class="">+            val = 0;<br class="">       }<br class=""><br class="">       assert((size_t)val <= len);<br class="">--<span class="Apple-converted-space"> </span><br class="">2.23.0<br class=""><br class=""><br class="">_______________________________________________<br class="">vlc-devel mailing list<br class="">To unsubscribe or modify your subscription options:<br class="">https://mailman.videolan.org/listinfo/vlc-devel<br class=""></blockquote><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">vlc-devel mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">To unsubscribe or modify your subscription options:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="https://mailman.videolan.org/listinfo/vlc-devel" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mailman.videolan.org/listinfo/vlc-devel</a></div></blockquote></div><br class=""></div></body></html>