This queue is for tickets about the Danga-Socket CPAN distribution.

Report information
The Basics
Id:
72670
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
NML [...] cpan.org
Requestors:
nicolas.rochelemagne [...] cpanel.net
Cc:
AdminCc:

BugTracker
Severity:
Unimportant
Broken in:
(no value)
Fixed in:
1.62



From nicolas.rochelemagne@cpanel.net Wed Nov 23 13: 39:00 2011
CC: Nicolas Rochelemagne <nicolas.rochelemagne@cpanel.net>
X-Spam-Status: No, score=-6.225 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_SOFTFAIL=0.665, T_FRT_STOCK2=0.01] autolearn=ham
X-Mailer: git-send-email 1.7.7.1
X-Spam-Flag: NO
Message-ID: <1322073530-44497-1-git-send-email-nicolas.rochelemagne@cpanel.net>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Antiabuse: This header was added to track abuse, please include it with any abuse report
X-Antiabuse: Primary Hostname - mx1.cpanel.net
X-Antiabuse: Original Domain - rt.cpan.org
X-Antiabuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-Antiabuse: Sender Address Domain - cpanel.net
X-Spam-Score: -6.225
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 93580240E9E for <cpan-bug+Danga-Socket@hipster.bestpractical.com>; Wed, 23 Nov 2011 13:39:00 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TDm4uRyi-kYI for <cpan-bug+Danga-Socket@hipster.bestpractical.com>; Wed, 23 Nov 2011 13:38:59 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id D2F7C240E9B for <bug-Danga-Socket@rt.cpan.org>; Wed, 23 Nov 2011 13:38:58 -0500 (EST)
Received: (qmail 17444 invoked by uid 103); 23 Nov 2011 18:38:58 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 23 Nov 2011 18:38:58 -0000
Received: from mx1.cpanel.net (HELO mx1.cpanel.net) (208.74.121.68) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Wed, 23 Nov 2011 10:38:56 -0800
Received: from ng1.cptxoffice.net ([208.74.121.102]:28878 helo=localhost.localdomain) by mx1.cpanel.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77) (envelope-from <nicolas.rochelemagne@cpanel.net>) id 1RTHif-0006hL-Ja; Wed, 23 Nov 2011 12:38:53 -0600
Delivered-To: cpan-bug+Danga-Socket@hipster.bestpractical.com
Subject: [PATCH] simple optimization by caching pack
Return-Path: <nicolas.rochelemagne@cpanel.net>
X-RT-Mail-Extension: danga-socket
X-Original-To: cpan-bug+Danga-Socket@hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
Date: Wed, 23 Nov 2011 12:38:50 -0600
X-Spam-Level:
To: bug-Danga-Socket@rt.cpan.org
From: nicolas.rochelemagne@cpanel.net
X-RT-Original-Encoding: ascii
content-type: text/plain; charset="utf-8"
Content-Length: 919
From: Nicolas Rochelemagne <nicolas.rochelemagne@cpanel.net> --- lib/Danga/Socket.pm | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/lib/Danga/Socket.pm b/lib/Danga/Socket.pm index 9bebf54..8deeafc 100644 --- a/lib/Danga/Socket.pm +++ b/lib/Danga/Socket.pm @@ -139,6 +139,10 @@ use constant POLLERR => 8; use constant POLLHUP => 16; use constant POLLNVAL => 32; +# caching pack used by tcp_cork +use constant PACK_0 => pack("l", 0); +use constant PACK_1 => pack("l", 1); + our $HAVE_KQUEUE = eval { require IO::KQueue; 1 }; our ( @@ -813,7 +817,7 @@ sub tcp_cork { my $rv; if (TCP_CORK) { $rv = setsockopt($self->{sock}, IPPROTO_TCP, TCP_CORK, - pack("l", $val ? 1 : 0)); + $val ? PACK_0 : PACK_1); } else { # FIXME: implement freebsd *PUSH sockopts $rv = 1; -- 1.7.7.1
MIME-Version: 1.0
In-Reply-To: <1322073530-44497-1-git-send-email-nicolas.rochelemagne@cpanel.net>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <1322073530-44497-1-git-send-email-nicolas.rochelemagne@cpanel.net>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-18070-1333709985-87.72670-0-0@rt.cpan.org>
Content-Transfer-Encoding: binary
From: bitcard@miuku.net
X-RT-Original-Encoding: utf-8
Content-Length: 300
On Wed 23.Nov 2011 13:39:01, nicolas.rochelemagne@cpanel.net wrote:
Show quoted text
> - pack("l", $val ? 1 : 0)); > + $val ? PACK_0 : PACK_1);
Please note that this patch would change 0 to 1 and vice versa. $val ? PACK_1 : PACK_0 would retain the previous behaviour.
MIME-Version: 1.0
In-Reply-To: <1322073530-44497-1-git-send-email-nicolas.rochelemagne@cpanel.net>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <1322073530-44497-1-git-send-email-nicolas.rochelemagne@cpanel.net>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-32077-1571955914-1659.72670-0-0@rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 452
The bug is fixed in https://cpan.metacpan.org/authors/id/N/NM/NML/Danga-Socket-1.62_03-TRIAL.tar.gz Please test and/or review the code. It's a preview version and I'll release normal 1.62 in a week or so if no new easy to fix problems are discovered. - CPAN Testers: http://matrix.cpantesters.org/?dist=Danga-Socket+1.62_03-TRIAL (all green at the time of the posting) - GitHub: https://github.com/nponeccop/libdanga-socket-perl/tree/windows-blocking


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.