[SCM] Debian packaging of libnet-server-perl branch, master, updated. debian/0.99-3-4-g2dc896a

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Mar 16 01:11:05 UTC 2012


The following commit has been merged in the master branch:
commit 77c78ee343fea67233e3533dbe4f63f0e3ee7c0e
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Thu Mar 15 20:32:31 2012 -0400

    added patch to propagate port information across a HUP
    (Closes: #624500)

diff --git a/debian/changelog b/debian/changelog
index 0f7140e..8fe9034 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libnet-server-perl (0.99-4) UNRELEASED; urgency=low
+
+  * added patch to propagate port information across a HUP
+    (Closes: #624500)
+
+ -- Daniel Kahn Gillmor <dkg at fifthhorseman.net>  Thu, 15 Mar 2012 20:25:44 -0400
+
 libnet-server-perl (0.99-3) unstable; urgency=low
 
   [ Carsten Wolff ]
diff --git a/debian/patches/08_propagate-dynamic-port-data-across-a-hup.patch b/debian/patches/08_propagate-dynamic-port-data-across-a-hup.patch
new file mode 100644
index 0000000..6e9d4cc
--- /dev/null
+++ b/debian/patches/08_propagate-dynamic-port-data-across-a-hup.patch
@@ -0,0 +1,42 @@
+diff --git a/lib/Net/Server.pm b/lib/Net/Server.pm
+index 4c5e8d9..31f2cdf 100644
+--- a/lib/Net/Server.pm
++++ b/lib/Net/Server.pm
+@@ -419,8 +419,15 @@ sub bind {
+     foreach my $info (split /\n/, $ENV{BOUND_SOCKETS}) {
+       my ($fd, $hup_string) = split /\|/, $info, 2;
+       $fd = ($fd =~ /^(\d+)$/) ? $1 : $self->fatal("Bad file descriptor");
++
++      # if our config wants port 0 (dynamically-allocated port from
++      # the OS), we want to make sure we can reconnect to those.
++      my $dynamic_hup_string = $hup_string;
++      $dynamic_hup_string =~ s/\|\d+\|/|0|/;
++
+       foreach my $sock ( @{ $prop->{sock} } ){
+-        if ($hup_string eq $sock->hup_string) {
++        if (($hup_string eq $sock->hup_string) or
++            ($dynamic_hup_string eq $sock->hup_string)) {
+           $sock->log_connect($self);
+           $sock->reconnect($fd, $self);
+           last;
+diff --git a/lib/Net/Server/Proto/TCP.pm b/lib/Net/Server/Proto/TCP.pm
+index 437f5d4..df7221c 100644
+--- a/lib/Net/Server/Proto/TCP.pm
++++ b/lib/Net/Server/Proto/TCP.pm
+@@ -104,9 +104,16 @@ sub reconnect {
+   my $fd   = shift;
+   my $server = shift;
+ 
++  my $port = $sock->NS_port;
++
+   $sock->fdopen( $fd, 'w' )
+     or $server->fatal("Error opening to file descriptor ($fd) [$!]");
+ 
++  if ($port == 0 && ($port = $sock->sockport)) {
++    $sock->NS_port($port);
++    $server->log(2,"Bound to auto-assigned port $port");
++  }
++
+ }
+ 
+ ### allow for endowing the child
diff --git a/debian/patches/series b/debian/patches/series
index 647d417..65eba58 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
 05_ipv6-support.patch
 06_cidr-workaround.patch
 07_spelling.patch
+08_propagate-dynamic-port-data-across-a-hup.patch

-- 
Debian packaging of libnet-server-perl



More information about the Pkg-perl-cvs-commits mailing list