r17468 - in /trunk/libhttp-server-simple-perl: ./ debian/ debian/patches/ lib/HTTP/Server/

tincho-guest at users.alioth.debian.org tincho-guest at users.alioth.debian.org
Sat Mar 15 07:24:40 UTC 2008


Author: tincho-guest
Date: Sat Mar 15 07:24:39 2008
New Revision: 17468

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=17468
Log:
* New upstream release.
* debian/rules: cleaned some unuseful stuff, moved tests to build, add quilt
  support.
* debian/copyright: added obligatory © symbol.
* debian/control: add quilt B-D, add myself to Uploaders.
* debian/patches: add Niko Tyni patch that properly closes: #439724, as
  upstream hasn't solved it (CPAN#28122) in the new release.

Added:
    trunk/libhttp-server-simple-perl/debian/patches/
    trunk/libhttp-server-simple-perl/debian/patches/0001-add-testcase-for-CPAN-28122.patch
    trunk/libhttp-server-simple-perl/debian/patches/0002-Pipe-version-parent-waits-for-the-child-to-say-OK.patch
    trunk/libhttp-server-simple-perl/debian/patches/0002-Signal-version-child-sends-SIGUSR1-to-the-parent-wh.patch
    trunk/libhttp-server-simple-perl/debian/patches/series
Modified:
    trunk/libhttp-server-simple-perl/Changes
    trunk/libhttp-server-simple-perl/SIGNATURE
    trunk/libhttp-server-simple-perl/debian/changelog
    trunk/libhttp-server-simple-perl/debian/control
    trunk/libhttp-server-simple-perl/debian/copyright
    trunk/libhttp-server-simple-perl/debian/rules
    trunk/libhttp-server-simple-perl/debian/watch
    trunk/libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm

Modified: trunk/libhttp-server-simple-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-server-simple-perl/Changes?rev=17468&op=diff
==============================================================================
--- trunk/libhttp-server-simple-perl/Changes (original)
+++ trunk/libhttp-server-simple-perl/Changes Sat Mar 15 07:24:39 2008
@@ -1,3 +1,8 @@
+0.30 Tue Mar 11 12:14:24 EDT 2008
+
+* Minor doc fix from Paul Miller. 
+* Fixing doc style from "$this" to "$self" like any self-respecting perl code
+
 0.29 Fri Feb 15 11:43:29 EST 2008
 
 * new example section from almut on perlmonks

Modified: trunk/libhttp-server-simple-perl/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-server-simple-perl/SIGNATURE?rev=17468&op=diff
==============================================================================
--- trunk/libhttp-server-simple-perl/SIGNATURE (original)
+++ trunk/libhttp-server-simple-perl/SIGNATURE Sat Mar 15 07:24:39 2008
@@ -14,7 +14,7 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-SHA1 1169fda38432a0b835a619128f524a44dbf913cc Changes
+SHA1 aaa5973569bfe855b7f58b3e39c2b2d27a3aa327 Changes
 SHA1 0ac508c50476dcc2bf8fe3094cb341425291e1ee MANIFEST
 SHA1 de5abaa8229fa5378d21eeb328081c8f14a7b488 META.yml
 SHA1 3a02ba613b11b07dd1fa97e2a6b962ee3e039c98 Makefile.PL
@@ -28,7 +28,7 @@
 SHA1 5d6189b2cad15cf9932a28faafd55130c8247e83 inc/Module/Install/Metadata.pm
 SHA1 02af973fae2ac3531fa6b704574b2b8cb2a08148 inc/Module/Install/Win32.pm
 SHA1 3a2eab96e91cca8d99938cda7791759ae9d97b3a inc/Module/Install/WriteAll.pm
-SHA1 f3dc37bcbde91e7842c39a9aed62e68f188ea5cf lib/HTTP/Server/Simple.pm
+SHA1 f5647cef6a4255c622113967654c415b67ec217b lib/HTTP/Server/Simple.pm
 SHA1 40f24374f2b5845a3025e14ca4b91bd58298de03 lib/HTTP/Server/Simple/CGI.pm
 SHA1 47ef836a1cdd03add505dd4c90819cafb61dc565 lib/HTTP/Server/Simple/CGI/Environment.pm
 SHA1 db064af54cab345a71daec576e32e64b8fb1033d t/00smoke.t
@@ -39,7 +39,7 @@
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.8 (Darwin)
 
-iD8DBQFHtcFPEi9d9xCOQEYRAsxZAKDA8ITW0PRKPl/szr3nRGyy0dIIuwCbBUqW
-vZRZsBd3mlE7l0EkMlxXV1M=
-=nUTd
+iD8DBQFH1rBEEi9d9xCOQEYRAusqAJsFwS6wO1qvPzvFxVQEy3QQwZSlAgCgs4AG
+rL8Z13+0oDUZviZ7CrgxqQE=
+=MnVf
 -----END PGP SIGNATURE-----

Modified: trunk/libhttp-server-simple-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-server-simple-perl/debian/changelog?rev=17468&op=diff
==============================================================================
--- trunk/libhttp-server-simple-perl/debian/changelog (original)
+++ trunk/libhttp-server-simple-perl/debian/changelog Sat Mar 15 07:24:39 2008
@@ -1,3 +1,15 @@
+libhttp-server-simple-perl (0.30-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/rules: cleaned some unuseful stuff, moved tests to build, add quilt
+    support.
+  * debian/copyright: added obligatory © symbol.
+  * debian/control: add quilt B-D, add myself to Uploaders.
+  * debian/patches: add Niko Tyni patch that properly closes: #439724, as
+    upstream hasn't solved it (CPAN#28122) in the new release.
+
+ -- Martín Ferrari <martin.ferrari at gmail.com>  Sat, 15 Mar 2008 04:43:39 -0200
+
 libhttp-server-simple-perl (0.29-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libhttp-server-simple-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-server-simple-perl/debian/control?rev=17468&op=diff
==============================================================================
--- trunk/libhttp-server-simple-perl/debian/control (original)
+++ trunk/libhttp-server-simple-perl/debian/control Sat Mar 15 07:24:39 2008
@@ -1,13 +1,14 @@
 Source: libhttp-server-simple-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 6)
+Build-Depends: debhelper (>= 6), quilt
 Build-Depends-Indep: perl (>= 5.8.0-7), netbase, libtest-pod-perl, 
  libtest-pod-coverage-perl, liburi-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Niko Tyni <ntyni at iki.fi>,
  Krzysztof Krzyzaniak (eloy) <eloy at debian.org>, 
- gregor herrmann <gregor+debian at comodo.priv.at>
+ gregor herrmann <gregor+debian at comodo.priv.at>,
+ Martín Ferrari <martin.ferrari at gmail.com>
 Standards-Version: 3.7.3
 Homepage: http://search.cpan.org/dist/HTTP-Server-Simple/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libhttp-server-simple-perl/
@@ -16,8 +17,10 @@
 Package: libhttp-server-simple-perl
 Architecture: all
 Depends: ${perl:Depends}, ${misc:Depends}
-Description: Simple stand-alone http daemon
- HTTP::Server::Simple is a simple stand-alone http daemon.  It 
- doesn't  thread. It doesn't fork.  It does, however, act as a 
- simple frontend for any small web service you might care to write.
- It also includes CGI support.
+Description: simple stand-alone HTTP server
+ HTTP::Server::Simple is a simple standalone HTTP server. By default, it
+ doesn’t thread or fork.
+ .
+ It does, however, act as a simple frontend which can be used to build a
+ standalone web-based application or turn a CGI into one. (It’s possible to
+ use Net::Server to get threading, forking, preforking and so on.

Modified: trunk/libhttp-server-simple-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-server-simple-perl/debian/copyright?rev=17468&op=diff
==============================================================================
--- trunk/libhttp-server-simple-perl/debian/copyright (original)
+++ trunk/libhttp-server-simple-perl/debian/copyright Sat Mar 15 07:24:39 2008
@@ -1,16 +1,16 @@
 Upstream source location: http://search.cpan.org/dist/HTTP-Server-Simple/
 
 Files: *
-Copyright: (c) 2004-2008 Jesse Vincent <jesse at bestpractical.com> All rights reserved.
+Copyright: © 2004-2008 Jesse Vincent <jesse at bestpractical.com>
+                       All rights reserved.
 License: GPL-1+ | Artistic
  This library is free software; you can redistribute it and/or modify
  it under the same terms as Perl itself.
 
 Files: debian/*
-Copyright:
- 2005, Chip Salzenberg <chip at debian.org>
- 2006, Don Armstrong <don at debian.org>
- 2006-2008, Debian Perl Group
+Copyright: © 2005 Chip Salzenberg <chip at debian.org>
+           © 2006 Don Armstrong <don at debian.org>
+           © 2006-2008 Debian Perl Group
 License: GPL-1+ | Artistic
  It is assumed that all contributors put their work under the same license
  as the module itself.

Added: trunk/libhttp-server-simple-perl/debian/patches/0001-add-testcase-for-CPAN-28122.patch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-server-simple-perl/debian/patches/0001-add-testcase-for-CPAN-28122.patch?rev=17468&op=file
==============================================================================
--- trunk/libhttp-server-simple-perl/debian/patches/0001-add-testcase-for-CPAN-28122.patch (added)
+++ trunk/libhttp-server-simple-perl/debian/patches/0001-add-testcase-for-CPAN-28122.patch Sat Mar 15 07:24:39 2008
@@ -1,0 +1,67 @@
+From f7a9df060539718c9bbd46da436539e247b27bc7 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni at iki.fi>
+Date: Sun, 16 Sep 2007 13:35:17 +0300
+Subject: [PATCH] add testcase for CPAN #28122
+
+---
+ t/01live.t |   22 ++++++++++++++++++----
+ 1 files changed, 18 insertions(+), 4 deletions(-)
+
+diff --git a/t/01live.t b/t/01live.t
+index 0e91384..5e8effc 100644
+--- a/t/01live.t
++++ b/t/01live.t
+@@ -1,7 +1,7 @@
+ # -*- perl -*-
+ 
+ use Socket;
+-use Test::More tests => 10;
++use Test::More tests => 14;
+ use strict;
+ 
+ # This script assumes that `localhost' will resolve to a local IP
+@@ -11,16 +11,31 @@ use constant PORT => 13432;
+ 
+ use HTTP::Server::Simple;
+ 
++package SlowServer;
++# This test class just waits a while before it starts
++# accepting connections. This makes sure that CPAN #28122 is fixed:
++# background() shouldn't return prematurely.
++
++use base qw(HTTP::Server::Simple::CGI);
++sub setup_listener {
++    my $self = shift;
++    sleep 2;
++    $self->SUPER::setup_listener();
++}
++1;
++package main;
++
+ my $DEBUG = 1 if @ARGV;
+ 
++my @classes = (qw(HTTP::Server::Simple SlowServer));
++for my $class (@classes)
+ {
+-    my $s=HTTP::Server::Simple->new(PORT);
++    my $s = $class->new(PORT);
+     is($s->port(),PORT,"Constructor set port correctly");
+ 
+     my $pid=$s->background();
+ 
+     like($pid, '/^-?\d+$/', 'pid is numeric');
+-    select(undef,undef,undef,0.2); # wait a sec
+ 
+     my $content=fetch("GET / HTTP/1.1", "");
+ 
+@@ -34,7 +49,6 @@ my $DEBUG = 1 if @ARGV;
+     $s->host("localhost");
+     my $pid=$s->background();
+     diag("started server on $pid");
+-    select(undef,undef,undef,0.2); # wait a sec
+     like($pid, '/^-?\d+$/', 'pid is numeric');
+ 
+     my $content=fetch("GET / HTTP/1.1", "");
+-- 
+1.5.3.1
+

Added: trunk/libhttp-server-simple-perl/debian/patches/0002-Pipe-version-parent-waits-for-the-child-to-say-OK.patch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-server-simple-perl/debian/patches/0002-Pipe-version-parent-waits-for-the-child-to-say-OK.patch?rev=17468&op=file
==============================================================================
--- trunk/libhttp-server-simple-perl/debian/patches/0002-Pipe-version-parent-waits-for-the-child-to-say-OK.patch (added)
+++ trunk/libhttp-server-simple-perl/debian/patches/0002-Pipe-version-parent-waits-for-the-child-to-say-OK.patch Sat Mar 15 07:24:39 2008
@@ -1,0 +1,72 @@
+From: Niko Tyni <ntyni at iki.fi>
+Subject: [PATCH] Pipe version: parent waits for the child to say "OK" via a pipe.
+
+Index: libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm
+===================================================================
+--- libhttp-server-simple-perl.orig/lib/HTTP/Server/Simple.pm
++++ libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm
+@@ -6,6 +6,7 @@ use FileHandle;
+ use Socket;
+ use Carp;
+ use URI::Escape;
++use IO::Select;
+ 
+ use vars qw($VERSION $bad_request_doc);
+ $VERSION = '0.30';
+@@ -215,15 +216,31 @@ Run the server in the background. return
+ 
+ sub background {
+     my $self  = shift;
++
++    # set up a pipe so the child can tell the parent when it's ready
++    # to accept requests
++    my ($readfh, $writefh) = FileHandle::pipe;
++
+     my $child = fork;
+     die "Can't fork: $!" unless defined($child);
+-    return $child if $child;
++    if ($child) { # parent
++        my $s = IO::Select->new;
++        $s->add($readfh);
++        my @ready = $s->can_read(5);
++        die("child unresponsive for 5 seconds") if !@ready;
++        my $response = <$readfh>;
++        chomp $response;
++        die("child is confused: answer '$response' != 'OK'")
++            if $response ne "OK";
++        return $child;
++    }    
+ 
+     if ( $^O !~ /MSWin32/ ) {
+         require POSIX;
+         POSIX::setsid()
+             or die "Can't start a new session: $!";
+     }
++    $self->{_parent_handle} = $writefh;
+     $self->run();
+ }
+ 
+@@ -263,6 +280,7 @@ sub run {
+ 	$self->after_setup_listener();
+         *{"$pkg\::run"} = $self->_default_run;
+     }
++    $self->_maybe_tell_parent();
+ 
+     local $SIG{HUP} = sub { $SERVER_SHOULD_RUN = 0; };
+ 
+@@ -400,6 +418,15 @@ sub _process_request {
+         }
+ }
+ 
++sub _maybe_tell_parent {
++    # inform the parent process that we're ready, if applicable
++    my $self = shift;
++    my $handle = $self->{_parent_handle};
++    return if !$handle;
++    print $handle "OK\n";
++    close $handle;
++    delete $self->{_parent_handle};
++}
+ 
+ 
+ 

Added: trunk/libhttp-server-simple-perl/debian/patches/0002-Signal-version-child-sends-SIGUSR1-to-the-parent-wh.patch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-server-simple-perl/debian/patches/0002-Signal-version-child-sends-SIGUSR1-to-the-parent-wh.patch?rev=17468&op=file
==============================================================================
--- trunk/libhttp-server-simple-perl/debian/patches/0002-Signal-version-child-sends-SIGUSR1-to-the-parent-wh.patch (added)
+++ trunk/libhttp-server-simple-perl/debian/patches/0002-Signal-version-child-sends-SIGUSR1-to-the-parent-wh.patch Sat Mar 15 07:24:39 2008
@@ -1,0 +1,86 @@
+From c810bff8000a871b40fa58aaef52bd25d09c7a38 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni at iki.fi>
+Date: Sun, 16 Sep 2007 13:37:55 +0300
+Subject: [PATCH] Signal version: child sends SIGUSR1 to the parent when it's ready.
+
+---
+ lib/HTTP/Server/Simple.pm |   51 ++++++++++++++++++++++++++++++++++++++++++--
+ 1 files changed, 48 insertions(+), 3 deletions(-)
+
+Index: libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm
+===================================================================
+--- libhttp-server-simple-perl.orig/lib/HTTP/Server/Simple.pm
++++ libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm
+@@ -215,9 +215,30 @@ Run the server in the background. return
+ 
+ sub background {
+     my $self  = shift;
+-    my $child = fork;
+-    die "Can't fork: $!" unless defined($child);
+-    return $child if $child;
++    my $parent_pid = $$;
++
++    # fork, then wait for the child to send us an 
++    # USR1 signal from _signal_parent()
++
++    { # scope for the local sighandler below
++        my $gotsig = 0;
++        local $SIG{USR1} = sub { $gotsig = 1; };
++        my $child = fork;
++        die "Can't fork: $!" unless defined($child);
++        if ($child) { # parent
++            my $sleeptime = 5;
++            my $i = 0;
++            while (!$gotsig && $sleeptime > 0) {
++                $sleeptime -= sleep $sleeptime;
++                die("infinite loop while waiting for the child?")
++                    if $i++ > 10;
++            }
++            die("Child unresponsive for 5 seconds, giving up")
++                if !$gotsig;
++            return $child;
++        }
++    }
++    $self->{_parent_pid} = $parent_pid;
+ 
+     if ( $^O !~ /MSWin32/ ) {
+         require POSIX;
+@@ -263,6 +284,7 @@ sub run {
+ 	$self->after_setup_listener();
+         *{"$pkg\::run"} = $self->_default_run;
+     }
++    $self->_signal_parent;
+ 
+     local $SIG{HUP} = sub { $SERVER_SHOULD_RUN = 0; };
+ 
+@@ -400,7 +422,30 @@ sub _process_request {
+         }
+ }
+ 
++sub _signal_parent {
++    my $self = shift;
+ 
++    # tell the parent that we are ready to accept requests,
++    # if applicable
++
++    my $parent = $self->{_parent_pid};
++    if ($parent) {
++        require Config;
++        defined $Config::Config{sig_name} || die "No sigs?";
++        my %signo;
++        my $i = 0;
++        foreach my $name (split(' ', $Config::Config{sig_name})) {
++            $signo{$name} = $i;
++            $i++;
++        }
++
++        die("No USR1 signal available?") if !$signo{USR1};
++        my $ret = kill $signo{USR1}, $parent;
++        die("Failed to signal parent process $parent") if !$ret;
++        delete $self->{_parent_pid};
++    }
++    return;
++}
+ 
+ 
+ 

Added: trunk/libhttp-server-simple-perl/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-server-simple-perl/debian/patches/series?rev=17468&op=file
==============================================================================
--- trunk/libhttp-server-simple-perl/debian/patches/series (added)
+++ trunk/libhttp-server-simple-perl/debian/patches/series Sat Mar 15 07:24:39 2008
@@ -1,0 +1,3 @@
+0001-add-testcase-for-CPAN-28122.patch
+0002-Signal-version-child-sends-SIGUSR1-to-the-parent-wh.patch
+#0002-Pipe-version-parent-waits-for-the-child-to-say-OK.patch

Modified: trunk/libhttp-server-simple-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-server-simple-perl/debian/rules?rev=17468&op=diff
==============================================================================
--- trunk/libhttp-server-simple-perl/debian/rules (original)
+++ trunk/libhttp-server-simple-perl/debian/rules Sat Mar 15 07:24:39 2008
@@ -1,8 +1,5 @@
 #!/usr/bin/make -f
-# This debian/rules file is provided as a template for normal perl
-# packages. It was created by Marc Brockschmidt <marc at dch-faq.de> for
-# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may
-# be used freely wherever it is useful.
+include /usr/share/quilt/quilt.make
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
@@ -11,22 +8,19 @@
 # always return the default without waiting for user input.
 export PERL_MM_USE_DEFAULT=1
 
-PACKAGE=$(shell dh_listpackages)
-
-ifndef PERL
-PERL = /usr/bin/perl
-endif
-
-TMP     =$(CURDIR)/debian/$(PACKAGE)
+PACKAGE = $(shell dh_listpackages)
+PERL   ?= /usr/bin/perl
+TMP     = $(CURDIR)/debian/$(PACKAGE)
 
 build: build-stamp
-build-stamp:
+build-stamp: $(QUILT_STAMPFN)
 	dh_testdir
 	$(PERL) Makefile.PL INSTALLDIRS=vendor
 	$(MAKE)
-	touch build-stamp
+	$(MAKE) test
+	touch $@
 
-clean:
+clean: unpatch
 	dh_testdir
 	dh_testroot
 	dh_clean build-stamp install-stamp
@@ -37,18 +31,14 @@
 	dh_testdir
 	dh_testroot
 	dh_clean -k
-	$(MAKE) test
 	$(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
-
-	# As this is a architecture independent package, we are not
-	# supposed to install stuff to /usr/lib. MakeMaker creates
-	# the dirs, we delete them from the deb:
-	[ ! -d $(TMP)/usr/lib/perl5 ] || rmdir --ignore-fail-on-non-empty --parents --verbose $(TMP)/usr/lib/perl5
-
-	touch install-stamp
+	[ ! -d $(TMP)/usr/lib/perl5 ] || \
+		rmdir --ignore-fail-on-non-empty --parents --verbose \
+		$(TMP)/usr/lib/perl5
+	touch $@
 
 binary-arch:
-# We have nothing to do by default.
+# We have nothing to do here for an architecture-independent package
 
 binary-indep: build install
 	dh_testdir
@@ -64,7 +54,7 @@
 	dh_md5sums
 	dh_builddeb
 
-source diff:                                                                  
+source diff:
 	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
 
 binary: binary-indep binary-arch

Modified: trunk/libhttp-server-simple-perl/debian/watch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-server-simple-perl/debian/watch?rev=17468&op=diff
==============================================================================
--- trunk/libhttp-server-simple-perl/debian/watch (original)
+++ trunk/libhttp-server-simple-perl/debian/watch Sat Mar 15 07:24:39 2008
@@ -1,2 +1,3 @@
 version=3
-http://search.cpan.org/dist/HTTP-Server-Simple/ .*/HTTP-Server-Simple-v?(\d[\d_.]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)
+http://search.cpan.org/dist/HTTP-Server-Simple/ \
+	.*/HTTP-Server-Simple-v?(\d[\d_.]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)

Modified: trunk/libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm?rev=17468&op=diff
==============================================================================
--- trunk/libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm (original)
+++ trunk/libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm Sat Mar 15 07:24:39 2008
@@ -8,7 +8,7 @@
 use URI::Escape;
 
 use vars qw($VERSION $bad_request_doc);
-$VERSION = '0.29';
+$VERSION = '0.30';
 
 
 =head1 NAME
@@ -541,7 +541,25 @@
 =head2 accept_hook
 
 If defined by a sub-class, this method is called directly after an
-accept happens.
+accept happens.  An accept_hook to add SSL support might look like this:
+
+    sub accept_hook {
+        my $self = shift;
+        my $fh   = $self->stdio_handle;
+
+        $self->SUPER::accept_hook(@_);
+
+        my $newfh =
+        IO::Socket::SSL->start_SSL( $fh, 
+            SSL_server    => 1,
+            SSL_use_cert  => 1,
+            SSL_cert_file => 'myserver.crt',
+            SSL_key_file  => 'myserver.key',
+        )
+        or warn "problem setting up SSL socket: " . IO::Socket::SSL::errstr();
+
+        $self->stdio_handle($newfh) if $newfh;
+    }
 
 =head2 post_setup_hook
 




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