question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to download the whole file served by HttpFile by wget or curl

See original GitHub issue

When I am serving a file with size over 70MB, wget or curl gets connection closed at around 30%

public class Main
{
    public static void main(String[] args)
    {
        Server server = Server.builder()
            .http(8080)
            .service("/test.txt", HttpFile.of(new File("C:\\temp\\20210727.txt")).asService())
            .build();
        CompletableFuture<Void> future = server.start();
        future.join();
    }
}
wget http://my-machine:8080/test.zip
--2022-06-09 00:01:46--  http://my-machine:8080/test.zip
Resolving ... 10.71.111.209
Connecting to ...|10.71.111.209|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104857953 (100M) [text/plain]
Saving to: ‘test.zip.1’

test.zip.1                     31%[==============>                                   ]  31.67M  3.04MB/s    in 10s

2022-06-09 00:02:12 (3.07 MB/s) - Connection closed at byte 33210368. Retrying.

I have no idea why it fails but other web server (like npm serve) and does not have any issue note that browser does not suffer from this issue

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
trustincommented, Jun 10, 2022

@ikhoon We may want to introduce a decorator that aborts the stream when there’s not enough traffic for a certain period of time, e.g. Abort the connection if less than 64KiB was transferred for the last 10 seconds.

0reactions
ngyukmancommented, Jun 13, 2022

Thanks, that would be awesome and helps anyone that would use armeria to serve something big

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does curl not work, but wget works? - Stack Overflow
For curl, it returns no output at all, but with wget, it returns the entire HTML source: Here are the 2 commands. I've...
Read more >
wget and curl stop very quickly and failed to download a file?
Adding a -v parameter to either curl or wget commands will show you that what you download has the text/html MIME-type, so a...
Read more >
Linux wget command help and examples - Computer Hope
wget is a free utility for non-interactive download of files from the web. ... it keeps retrying until the whole file is retrieved....
Read more >
Downloading files with curl
Downloading files with curl. How to download files straight from the command-line interface. The curl tool lets us fetch a given URL from...
Read more >
Error while downloading HTTPS files using wget - Ask Ubuntu
My problem is, I can't download http files in my college wifi. So when I try to download the file, wget will send...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found