Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31999 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62129 invoked by uid 1010); 31 Aug 2007 14:26:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 62114 invoked from network); 31 Aug 2007 14:26:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Aug 2007 14:26:49 -0000 Authentication-Results: pb1.pair.com header.from=buildsmart@daleenterprise.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=buildsmart@daleenterprise.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daleenterprise.com from 67.78.11.229 cause and error) X-PHP-List-Original-Sender: buildsmart@daleenterprise.com X-Host-Fingerprint: 67.78.11.229 daleenterprise.com Received: from [67.78.11.229] ([67.78.11.229:59986] helo=daleenterprise.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/46-22642-92528D64 for ; Fri, 31 Aug 2007 10:26:49 -0400 Received: from localhost (localhost [127.0.0.1]) by daleenterprise.com (Postfix) with ESMTP id 9D296226F35 for ; Fri, 31 Aug 2007 10:26:46 -0400 (EDT) Received: from daleenterprise.com ([127.0.0.1]) by localhost (daleenterprise.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 02390-01 for ; Fri, 31 Aug 2007 10:26:44 -0400 (EDT) Received: from [10.1.100.11] (relay.mustangrestomods.com [67.78.11.226]) by daleenterprise.com (Postfix) with ESMTP id 87891226F28 for ; Fri, 31 Aug 2007 10:26:34 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v752.2) Content-Transfer-Encoding: 7bit Message-ID: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: PHP Developers Mailing List Date: Fri, 31 Aug 2007 10:26:32 -0400 X-Pgp-Agent: GPGMail 1.1.2 (Tiger) X-Mailer: Apple Mail (2.752.2) MTA-Interface: amavisd-new-2.3.3 (2005-08-22) + Maia Mailguard 1.1.0 at daleenterprise.com X-Spam-Scanned: using SpamAssassin 3.1.7 (2006-10-05) at daleenterprise.com X-Virus-Scanned: using ClamAV 0.88.6 (2006-11-05) at daleenterprise.com Subject: pop3 patch From: buildsmart@daleenterprise.com (BuildSmart) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 A quick fix to get pop3 working in PHP6, there might be a better way but this solution seemed to work with the least amount of changes, tested in 4.3.10, 4.4.0, 5.1.6, 5.2.3 and 6.0.0-dev all of which worked. link: http://daleenterprise.com/pop3.diff diff file: diff -Naur ext/pop3.orig/pop3.c ext/pop3/pop3.c - --- ext/pop3.orig/pop3.c 2006-10-11 20:23:48.000000000 -0400 +++ ext/pop3/pop3.c 2007-08-31 10:21:21.000000000 -0400 @@ -1,8 +1,8 @@ /* +----------------------------------------------------------------------+ - - | PHP Version 4 | + | PHP Version 4, 5, 6 | +----------------------------------------------------------------------+ - - | Copyright (c) 1997-2004 The PHP Group | + | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -14,9 +14,10 @@ +----------------------------------------------------------------------+ | Authors: Marco Tabini | | Ilia Alshanetsky | + | Dale Walsh | +----------------------------------------------------------------------+ - - $Id: pop3.c,v 1.21 2006/10/12 00:23:48 iliaa Exp $ + $Id: pop3.c,v 1.22 2007/08/31 09:23:48 iliaa Exp $ */ #ifdef HAVE_CONFIG_H @@ -42,7 +43,7 @@ /* {{{ Internal macros */ - -#define POP3_VERSION "1.0.2" +#define POP3_VERSION "1.0.3" #define POP3_RESOURCE_NAME "POP3 Library Session" #define POP3_FETCH_SESSION(session, session_container) \ @@ -100,7 +101,11 @@ char buffer[2048]; size_t fetch_len; +#if PHP_MAJOR_VERSION > 4 + if (!php_stream_get_line(stream, ZSTR(buffer), sizeof(buffer) - 1, &fetch_len)) { +#else if (!php_stream_get_line(stream, buffer, sizeof(buffer) - 1, &fetch_len)) { +#endif php_error_docref(NULL TSRMLS_CC, E_ERROR, "I/O Error when receiving data from the server"); } @@ -583,7 +588,11 @@ do { zval *row; +#if PHP_MAJOR_VERSION > 4 + if (!php_stream_gets(stream, ZSTR(pop3_return_val), sizeof (pop3_return_val) - 1)) { +#else if (!php_stream_gets(stream, pop3_return_val, sizeof (pop3_return_val) - 1)) { +#endif php_error_docref(NULL TSRMLS_CC, E_WARNING, "POP3: Unable to retrieve message list"); zval_dtor(return_value); RETURN_FALSE; @@ -643,7 +652,11 @@ do { +#if PHP_MAJOR_VERSION > 4 + if (!php_stream_gets(stream, ZSTR(pop3_return_val), sizeof (pop3_return_val) - 1)) { +#else if (!php_stream_gets(stream, pop3_return_val, sizeof (pop3_return_val) - 1)) { +#endif php_error_docref(NULL TSRMLS_CC, E_WARNING, "POP3: Unable to retrieve message list"); zval_dtor(return_value); RETURN_FALSE; @@ -758,7 +771,11 @@ length = 0; do { +#if PHP_MAJOR_VERSION > 4 + if (!php_stream_get_line(stream, ZSTR(pop3_return_val), sizeof (pop3_return_val) - 1, &fetch_len)) { +#else if (!php_stream_get_line(stream, pop3_return_val, sizeof (pop3_return_val) - 1, &fetch_len)) { +#endif efree(result); php_error_docref(NULL TSRMLS_CC, E_WARNING, "POP3: I/O failure reading from server"); RETURN_FALSE; -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (Darwin) iD8DBQFG2CUZ0hzWbkf0eKgRAljEAKCWQLRmOxgDjx7RvxUiQQlMypHxQwCeMpuy UVPNfP/veKki0uZKlVodriQ= =c0Vr -----END PGP SIGNATURE-----