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;
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.