]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/HTTP.pm
http: use Plack::HTTPParser for HTTP parsing
[public-inbox.git] / lib / PublicInbox / HTTP.pm
index 0675f6a68b35ee1fc0a2424a43ab510a6bfe088f..a5c56e2573946a1ba179c8d3eb73076585053f43 100644 (file)
@@ -13,7 +13,7 @@ use warnings;
 use base qw(Danga::Socket);
 use fields qw(httpd env rbuf input_left remote_addr remote_port);
 use Fcntl qw(:seek);
-use HTTP::Parser::XS qw(parse_http_request); # supports pure Perl fallback
+use Plack::HTTPParser qw(parse_http_request); # XS or pure Perl
 use HTTP::Status qw(status_message);
 use HTTP::Date qw(time2str);
 use IO::File;
@@ -371,6 +371,13 @@ sub quit {
 sub event_hup { $_[0]->close }
 sub event_err { $_[0]->close }
 
+sub write ($$) : method {
+       my PublicInbox::HTTP $self = $_[0];
+       return 1 if (defined($_[1]) && ref($_[1]) eq '' && $_[1] eq '');
+
+       $self->SUPER::write($_[1]);
+}
+
 # for graceful shutdown in PublicInbox::Daemon:
 sub busy () {
        my ($self) = @_;