Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 23372
Status: resolved
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: dmuey [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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 }
From: DMUEY [...] cpan.org
Attached is a patch to Daemon.pm that accomplishes this.
--- Daemon.pm 2006-11-16 12:10:06.000000000 -0600 +++ Daemon.pm.new 2006-11-16 12:12:21.000000000 -0600 @@ -435,11 +435,12 @@ $self->force_last_request; } } - elsif (length($content)) { + elsif ($res->header('content-length') eq '0' || length($content) > 0) { $res->header("Content-Length" => length($content)); } else { $self->force_last_request; + $res->header('connection','close'); } print $self $res->headers_as_string($CRLF); print $self $CRLF; # separates headers and content
The later patch has been applied in 5.806. The former patch does not make much sense to me. Seems like a noop and it make the module spit out use of uninitialized value warnings.