From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Aug 17 19:00:23 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B295E106566B for ; Fri, 17 Aug 2012 19:00:23 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A07D48FC14 for ; Fri, 17 Aug 2012 19:00:18 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q7HJ0IRI086815 for ; Fri, 17 Aug 2012 19:00:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q7HJ0IdL086811; Fri, 17 Aug 2012 19:00:18 GMT (envelope-from gnats) Resent-Date: Fri, 17 Aug 2012 19:00:18 GMT Resent-Message-Id: <201208171900.q7HJ0IdL086811@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Martin Matuska Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F63A106566B; Fri, 17 Aug 2012 18:50:20 +0000 (UTC) (envelope-from mm@neo.vx.sk) Received: from neo.vx.sk (neo.vx.sk [176.9.47.205]) by mx1.freebsd.org (Postfix) with ESMTP id 325798FC14; Fri, 17 Aug 2012 18:50:20 +0000 (UTC) Received: by neo.vx.sk (Postfix, from userid 1001) id 10C469360; Fri, 17 Aug 2012 20:40:37 +0200 (CEST) Message-Id: <20120817184037.10C469360@neo.vx.sk> Date: Fri, 17 Aug 2012 20:40:37 +0200 (CEST) From: Martin Matuska To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: wen@FreeBSD.org Subject: ports/170709: [PATCH] dns/pear-Net_DNS2: fix upstream bug #19569 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Aug 2012 19:00:23 -0000 >Number: 170709 >Category: ports >Synopsis: [PATCH] dns/pear-Net_DNS2: fix upstream bug #19569 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Aug 17 19:00:18 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Martin Matuska >Release: FreeBSD 9.0-STABLE amd64 >Organization: >Environment: System: FreeBSD neo.vx.sk 9.0-STABLE FreeBSD 9.0-STABLE #6 r237147M: Sat Jun 16 01:05:38 CEST >Description: Fix upstream bug #19569 References: http://pear.php.net/bugs/bug.php?id=19569 Added file(s): - files/patch-Net-DNS2-Socket-Streams.php Port maintainer (wen@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: CVS) >How-To-Repeat: >Fix: --- pear-Net_DNS2-1.2.2.patch begins here --- Index: files/patch-Net-DNS2-Socket-Streams.php =================================================================== RCS file: files/patch-Net-DNS2-Socket-Streams.php diff -N files/patch-Net-DNS2-Socket-Streams.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-Net-DNS2-Socket-Streams.php 17 Aug 2012 18:39:40 -0000 @@ -0,0 +1,68 @@ +Index: Net/DNS2/Socket/Streams.php +=================================================================== +--- Net/DNS2/Socket/Streams.php (revision 164) ++++ Net/DNS2/Socket/Streams.php (revision 165) +@@ -329,27 +329,51 @@ + // + // read the data from the socket + // +- $chunk = ''; +- $chunk_size = $length; + $data = ''; + + // +- // loop so we make sure we read all the data ++ // the streams socket is weird for TCP sockets; it doesn't seem to always ++ // return all the data properly; but the looping code I added broke UDP ++ // packets- my fault- + // +- while (1) { ++ // the sockets library works much better. ++ // ++ if ($this->type == SOCK_STREAM) { + +- $chunk = fread($this->sock, $chunk_size); +- if ($chunk === false) { ++ $chunk = ''; ++ $chunk_size = $length; ++ ++ // ++ // loop so we make sure we read all the data ++ // ++ while (1) { ++ ++ $chunk = fread($this->sock, $chunk_size); ++ if ($chunk === false) { + +- $this->last_error = 'failed on fread() for data'; +- return false; ++ $this->last_error = 'failed on fread() for data'; ++ return false; ++ } ++ ++ $data .= $chunk; ++ $chunk_size -= strlen($chunk); ++ ++ if (strlen($data) >= $length) { ++ break; ++ } + } + +- $data .= $chunk; +- $chunk_size -= strlen($chunk); ++ // ++ // if it's UDP, ti's a single fixed-size frame, and the streams library ++ // doesn't seem to have a problem reading it. ++ // ++ } else { + +- if (strlen($data) >= $length) { +- break; ++ $data = fread($this->sock, $length); ++ if ($length === false) { ++ ++ $this->last_error = 'failed on fread() for data'; ++ return false; + } + } + --- pear-Net_DNS2-1.2.2.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: