svn commit: r540385 - in head/net-p2p/ctorrent: . files
Dirk Meyer
dinoex at FreeBSD.org
Thu Jun 25 11:33:35 UTC 2020
Author: dinoex
Date: Thu Jun 25 11:33:34 2020
New Revision: 540385
URL: https://svnweb.freebsd.org/changeset/ports/540385
Log:
- fix empty announce list
- fix empty path
PR: 247376
Submitted by: Alexey Dokuchaev
Obtained from: Gentoo
- fix mutiple peers behind same IP
Obtained from: Timothy Palpant
Added:
head/net-p2p/ctorrent/files/patch-btcontent.cpp (contents, props changed)
head/net-p2p/ctorrent/files/patch-empty-path (contents, props changed)
head/net-p2p/ctorrent/files/patch-peer.cpp (contents, props changed)
Modified:
head/net-p2p/ctorrent/Makefile
Modified: head/net-p2p/ctorrent/Makefile
==============================================================================
--- head/net-p2p/ctorrent/Makefile Thu Jun 25 11:18:59 2020 (r540384)
+++ head/net-p2p/ctorrent/Makefile Thu Jun 25 11:33:34 2020 (r540385)
@@ -3,7 +3,7 @@
PORTNAME= ctorrent
PORTVERSION= 3.3.2
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= net-p2p
MASTER_SITES= SF/dtorrent/dtorrent/${PORTVERSION} \
http://www.rahul.net/dholmes/ctorrent/
Added: head/net-p2p/ctorrent/files/patch-btcontent.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-p2p/ctorrent/files/patch-btcontent.cpp Thu Jun 25 11:33:34 2020 (r540385)
@@ -0,0 +1,25 @@
+--- btcontent.cpp.orig 2008-06-15 00:00:19 UTC
++++ btcontent.cpp
+@@ -283,11 +283,12 @@ int btContent::InitialFromMI(const char *metainfo_fnam
+ if ( !b ) return -1;
+
+ // announce
+- if( !meta_str("announce",&s,&r) ) ERR_RETURN();
++ if( meta_str("announce",&s,&r) ) {
+ if( r > MAXPATHLEN ) ERR_RETURN();
+ m_announce = new char [r + 1];
+ memcpy(m_announce, s, r);
+ m_announce[r] = '\0';
++ }
+
+ // announce-list
+ if( r = meta_pos("announce-list") ){
+@@ -303,7 +304,7 @@ int btContent::InitialFromMI(const char *metainfo_fnam
+ if( !(q = buf_str(b+r, alend-r, &sptr, &slen)) )
+ break; // next list
+ r += q;
+- if( strncasecmp(m_announce, sptr, slen) ){
++ if( !m_announce || strncasecmp(m_announce, sptr, slen) ){
+ m_announcelist[n] = new char[slen+1];
+ memcpy(m_announcelist[n], sptr, slen);
+ (m_announcelist[n])[slen] = '\0';
Added: head/net-p2p/ctorrent/files/patch-empty-path
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-p2p/ctorrent/files/patch-empty-path Thu Jun 25 11:33:34 2020 (r540385)
@@ -0,0 +1,12 @@
+--- bencode.cpp.orig
++++ bencode.cpp
+@@ -258,7 +258,8 @@
+ n -= r;
+ if( 'e' == *pb ) break;
+ if( pathname >= endmax ) return 0;
+- *pathname++ = PATH_SP;
++ if (q)
++ *pathname++ = PATH_SP;
+ }
+ *pathname = '\0';
+ return (pb - b + 1);
Added: head/net-p2p/ctorrent/files/patch-peer.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-p2p/ctorrent/files/patch-peer.cpp Thu Jun 25 11:33:34 2020 (r540385)
@@ -0,0 +1,12 @@
+--- peer.cpp.orig 2008-06-15 00:00:19 UTC
++++ peer.cpp
+@@ -66,7 +66,8 @@ int btBasic::IpEquiv(struct sockaddr_in addr)
+ // CONSOLE.Debug_n("IpEquiv: %s <=> ", inet_ntoa(m_sin.sin_addr));
+ // CONSOLE.Debug_n("%s", inet_ntoa(addr.sin_addr));
+ // CONSOLE.Debug_n("");
+- return (memcmp(&m_sin.sin_addr,&addr.sin_addr,sizeof(struct in_addr)) == 0) ?
++ return ((memcmp(&m_sin.sin_addr,&addr.sin_addr,sizeof(struct in_addr)) == 0)
++ && m_sin.sin_port == addr.sin_port) ?
+ 1 : 0;
+ }
+
More information about the svn-ports-all
mailing list