libwww-perl / libwww-perl/HTTP-Daemon

HTTP client hangs if zero-length file sent

Open
#54 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
6
Forks
17
PR merge metrics
No merged PRs in 30d

Description

https://github.com/libwww-perl/HTTP-Daemon/blob/b902312e478164bb5e8a9ab921cf6f5a7604a335/lib/HTTP/Daemon.pm#L546

Using send_file_response with empty file suppress "Content-Length" header line, because "if $size" contstruction treated as false.

Then library succsessfully complete operation with RC_OK code, but HTTP client waits data from server, and timeout occured as a result.

Removing "if $size" resolve this problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at lib/HTTP/Daemon.pm around line 546 and inspect send_file_response for the zero-size condition. Reproduce a response using an empty file and verify that the response includes Content-Length: 0 and the HTTP client completes without timing out.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
networking
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.