[fpc-pascal] CustHttpApp again, error: "Missing HTTP protocol version in request"
silvioprog
silvioprog at gmail.com
Fri Apr 25 15:18:03 CEST 2014
2014-04-25 10:05 GMT-03:00 silvioprog <silvioprog at gmail.com>:
> 2014-04-25 3:39 GMT-03:00 Michael Van Canneyt <michael at freepascal.org>:
> [...]
>
>> Damn windows returning 0 on read... Can you please test with the
>> following change:
>>
>>
>> Procedure FillBuffer;
>>
>> Var
>> R : Integer;
>>
>> begin
>> SetLength(FBuffer,ReadBufLen);
>> Repeat
>> r:=FSocket.Read(FBuffer[1],ReadBufLen);
>>
>> If r<0 then
>> Raise EHTTPServer.Create(SErrReadingSocket);
>> if R=0 then
>> Sleep(10);
>> Until (R<>0);
>> if (R<ReadBuflen) then
>> SetLength(FBuffer,r);
>> end;
>
>
> After apply this change, now when read returns 0, it freezes the app.,
> because the "sleep(10)" command is infinitely called. :/
>
> Damn windows!
>
I have no much experience with sockets on Windows, but I saw two links:
http://stackoverflow.com/questions/10526382/recv-returns-0
http://blog.netherlabs.nl/articles/2009/01/18/the-ultimate-so_linger-page-or-why-is-my-tcp-not-reliable
Seems that error occurs when client disconnects from server. :/
--
Silvio Clécio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140425/6880169d/attachment.html>
More information about the fpc-pascal
mailing list