@@ -8,21 +8,11 @@ AnyEvent::HTTP::Server - AnyEvent HTTP/1.1 Server
88
99our $VERSION ;
1010BEGIN {
11- $VERSION = ' 1.99994 ' ;
11+ $VERSION = ' 1.99995 ' ;
1212}
1313
14- # use common::sense;
15- # use 5.008008;
16- # use strict;
17- # use warnings;
18- # no warnings 'uninitialized';
19- # use mro 'c3';
2014use AnyEvent::HTTP::Server::Kit;
2115
22- # use Exporter;
23- # our @ISA = qw(Exporter);
24- # our @EXPORT_OK = our @EXPORT = qw(http_server);
25-
2616use AnyEvent;
2717use AnyEvent::Socket;
2818use AnyEvent::Handle;
@@ -37,8 +27,6 @@ use Compress::Zlib ();
3727use MIME::Base64 ();
3828use Time::HiRes qw/ gettimeofday/ ;
3929
40- # use Carp 'croak';
41-
4230use AnyEvent::HTTP::Server::Req;
4331
4432our $MIME = Encode::find_encoding(' MIME-Header' );
@@ -593,14 +581,8 @@ sub incoming {
593581 # warn "call for part $hd{name} ($last)";
594582 $cb -> ( $last && $idx == -1 ? 1 : 0,$part ,\%hd );
595583 }
596- # warn "just return";
597- # if ($last) {
598- # warn "leave with $body";
599- # }
600584 };
601585 }
602- # elsif ( $h{'content-type'} =~ m{^application/x-www-form-urlencoded(?:\Z|\s*;)}i and exists $rv[0]{form} ) {
603-
604586 elsif ( exists $rv [0]{form } ) {
605587 my $body = ' ' ;
606588 $r {on_body } = sub {
@@ -792,47 +774,6 @@ sub graceful {
7927741; # End of AnyEvent::HTTP::Server
793775__END__
794776
795- sub http_server($$&) {
796- my ($lhost,$lport,$reqcb) = @_;
797-
798- # TBD
799-
800- return $self;
801- }
802-
803- sub __old_stop {
804- my ($self,$cb) = @_;
805- delete $self->{aw};
806- close $self->{socket};
807- if (%{$self->{con}}) {
808- $log->debugf("Server have %d active connectinos while stopping...", 0+keys %{$self->{con}});
809- my $cv = &AE::cv( $cb );
810- $cv->begin;
811- for my $key ( keys %{$self->{con}} ) {
812- my $con = $self->{con}{$key};
813- $log->debug("$key: connection from $con->{host}:$con->{port}: $con->{state}");
814- if ($con->{state} eq 'idle' or $con->{state} eq 'closed') {
815- $con->close;
816- delete $self->{con}{$key};
817- use Devel::FindRef;
818- warn "closed <$con> ".Devel::FindRef::track $con;
819- } else {
820- $cv->begin;
821- $con->{close} = sub {
822- $log->debug("Connection $con->{host}:$con->{port} was closed");
823- $cv->end;
824- };
825- }
826- }
827- if (%{$self->{con}}) {
828- $log->debug("Still have @{[ 0+keys %{$self->{con}} ]}");
829- }
830- $cv->end;
831- } else {
832- $cb->();
833- }
834- }
835-
836777=head1 SYNOPSIS
837778
838779 use AnyEvent::HTTP::Server;
0 commit comments