Menu

#619 NSISdl doesn't finish download after content-length bytes

2.0 Series
closed-fixed
Plugin (101)
5
2007-05-23
2007-05-05
Greg Hazel
No

The NSISdl plugin make HTTP 1.0 requests, and wait for the server side to close to indicate download completion. Some (broken) HTTP 1.0 servers wait for the client side to close. This causes NSISdl to hang and eventually time out, when it has already received all of the bytes.

A reasonable compromise is for the client side to close after content-length number of bytes have been received.

Something like this does the trick:

if (sofar == cl)
{
bSuccess=TRUE;
error = "success";
}

Right before:
int data_downloaded = 0;

Discussion

  • Amir Szekely

    Amir Szekely - 2007-05-23

    Logged In: YES
    user_id=584402
    Originator: NO

    Thanks, fixed. However, I've added the test right after a timeout is discovered to preserve compatibility with broken servers that return wrong content-length or broken server-side scripts. Sometimes users will use false content-length just to NSISdl working with their script.

     
  • Amir Szekely

    Amir Szekely - 2007-05-23
    • assigned_to: nobody --> kichik
    • status: open --> closed-fixed
     

Log in to post a comment.