You are not logged in.
Pages: 1
I see, I might have been misslead by the Sample. you need to create clones to make it work.
Sorry about this.
BTW:
http://msdn.microsoft.com/en-us/library … 85%29.aspx
pOverlapped [in]
For asynchronous calls, set pOverlapped to point to an OVERLAPPED structure; for synchronous calls, set to NULL.
A synchronous call blocks until all response data specified in the pHttpResponse parameter is sent, whereas an asynchronous call immediately returns ERROR_IO_PENDING and the calling application then uses GetOverlappedResult or I/O completion ports to determine when the operation is completed.
As far as I see the server uses the synchronous call...
I even tried different computers (downloading from a laptop, browsing from my IPad). Same effect.
And the PC the "server sample" is running on has more than enough power to handle this with ease.
I''m not so sure.
Thinking about all those casted pchars in the Resp structure and the filehandle itself. I have some doubts all this gets duplicated in the http.sys so that there are no memory allocation problems and free floating filehandles...
I simply used the Sample 09 - HttpApi web server, selected a 4 GB file to download (takes even local 2 minutes) and tried to open the page in another browser tab and nothing came up until the download was done.
After a little bit of of debugging it showed that
procedure THttpApiServer.Execute;
[...]
Http.SendHttpResponse(fReqQueue,Req^.RequestId,0,Resp^,nil,bytesSent);
finally
FileClose(FileHandle);
end;
[...]
the server does wait for Http.SendHttpResponse to finish.
Maybe there should also be a thread pool for client requests like in the delphi httpserver...
I played around with the httpAPI server a little bit. Is it meant to be a blocking single client server?
I noticed no other client is processed if a really big response (as example a 2 GB file) is send...
Pages: 1