On Wed, Mar 06, 2019 at 04:09:23PM +0100, Jeremie Courreges-Anglas wrote:
> On Wed, Mar 06 2019, Stuart Henderson <s...@spacehopper.org> wrote:
> > On 2019/03/06 13:31, Mikolaj Kucharski wrote:
> >> Ping.
> >
> > After 2 days? Really?!
> 
> +1

Yeah, sorry. That was way to soon. I understand everyone is busy and
couple of days it's not enough time to get feedback.
 
> >> On Mon, Mar 04, 2019 at 01:09:11PM +0000, Mikolaj Kucharski wrote:
> >> > Hi,
> >> > 
> >> > I've put most of the details in
> >> > 
> >> >  https://github.com/lavv17/lftp/issues/511
> >> > 
> >> > but basically this avoids segfault which I triggered by accident.
> >> > Patch is accepted by upstream and already merged.
> 
> The commit is
> 
>   
> https://github.com/lavv17/lftp/commit/66426abe60ef0f8a1be905f171b1281c6b59d138
> 
> which apparently fixes your problem. It does not include the hunk below...

Yeah that hunk below is 1f22423244c3867fec745cf0c04cd636e10970a2 and
it's commit message is a bit confusing, as it's not error handling
but just a log message, to understand better that something went wrong.

> >> > +--- src/Torrent.cc.orig
> >> > ++++ src/Torrent.cc
> >> > +@@ -3830,7 +3830,8 @@ int TorrentListener::Do()
> >> > +       }
> >> > +    bound:
> >> > +       if(type==SOCK_STREAM)
> >> > +-        listen(sock,5);
> >> > ++        if(listen(sock,5) < 0)
> >> > ++             LogError(0,"listen failed: %s", strerror(errno));
> 
> ... this may be an improvement but the code that follows still looks
> incorrect in the failure case, so I'm reluctant to include it in the
> ports tree.  Thoughts?

Sure, I can drop it. That change is from upstream. I didn't consider it
as a more work for future work on the port and doesn't seem risky change
in terms of stability of the app, but may help to understand that
something doesn't work within the app. Anyway. Updated diff below, with
only change which I found helpful to me.


Index: Makefile
===================================================================
RCS file: /cvs/ports/net/lftp/Makefile,v
retrieving revision 1.123
diff -u -p -u -r1.123 Makefile
--- Makefile    24 Oct 2018 14:28:08 -0000      1.123
+++ Makefile    6 Mar 2019 15:44:57 -0000
@@ -4,7 +4,7 @@ COMMENT=        shell-like command line ftp and
 
 DISTNAME=      lftp-4.8.4
 CATEGORIES=    net
-REVISION=      0
+REVISION=      1
 
 HOMEPAGE=      https://lftp.tech/
 
Index: patches/patch-doc_lftp_1
===================================================================
RCS file: /cvs/ports/net/lftp/patches/patch-doc_lftp_1,v
retrieving revision 1.3
diff -u -p -u -r1.3 patch-doc_lftp_1
--- patches/patch-doc_lftp_1    13 Aug 2018 14:36:41 -0000      1.3
+++ patches/patch-doc_lftp_1    6 Mar 2019 15:44:57 -0000
@@ -1,5 +1,8 @@
 $OpenBSD: patch-doc_lftp_1,v 1.3 2018/08/13 14:36:41 rsadowski Exp $
 
+- avoid information loss in both groff and mandoc
+  upstream commit 57b7098a4e0a7d3e7609ef3b2fb00b500df7a060
+
 Index: doc/lftp.1
 --- doc/lftp.1.orig
 +++ doc/lftp.1
Index: patches/patch-src_Torrent_cc
===================================================================
RCS file: patches/patch-src_Torrent_cc
diff -N patches/patch-src_Torrent_cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_Torrent_cc        6 Mar 2019 15:44:57 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+- In MaySendUDP() handle case when socket may not be available yet
+  Upstream commit 66426abe60ef0f8a1be905f171b1281c6b59d138
+
+Index: src/Torrent.cc
+--- src/Torrent.cc.orig
++++ src/Torrent.cc
+@@ -3904,6 +3905,8 @@ bool TorrentListener::MaySendUDP()
+       last_sent_udp_count=0;
+       last_sent_udp=now;
+    }
++   if (sock==-1)
++      return false;
+    // check if output buffer is available
+    struct pollfd pfd;
+    pfd.fd=sock;

-- 
Regards,
 Mikolaj

Reply via email to