File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -22,4 +22,4 @@ requires:
2222 Digest::SHA1 : ' 2'
2323 HTTP::Easy : ' 0.03'
2424 JSON::XS : ' 3'
25- version : ' 1.9999 '
25+ version : ' 1.99992 '
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ AnyEvent::HTTP::Server - AnyEvent HTTP/1.1 Server
77=cut
88
99BEGIN {
10- our $VERSION = ' 1.99991 ' ;
10+ our $VERSION = ' 1.99992 ' ;
1111}
1212
1313# use common::sense;
@@ -410,6 +410,14 @@ sub incoming {
410410 $self -> {active_requests }--;
411411 $ixx = $pos + $h {' content-length' };
412412 }
413+ elsif ( $method eq ' PING' ) {
414+ my ( $header_str , $content ) = ref $self -> {ping_sub } eq ' CODE' ? $self -> {ping_sub }-> () : (' 200 OK' , ' Pong ' .time ()." \n " );
415+ my $str = " HTTP/1.1 $header_str${LF} Connection:close${LF} Content-Type:text/plain${LF} Content-Length:" .length ($content )." ${LF}${LF} " .$content ;
416+ $write -> (\$str );
417+ $write -> (\undef );
418+ $self -> {active_requests }--;
419+ $ixx = $pos + $h {' content-length' };
420+ }
413421 elsif ( $self -> {ping } and $method eq " GET" and $uri =~ m { ^/ping( \Z | \? )} sox ) {
414422 my ( $header_str , $content ) = ref $self -> {ping_sub } eq ' CODE' ? $self -> {ping_sub }-> () : (' 200 OK' , ' Pong' );
415423 my $str = " HTTP/1.1 $header_str${LF} Connection:close${LF} Content-Type:text/plain${LF} Content-Length:" .length ($content )." ${LF}${LF} " .$content ;
You can’t perform that action at this time.
0 commit comments