aboutsummaryrefslogtreecommitdiffstats
path: root/net-p2p
diff options
context:
space:
mode:
authorrakuco <rakuco@FreeBSD.org>2013-01-09 00:59:02 +0800
committerrakuco <rakuco@FreeBSD.org>2013-01-09 00:59:02 +0800
commit7957a9aa44d0554bb17978a30275249eac6a3d2c (patch)
tree79ffac6e3ba3d09445432d47b38780c12ebc6b6d /net-p2p
parentdbaec5d08e19edbdc6f39a70a60e1fbc2360b668 (diff)
downloadfreebsd-ports-gnome-7957a9aa44d0554bb17978a30275249eac6a3d2c.tar.gz
freebsd-ports-gnome-7957a9aa44d0554bb17978a30275249eac6a3d2c.tar.zst
freebsd-ports-gnome-7957a9aa44d0554bb17978a30275249eac6a3d2c.zip
Add my upstream patch to fix problems establishing UDP connections.
KTorrent was unable to create any UDP connection (to Magnet or UDP trackers, for example) at all without this. Bump PORTREVISION. Approved by: makc (maintainer)
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/libktorrent/Makefile1
-rw-r--r--net-p2p/libktorrent/files/patch-src__net__serversocket.cpp40
2 files changed, 41 insertions, 0 deletions
diff --git a/net-p2p/libktorrent/Makefile b/net-p2p/libktorrent/Makefile
index be5a16e62095..c558d4dbbd82 100644
--- a/net-p2p/libktorrent/Makefile
+++ b/net-p2p/libktorrent/Makefile
@@ -2,6 +2,7 @@
PORTNAME= libktorrent
DISTVERSION= 1.3.0
+PORTREVISION= 1
CATEGORIES= net-p2p kde
MASTER_SITES= http://ktorrent.org/downloads/${DISTVERSION:C,^1,4,:C,-.*,,}/
diff --git a/net-p2p/libktorrent/files/patch-src__net__serversocket.cpp b/net-p2p/libktorrent/files/patch-src__net__serversocket.cpp
new file mode 100644
index 000000000000..7ca43adf20be
--- /dev/null
+++ b/net-p2p/libktorrent/files/patch-src__net__serversocket.cpp
@@ -0,0 +1,40 @@
+commit 881ef5274f281f52eab974a72e6c9a3c74157ead
+Author: Joris Guisson <joris.guisson@gmail.com>
+Date: Thu Jan 3 18:51:13 2013 +0100
+
+ Fix bug causing UDP connections not to get established on FreeBSD because FIONREAD returns the size of the data and the peer address
+
+ REVIEW: 108076
+
+diff --git a/src/net/serversocket.cpp b/src/net/serversocket.cpp
+index 5d39433..399b4b1 100644
+--- ./src/net/serversocket.cpp
++++ ./src/net/serversocket.cpp
+@@ -133,9 +133,10 @@ namespace net
+ {
+ // The first packet may be 0 bytes in size
+ Buffer::Ptr buf = d->pool->get(ba < 1500 ? 1500 : ba);
+- if (d->sock->recvFrom(buf->get(), ba, addr) == (int)ba && ba > 0)
++ int bytes_read = d->sock->recvFrom(buf->get(), ba, addr);
++ if (bytes_read <= (int)ba && ba > 0)
+ {
+- buf->setSize(ba);
++ buf->setSize(bytes_read);
+ d->dhandler->dataReceived(buf, addr);
+ }
+ first = false;
+@@ -154,7 +155,6 @@ namespace net
+ d->rsn->setEnabled(on);
+ }
+
+-
+ void ServerSocket::readyToWrite(int)
+ {
+ d->dhandler->readyToWrite(this);
+@@ -186,6 +186,5 @@ namespace net
+ return false;
+ }
+
+-
+ }
+