Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49776 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85012 invoked from network); 21 Sep 2010 06:14:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Sep 2010 06:14:30 -0000 Authentication-Results: pb1.pair.com header.from=jorrit@wafel.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jorrit@wafel.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain wafel.org from 212.29.160.232 cause and error) X-PHP-List-Original-Sender: jorrit@wafel.org X-Host-Fingerprint: 212.29.160.232 smtp1.infopact.nl Received: from [212.29.160.232] ([212.29.160.232:53337] helo=mc-smtp1.infopact.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 88/01-08711-44D489C4 for ; Tue, 21 Sep 2010 02:14:29 -0400 Received: from [192.168.127.100] (wafel.org [82.210.98.66]) by mc-smtp1.infopact.nl (8.14.3/8.14.3) with ESMTP id o8L6DrgX001156; Tue, 21 Sep 2010 08:13:55 +0200 Message-ID: <4C984D20.7030304@wafel.org> Date: Tue, 21 Sep 2010 08:13:52 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.11pre) Gecko/20100917 Shredder/3.1.5pre MIME-Version: 1.0 To: Chris Stockton CC: Michael Maclean , internals@lists.php.net References: <4C97BA1B.8070601@wafel.org> <4C97CF70.6080701@php.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.96.1 at mc-smtp1 X-Virus-Status: Clean Subject: Re: [PHP-DEV] [PATCH] Allowing an array as a parameter for snmpget()/snmpgetnext() From: jorrit@wafel.org (Jorrit Kronjee) On 09/21/2010 01:36 AM, Chris Stockton wrote: > Hello, > > On Mon, Sep 20, 2010 at 2:17 PM, Michael Maclean wrote: >> On 20/09/10 20:46, Jorrit Kronjee wrote: >>> Dear list, >>> >>> To better reflect the behavior of the snmpget command that comes with >>> the Net-SNMP package the patch attached makes an array of OIDs as a >>> parameter for the snmpget()/snmpgetnext() function possible. >> >> >> Looks good to me, for what it's worth. Anyone got objections? >> > I think the patch at a first glance looks good, although it is a minor > cosmetic nitpick, I did catch a line with a couple of extra > semi-colons. > > static void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st) > { > - char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; > - int a1_len, a2_len, a3_len, a4_len, a5_len, a6_len, a7_len, a8_len; > + char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;; > + int a1_len, a2_len, a3_len, a4_len, a5_len, a6_len, a7_len, a8_len;; > > This patch does move around a bit of code, are there some tests to go > along with this patch? > > -Chris Chris, Ouch, I forgot to remove those extra semicolons. Thanks for noticing. What kind of tests are you looking for? I did run a couple of tests against my own SNMP devices to check for regressions, like: oldphp -r 'print_r(snmpget($host, $community, $oid))' newphp -r 'print_r(snmpget($host, $community, $oid))' I also noticed that the tests/ directory for snmp was empty, otherwise I would've run and extended some of those. Shall I just write a couple and include that in a new patch? Regards, Jorrit Kronjee