Copyright ©

Mongoose OS Forum

ATTENTION! This forum has moved to:

Do not post any new messages.

File downloads with mg_http_serve_file

marcelwirtzmarcelwirtz Germany
edited November 2018 in Mongoose Networking Library

Hey there,

i want to download files which are served with the mg_http_serve_file function. The problem i have is not getting the download startet but i get a timeout on the client side (libCurl library) if the file is so large that it can't be downloaded completely until the timeout is reached. I don't think that this is a libCurl problem because if i download the file from a normal webserver like Apache or Nginx i don't get a timeout on the libCurl side.

Is there something i missed? I put it together like it is mentioned here ->

Kind regards,


  • Frankly the web server implementation seems to have hiccups. I get less than 1 MB/s via localhost with zero cpu load and the upload is even more pathetic. You might want to try enlarging MG_TCP_IO_SIZE, maybe it helps (it did for uploads).

    Thanked by 1marcelwirtz
  • marcelwirtzmarcelwirtz Germany
    edited March 6

    Have to post again, because i had no time to test it earlier.

    The fix mentioned from numo68 sadly does not work.

    Again if i try downloading a file of 3.3 GB which is served with mg_http_serve_file i can download around 200 MB with cURL and then i get a cURL Error 28 which says "Timeout was reached", also i can not send other requests to the server while it is blocked with the transfer or another request.

    How can i fix this?

Sign In or Register to comment.