[bugfix] chunked transfer http encoding
Valentin Dudouyt <[email protected]> Thu, 13 Oct 2011 15:35:26 +0700
| Newsgroups | gmane.comp.lang.perl.modules.lwp |
|---|---|
| Message-ID | <[email protected]> |
LWP hangs when POSTing on server that uses chunked transfer-encoding. The solution is to prevent reading while file is not uploaded completely. Please, take a look on attachment (diff of lib/LWP/Protocol/http.pm). Best Regards, Valentin.
http.pm.diff
(text/x-patch, 189 B)
269a270
> my $strobe_read;
302c303
< if (defined($rbits) && $rbits =~ /[^\0]/) {
---
> if (defined($rbits) && $rbits =~ /[^\0]/ && !$strobe_read) {
334a336
> $strobe_read = 1;