From 062e142e0f71d153f6f73840af32d8954af28635 Mon Sep 17 00:00:00 2001 From: Robin Redeker Date: Tue, 15 Apr 2008 12:58:30 +0200 Subject: [PATCH] renamed module to AnyEvent::HTTPD --- Changes | 8 +- MANIFEST | 14 +- Makefile.PL | 26 ++-- README | 201 ++++++++++++++++++++------- lib/{BS => AnyEvent}/HTTPD.pm | 54 ++++--- lib/{BS => AnyEvent}/HTTPD/Appgets.pm | 12 +- lib/{BS => AnyEvent}/HTTPD/HTTPConnection.pm | 10 +- lib/{BS => AnyEvent}/HTTPD/HTTPServer.pm | 14 +- lib/{BS => AnyEvent}/HTTPD/Request.pm | 8 +- lib/{BS => AnyEvent}/HTTPD/TCPConnection.pm | 10 +- lib/{BS => AnyEvent}/HTTPD/TCPListener.pm | 14 +- samples/ajax_example | 8 +- samples/capture_example | 6 +- samples/delayed_example | 4 +- samples/more_complex_example | 6 +- samples/second_example | 4 +- samples/simple_example | 4 +- t/00-load.t | 4 +- t/pod-coverage.t | 12 +- 19 files changed, 257 insertions(+), 162 deletions(-) rewrite README (98%) rename lib/{BS => AnyEvent}/HTTPD.pm (82%) rename lib/{BS => AnyEvent}/HTTPD/Appgets.pm (98%) rename lib/{BS => AnyEvent}/HTTPD/HTTPConnection.pm (95%) rename lib/{BS => AnyEvent}/HTTPD/HTTPServer.pm (67%) rename lib/{BS => AnyEvent}/HTTPD/Request.pm (94%) rename lib/{BS => AnyEvent}/HTTPD/TCPConnection.pm (96%) rename lib/{BS => AnyEvent}/HTTPD/TCPListener.pm (87%) diff --git a/Changes b/Changes index a6931d6..6f86bf4 100644 --- a/Changes +++ b/Changes @@ -1,13 +1,13 @@ -Revision history for BS-HTTPD +Revision history for AnyEvent-HTTPD -0.03 +0.03 Tue Apr 15 12:57:10 CEST 2008 - added submit() function to Appgets - - fixed a bug in the url() method of BS::HTTPD::Request where the + - fixed a bug in the url() method of AnyEvent::HTTPD::Request where the url wasn't get correctly. resulting in bad form behaviour. 0.02 Sat Mar 22 16:09:55 CET 2008 - rewrote the module API to be more "async" - - made it possible to respond to requests asynchronously in C. + - made it possible to respond to requests asynchronously in C. - added lots of example scripts 0.01 Thu Mar 20 19:53:31 CET 2008 diff --git a/MANIFEST b/MANIFEST index be1d742..d8307d4 100644 --- a/MANIFEST +++ b/MANIFEST @@ -5,13 +5,13 @@ README t/00-load.t t/pod-coverage.t t/pod.t -lib/BS/HTTPD/TCPConnection.pm -lib/BS/HTTPD/TCPListener.pm -lib/BS/HTTPD/HTTPServer.pm -lib/BS/HTTPD/HTTPConnection.pm -lib/BS/HTTPD/Appgets.pm -lib/BS/HTTPD/Request.pm -lib/BS/HTTPD.pm +lib/AnyEvent/HTTPD/TCPConnection.pm +lib/AnyEvent/HTTPD/TCPListener.pm +lib/AnyEvent/HTTPD/HTTPServer.pm +lib/AnyEvent/HTTPD/HTTPConnection.pm +lib/AnyEvent/HTTPD/Appgets.pm +lib/AnyEvent/HTTPD/Request.pm +lib/AnyEvent/HTTPD.pm samples/simple_example samples/ajax_example samples/bshttp.png diff --git a/Makefile.PL b/Makefile.PL index 6b9c181..c04a8aa 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -3,21 +3,23 @@ use warnings; use ExtUtils::MakeMaker; WriteMakefile( - NAME => 'BS::HTTPD', + NAME => 'AnyEvent::HTTPD', AUTHOR => 'Robin Redeker ', - VERSION_FROM => 'lib/BS/HTTPD.pm', - ABSTRACT_FROM => 'lib/BS/HTTPD.pm', + VERSION_FROM => 'lib/AnyEvent/HTTPD.pm', + ABSTRACT_FROM => 'lib/AnyEvent/HTTPD.pm', LICENSE => 'perl', PL_FILES => {}, PREREQ_PM => { - 'Test::More' => 0, - 'HTTP::Date' => 0, - 'BS::Event' => 0, - 'POSIX' => 0, - 'URI' => 0, - 'Fcntl' => 0, - 'CGI' => 0, + 'Test::More' => 0, + 'HTTP::Date' => 0, + 'Object::Event' => 0, + 'POSIX' => 0, + 'URI' => 0, + 'Fcntl' => 0, + 'CGI' => 0, }, - dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, - clean => { FILES => 'BS-HTTPD-*' }, + dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', + PREOP => 'pod2text lib/AnyEvent/HTTPD.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', + }, + clean => { FILES => 'AnyEvent-HTTPD-*' }, ); diff --git a/README b/README dissimilarity index 98% index 2f823cb..9aacbb3 100644 --- a/README +++ b/README @@ -1,52 +1,149 @@ -BS-HTTPD - -The README is used to introduce the module and provide instructions on -how to install the module, any machine dependencies it may have (for -example C compilers and installed libraries) and any other information -that should be provided before the module is installed. - -A README file is required for CPAN modules since CPAN extracts the README -file from a module distribution so that people browsing the archive -can use it to get an idea of the module's uses. It is usually a good idea -to provide version information here so that people can decide whether -fixes for the module are worth downloading. - - -INSTALLATION - -To install this module, run the following commands: - - perl Makefile.PL - make - make test - make install - -SUPPORT AND DOCUMENTATION - -After installing, you can find documentation for this module with the -perldoc command. - - perldoc BS::HTTPD - -You can also look for information at: - - RT, CPAN's request tracker - http://rt.cpan.org/NoAuth/Bugs.html?Dist=BS-HTTPD - - AnnoCPAN, Annotated CPAN documentation - http://annocpan.org/dist/BS-HTTPD - - CPAN Ratings - http://cpanratings.perl.org/d/BS-HTTPD - - Search CPAN - http://search.cpan.org/dist/BS-HTTPD - - -COPYRIGHT AND LICENCE - -Copyright (C) 2008 Robin Redeker - -This program is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - +NAME + AnyEvent::HTTPD - A simple lightweight event based web (application) + server + +VERSION + Version 0.02 + +SYNOPSIS + use AnyEvent::HTTPD; + + my $httpd = AnyEvent::HTTPD->new (port => 9090); + + $httpd->reg_cb ( + _ => sub { + my ($httpd, $req) = @_; + + $req->o ("

Hello World!

"); + $req->o ("another test page"); + $req->o (""); + $req->respond; + }, + _test => sub { + my ($httpd, $req) = @_; + + $req->o ("

Test page

"); + $req->o ("Back to the main page"); + $req->o (""); + $req->respond; + }, + ); + +DESCRIPTION + This module provides a simple HTTPD for serving simple web application + interfaces. It's completly event based and independend from any event + loop by using the AnyEvent module. + + It's HTTP implementation is a bit hacky, so before using this module + make sure it works for you and the expected deployment. Feel free to + improve the HTTP support and send in patches! + + The documentation is currently only the source code, but next versions + of this module will be better documented hopefully. See also the + "samples/" directory in the AnyEvent::HTTPD distribution for basic + starting points. + + AnyEvent::HTTPD even comes with some basic AJAX framework/helper. + +FEATURES + * support for GET and POST requests + + * processing of "x-www-form-urlencoded" and "multipart/form-data" + encoded form parameters + + * ajax helper and javascript output functions in + AnyEvent::HTTPD::Appgets + + * support for chunked encoding output to the HTTP client + +METHODS + The AnyEvent::HTTPD class inherits directly from + AnyEvent::HTTPD::HTTPServer which inherits the event callback interface + from Object::Event. + + Event callbacks can be registered via the Object::Event API (see the + documentation of Object::Event for details). + + For a list of available events see below in the *EVENTS* section. + + new (%args) + This is the constructor for a AnyEvent::HTTPD object. The %args hash + may contain one of these key/value pairs: + + port => $port + The TCP port the HTTP server will listen on. + +EVENTS + Every request goes to a specific URL. After a (GET or POST) request is + received the URL is split at the '/' characters and joined again with + '_' characters. After that the event with the name of the converted URL + is invoked, this means that if you get a request to the url '/test/bla' + the even "_test_bla" is emitted, you can register a callback for that + URL like this: + + $httpd->reg_cb ( + _test_bla => sub { + my ($httpd, $req) = @_; + + $req->respond ([200, 'ok', { 'Content-Type' => 'text/html' }, '

Test

' }]); + } + ); + + The first argument to such a callback is always the AnyEvent::HTTPD + object itself. The second argument ($req) is the + AnyEvent::HTTPD::Request object for this request. It can be used to get + the (possible) form parameters for this request or the transmitted + content and respond to the request. + + Also every request also emits the "request" event, with the same + arguments and semantics, you can use this to implement your own request + multiplexing. + +CACHING + Any response from the HTTP server will have "Cache-Control" set to + "max-age=0" and also the "Expires" header set to the "Date" header. + Meaning: Caching is disabled. + + If you need caching or would like to have it you can send me a mail or + even better: a patch :) + +AUTHOR + Robin Redeker, "" + +BUGS + Please report any bugs or feature requests to "bug-bs-httpd at + rt.cpan.org", or through the web interface at + . I will + be notified, and then you'll automatically be notified of progress on + your bug as I make changes. + +SUPPORT + You can find documentation for this module with the perldoc command. + + perldoc AnyEvent::HTTPD + + You can also look for information at: + + * RT: CPAN's request tracker + + + + * AnnoCPAN: Annotated CPAN documentation + + + + * CPAN Ratings + + + + * Search CPAN + + + +ACKNOWLEDGEMENTS +COPYRIGHT & LICENSE + Copyright 2008 Robin Redeker, all rights reserved. + + This program is free software; you can redistribute it and/or modify it + under the same terms as Perl itself. + diff --git a/lib/BS/HTTPD.pm b/lib/AnyEvent/HTTPD.pm similarity index 82% rename from lib/BS/HTTPD.pm rename to lib/AnyEvent/HTTPD.pm index dc8eaaf..ee5c53c 100644 --- a/lib/BS/HTTPD.pm +++ b/lib/AnyEvent/HTTPD.pm @@ -1,18 +1,18 @@ -package BS::HTTPD; +package AnyEvent::HTTPD; use feature ':5.10'; use strict; no warnings; use Scalar::Util qw/weaken/; use URI; -use BS::HTTPD::HTTPServer; -use BS::HTTPD::Request; +use AnyEvent::HTTPD::HTTPServer; +use AnyEvent::HTTPD::Request; -our @ISA = qw/BS::HTTPD::HTTPServer/; +our @ISA = qw/AnyEvent::HTTPD::HTTPServer/; =head1 NAME -BS::HTTPD - A simple lightweight event based web (application) server +AnyEvent::HTTPD - A simple lightweight event based web (application) server =head1 VERSION @@ -24,9 +24,9 @@ our $VERSION = '0.02'; =head1 SYNOPSIS - use BS::HTTPD; + use AnyEvent::HTTPD; - my $httpd = BS::HTTPD->new (port => 9090); + my $httpd = AnyEvent::HTTPD->new (port => 9090); $httpd->reg_cb ( _ => sub { @@ -57,15 +57,11 @@ It's HTTP implementation is a bit hacky, so before using this module make sure it works for you and the expected deployment. Feel free to improve the HTTP support and send in patches! -I mainly wrote this module to provide a HTTP interface in L. However, -it doesn't depend on L and it can be used to extend any application -with a (simple) web interface. - The documentation is currently only the source code, but next versions of this module will be better documented hopefully. See also the C directory -in the L distribution for basic starting points. +in the L distribution for basic starting points. -L even comes with some basic AJAX framework/helper. +L even comes with some basic AJAX framework/helper. =head1 FEATURES @@ -75,7 +71,7 @@ L even comes with some basic AJAX framework/helper. =item * processing of C and C encoded form parameters -=item * ajax helper and javascript output functions in L +=item * ajax helper and javascript output functions in L =item * support for chunked encoding output to the HTTP client @@ -83,11 +79,11 @@ L even comes with some basic AJAX framework/helper. =head1 METHODS -The L class inherits directly from L -which inherits the event callback interface from L. +The L class inherits directly from L +which inherits the event callback interface from L. -Event callbacks can be registered via the L API (see the documentation -of L for details). +Event callbacks can be registered via the L API (see the documentation +of L for details). For a list of available events see below in the I section. @@ -95,7 +91,7 @@ For a list of available events see below in the I section. =item B -This is the constructor for a L object. +This is the constructor for a L object. The C<%args> hash may contain one of these key/value pairs: =over 4 @@ -194,7 +190,7 @@ sub handle_app_req { weaken $self; my $req = - BS::HTTPD::Request->new ( + AnyEvent::HTTPD::Request->new ( httpd => $self, url => $url, hdr => $hdr, @@ -237,8 +233,8 @@ you can register a callback for that URL like this: } ); -The first argument to such a callback is always the L object itself. -The second argument (C<$req>) is the L object for this +The first argument to such a callback is always the L object itself. +The second argument (C<$req>) is the L object for this request. It can be used to get the (possible) form parameters for this request or the transmitted content and respond to the request. @@ -260,14 +256,14 @@ Robin Redeker, C<< >> =head1 BUGS Please report any bugs or feature requests to C, or through -the web interface at L. I will be notified, and then you'll +the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 SUPPORT You can find documentation for this module with the perldoc command. - perldoc BS::HTTPD + perldoc AnyEvent::HTTPD You can also look for information at: @@ -276,19 +272,19 @@ You can also look for information at: =item * RT: CPAN's request tracker -L +L =item * AnnoCPAN: Annotated CPAN documentation -L +L =item * CPAN Ratings -L +L =item * Search CPAN -L +L =back @@ -306,4 +302,4 @@ under the same terms as Perl itself. =cut -1; # End of BS::HTTPD +1; # End of AnyEvent::HTTPD diff --git a/lib/BS/HTTPD/Appgets.pm b/lib/AnyEvent/HTTPD/Appgets.pm similarity index 98% rename from lib/BS/HTTPD/Appgets.pm rename to lib/AnyEvent/HTTPD/Appgets.pm index 73b930d..682a35d 100644 --- a/lib/BS/HTTPD/Appgets.pm +++ b/lib/AnyEvent/HTTPD/Appgets.pm @@ -1,4 +1,4 @@ -package BS::HTTPD::Appgets; +package AnyEvent::HTTPD::Appgets; use feature ':5.10'; use strict; no warnings; @@ -13,7 +13,7 @@ our @EXPORT = qw/o link abutton set_request set_httpd js =head1 NAME -BS::HTTPD::Appgets - Some utility functions for web applications +AnyEvent::HTTPD::Appgets - Some utility functions for web applications =head1 EXPORTS @@ -110,7 +110,7 @@ The C
function has a special prototype which allows this syntax: }; This function is just a convenience wrapper around the C method -of the L object. +of the L object. =cut @@ -228,7 +228,7 @@ AJAXFUNC =item B -This does exactly the same as the C method of L +This does exactly the same as the C method of L just uses the current request as object and prints out the link via the C function. @@ -244,7 +244,7 @@ sub link { =over 4 -=item B<$BS::HTTPD::Appgets::JSON_JS> +=item B<$AnyEvent::HTTPD::Appgets::JSON_JS> This variable contains the javascript source of the JSON serializer and deserializer described in L. @@ -252,7 +252,7 @@ and deserializer described in L. You can use this in your application by for example output it via the C function like this: - js ($BS::HTTPD::Appgets::JSON_JS); + js ($AnyEvent::HTTPD::Appgets::JSON_JS); =back diff --git a/lib/BS/HTTPD/HTTPConnection.pm b/lib/AnyEvent/HTTPD/HTTPConnection.pm similarity index 95% rename from lib/BS/HTTPD/HTTPConnection.pm rename to lib/AnyEvent/HTTPD/HTTPConnection.pm index ea1dfe6..89f0388 100644 --- a/lib/BS/HTTPD/HTTPConnection.pm +++ b/lib/AnyEvent/HTTPD/HTTPConnection.pm @@ -1,20 +1,20 @@ -package BS::HTTPD::HTTPConnection; +package AnyEvent::HTTPD::HTTPConnection; use feature ':5.10'; use HTTP::Date; use strict; no warnings; -use BS::HTTPD::TCPConnection; +use AnyEvent::HTTPD::TCPConnection; -our @ISA = qw/BS::HTTPD::TCPConnection/; +our @ISA = qw/AnyEvent::HTTPD::TCPConnection/; =head1 NAME -BS::HTTPD::HTTPConnection - A simple HTTP connection for request and response handling +AnyEvent::HTTPD::HTTPConnection - A simple HTTP connection for request and response handling =head1 DESCRIPTION -This class is a helper class for L and L, +This class is a helper class for L and L, it handles TCP reading and writing as well as parsing and serializing http requests. diff --git a/lib/BS/HTTPD/HTTPServer.pm b/lib/AnyEvent/HTTPD/HTTPServer.pm similarity index 67% rename from lib/BS/HTTPD/HTTPServer.pm rename to lib/AnyEvent/HTTPD/HTTPServer.pm index b253c47..1b895f1 100644 --- a/lib/BS/HTTPD/HTTPServer.pm +++ b/lib/AnyEvent/HTTPD/HTTPServer.pm @@ -1,19 +1,19 @@ -package BS::HTTPD::HTTPServer; +package AnyEvent::HTTPD::HTTPServer; use feature ':5.10'; use strict; no warnings; -use BS::HTTPD::TCPListener; -use BS::HTTPD::HTTPConnection; +use AnyEvent::HTTPD::TCPListener; +use AnyEvent::HTTPD::HTTPConnection; =head1 NAME -BS::HTTPD::HTTPServer - A simple and plain http server +AnyEvent::HTTPD::HTTPServer - A simple and plain http server =head1 DESCRIPTION This class handles incoming TCP connections for HTTP clients. -It's used by L to do it's job. +It's used by L to do it's job. It has no public interface yet. @@ -26,7 +26,7 @@ under the same terms as Perl itself. =cut -our @ISA = qw/BS::HTTPD::TCPListener/; +our @ISA = qw/AnyEvent::HTTPD::TCPListener/; sub new { my $this = shift; @@ -45,6 +45,6 @@ sub new { return $self } -sub connection_class { 'BS::HTTPD::HTTPConnection' } +sub connection_class { 'AnyEvent::HTTPD::HTTPConnection' } 1; diff --git a/lib/BS/HTTPD/Request.pm b/lib/AnyEvent/HTTPD/Request.pm similarity index 94% rename from lib/BS/HTTPD/Request.pm rename to lib/AnyEvent/HTTPD/Request.pm index 4d01502..5732f54 100644 --- a/lib/BS/HTTPD/Request.pm +++ b/lib/AnyEvent/HTTPD/Request.pm @@ -1,15 +1,15 @@ -package BS::HTTPD::Request; +package AnyEvent::HTTPD::Request; use feature ':5.10'; use strict; no warnings; =head1 NAME -BS::HTTPD::Request - A web application request handle for L +AnyEvent::HTTPD::Request - A web application request handle for L =head1 DESCRIPTION -This is the request object as generated by L and given +This is the request object as generated by L and given in the request callbacks. =head1 METHODS @@ -63,7 +63,7 @@ request executes any of your content callbacks. The form ID is transmitted via a hidden input element with the name C<_APP_SRV_FORM_ID>, and you should take care not to use that form element name yourself. -The C<$callback> will receive as first argument the L object. +The C<$callback> will receive as first argument the L object. You can access the transmitted form parameters via the C method. diff --git a/lib/BS/HTTPD/TCPConnection.pm b/lib/AnyEvent/HTTPD/TCPConnection.pm similarity index 96% rename from lib/BS/HTTPD/TCPConnection.pm rename to lib/AnyEvent/HTTPD/TCPConnection.pm index 1477a22..db37527 100644 --- a/lib/BS/HTTPD/TCPConnection.pm +++ b/lib/AnyEvent/HTTPD/TCPConnection.pm @@ -1,4 +1,4 @@ -package BS::HTTPD::TCPConnection; +package AnyEvent::HTTPD::TCPConnection; use feature ':5.10'; use strict; no warnings; @@ -10,16 +10,16 @@ use Fcntl; use POSIX; use IO::Socket::INET; use Socket qw/IPPROTO_TCP TCP_NODELAY/; -use BS::Event; -our @ISA = qw/BS::Event/; +use Object::Event; +our @ISA = qw/Object::Event/; =head1 NAME -BS::HTTPD::TCPConnection - This class handles basic TCP input/output +AnyEvent::HTTPD::TCPConnection - This class handles basic TCP input/output =head1 DESCRIPTION -This class is a helper class for L. +This class is a helper class for L. It has no public interface yet. diff --git a/lib/BS/HTTPD/TCPListener.pm b/lib/AnyEvent/HTTPD/TCPListener.pm similarity index 87% rename from lib/BS/HTTPD/TCPListener.pm rename to lib/AnyEvent/HTTPD/TCPListener.pm index fe03cf8..0f61520 100644 --- a/lib/BS/HTTPD/TCPListener.pm +++ b/lib/AnyEvent/HTTPD/TCPListener.pm @@ -1,20 +1,20 @@ -package BS::HTTPD::TCPListener; +package AnyEvent::HTTPD::TCPListener; use strict; use Socket; use AnyEvent; use IO::Socket::INET; -use BS::Event; -use BS::HTTPD::TCPConnection; +use Object::Event; +use AnyEvent::HTTPD::TCPConnection; -our @ISA = qw/BS::Event/; +our @ISA = qw/Object::Event/; =head1 NAME -BS::HTTPD::TCPListener - A TCP listener +AnyEvent::HTTPD::TCPListener - A TCP listener =head1 DESCRIPTION -This class handles new TCP connections for L. +This class handles new TCP connections for L. It has no public interface yet. @@ -75,7 +75,7 @@ sub foreach_client_except { } sub connection_class { - 'BS::HTTPD::TCPConnection' + 'AnyEvent::HTTPD::TCPConnection' } sub spawn_connection { diff --git a/samples/ajax_example b/samples/ajax_example index d9e59cf..a3cb922 100755 --- a/samples/ajax_example +++ b/samples/ajax_example @@ -1,12 +1,12 @@ #!/opt/perl/bin/perl use AnyEvent; use JSON; -use BS::HTTPD; -use BS::HTTPD::Appgets /./; +use AnyEvent::HTTPD; +use AnyEvent::HTTPD::Appgets /./; my $cvar = AnyEvent->condvar; -my $httpd = BS::HTTPD->new (port => 9090); +my $httpd = AnyEvent::HTTPD->new (port => 9090); $httpd->reg_cb ( _ => sub { @@ -14,7 +14,7 @@ $httpd->reg_cb ( set_request ($req); o ""; - js ($BS::HTTPD::Appgets::JSON_JS); + js ($AnyEvent::HTTPD::Appgets::JSON_JS); js_ajaxobj_func "newajax"; o "

An AJAX example

"; js (<<'JS'); diff --git a/samples/capture_example b/samples/capture_example index b4e4113..3e1f1b9 100644 --- a/samples/capture_example +++ b/samples/capture_example @@ -1,12 +1,12 @@ #!/opt/perl/bin/perl use strict; use AnyEvent; -use BS::HTTPD; -use BS::HTTPD::Appgets; +use AnyEvent::HTTPD; +use AnyEvent::HTTPD::Appgets; my $cvar = AnyEvent->condvar; -my $httpd = BS::HTTPD->new (port => 9090); +my $httpd = AnyEvent::HTTPD->new (port => 9090); my $t; diff --git a/samples/delayed_example b/samples/delayed_example index f979524..3208950 100755 --- a/samples/delayed_example +++ b/samples/delayed_example @@ -1,10 +1,10 @@ #!/opt/perl/bin/perl use AnyEvent; -use BS::HTTPD; +use AnyEvent::HTTPD; my $cvar = AnyEvent->condvar; -my $httpd = BS::HTTPD->new (port => 9090); +my $httpd = AnyEvent::HTTPD->new (port => 9090); my $timer; $httpd->reg_cb ( diff --git a/samples/more_complex_example b/samples/more_complex_example index 597b8d9..4d05970 100755 --- a/samples/more_complex_example +++ b/samples/more_complex_example @@ -1,12 +1,12 @@ #!/opt/perl/bin/perl use AnyEvent; -use BS::HTTPD; -use BS::HTTPD::Appgets; +use AnyEvent::HTTPD; +use AnyEvent::HTTPD::Appgets; use CGI qw/escapeHTML/; my $cvar = AnyEvent->condvar; -my $httpd = BS::HTTPD->new (port => 9090); +my $httpd = AnyEvent::HTTPD->new (port => 9090); my @list = qw/Apples Other things/; diff --git a/samples/second_example b/samples/second_example index d7a370d..855019c 100755 --- a/samples/second_example +++ b/samples/second_example @@ -1,10 +1,10 @@ #!/opt/perl/bin/perl use AnyEvent; -use BS::HTTPD; +use AnyEvent::HTTPD; my $cvar = AnyEvent->condvar; -my $httpd = BS::HTTPD->new (port => 9090); +my $httpd = AnyEvent::HTTPD->new (port => 9090); $httpd->reg_cb ( _ => sub { diff --git a/samples/simple_example b/samples/simple_example index 658f8d2..29aad99 100755 --- a/samples/simple_example +++ b/samples/simple_example @@ -1,10 +1,10 @@ #!/opt/perl/bin/perl use AnyEvent; -use BS::HTTPD; +use AnyEvent::HTTPD; my $cvar = AnyEvent->condvar; -my $httpd = BS::HTTPD->new (port => 9090); +my $httpd = AnyEvent::HTTPD->new (port => 9090); $httpd->reg_cb ( _ => sub { diff --git a/t/00-load.t b/t/00-load.t index 0943c1b..787e569 100644 --- a/t/00-load.t +++ b/t/00-load.t @@ -3,7 +3,7 @@ use Test::More tests => 1; BEGIN { - use_ok( 'BS::HTTPD' ); + use_ok( 'AnyEvent::HTTPD' ); } -diag( "Testing BS::HTTPD $BS::HTTPD::VERSION, Perl $], $^X" ); +diag( "Testing AnyEvent::HTTPD $AnyEvent::HTTPD::VERSION, Perl $], $^X" ); diff --git a/t/pod-coverage.t b/t/pod-coverage.t index 8eb3954..d4a0236 100644 --- a/t/pod-coverage.t +++ b/t/pod-coverage.t @@ -16,12 +16,12 @@ plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" if $@; my %SPEC = ( - 'BS::HTTPD' => [qw/alloc_id cleanup handle_app_req start_cleanup/], - 'BS::HTTPD::Request' => [qw/form_id is_form_submit new/], - 'BS::HTTPD::HTTPConnection' => [qr/./], - 'BS::HTTPD::HTTPServer' => [qr/./], - 'BS::HTTPD::TCPConnection' => [qr/./], - 'BS::HTTPD::TCPListener' => [qr/./], + 'AnyEvent::HTTPD' => [qw/alloc_id cleanup handle_app_req start_cleanup/], + 'AnyEvent::HTTPD::Request' => [qw/form_id is_form_submit new/], + 'AnyEvent::HTTPD::HTTPConnection' => [qr/./], + 'AnyEvent::HTTPD::HTTPServer' => [qr/./], + 'AnyEvent::HTTPD::TCPConnection' => [qr/./], + 'AnyEvent::HTTPD::TCPListener' => [qr/./], ); my $cnt = scalar all_modules (); -- 2.11.4.GIT