Subject: | PATCH: make HTTP::Daemon not hang on SSL requests |
Some clients hang when Content-length is not specified or 0 on SSL, this patch resolves that:
--- Daemon.pm.orig 2006-11-15 21:30:24.000000000 -0600
+++ Daemon.pm 2006-11-15 21:31:29.000000000 -0600
@@ -435,7 +435,7 @@
$self->force_last_request;
}
}
- elsif (length($content)) {
+ elsif ($res->header('content-length') eq '0' || length($content) > 0) {
$res->header("Content-Length" => length($content));
}
else {
This also allows SSL to work much more reliably:
--- Daemon.pm.orig 2006-11-15 21:30:24.000000000 -0600
+++ Daemon.pm 2006-11-15 21:35:19.000000000 -0600
@@ -440,7 +440,8 @@
}
else {
$self->force_last_request;
- }
+ $res->header('connection','close');
+ }
print $self $res->headers_as_string($CRLF);
print $self $CRLF; # separates headers and content
}