Date: Tue, 8 Jan 2013 16:59:03 +0000 (UTC) From: Raphael Kubo da Costa <rakuco@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r310104 - in head/net-p2p/libktorrent: . files Message-ID: <201301081659.r08Gx3J1034542@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rakuco Date: Tue Jan 8 16:59:02 2013 New Revision: 310104 URL: http://svnweb.freebsd.org/changeset/ports/310104 Log: 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) Added: head/net-p2p/libktorrent/files/ head/net-p2p/libktorrent/files/patch-src__net__serversocket.cpp (contents, props changed) Modified: head/net-p2p/libktorrent/Makefile Modified: head/net-p2p/libktorrent/Makefile ============================================================================== --- head/net-p2p/libktorrent/Makefile Tue Jan 8 16:59:00 2013 (r310103) +++ head/net-p2p/libktorrent/Makefile Tue Jan 8 16:59:02 2013 (r310104) @@ -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,-.*,,}/ Added: head/net-p2p/libktorrent/files/patch-src__net__serversocket.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-p2p/libktorrent/files/patch-src__net__serversocket.cpp Tue Jan 8 16:59:02 2013 (r310104) @@ -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; + } + +- + } +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301081659.r08Gx3J1034542>