Hi guys, I created a web app with integrated web server (indy 10) to replicate errors. I would like your opinion on this. What's wrong?
(unless you disable that option in the TIdHTTP.HTTPOptions property)
One question, your suggestion is like my attachment?
How? I searched but only HTTPOptions value are:
// Protocol options TIdHTTPOption = (hoInProcessAuth, hoKeepOrigProtocol, hoForceEncodeParams); TIdHTTPOptions = set of TIdHTTPOption;
TIdHTTPOption = (hoInProcessAuth, hoKeepOrigProtocol, hoForceEncodeParams,
hoNonSSLProxyUseConnectVerb, hoNoParseMetaHTTPEquiv, hoWaitForUnexpectedData,
hoTreat302Like303, hoNoProtocolErrorException, hoNoReadMultipartMIME,
hoNoParseXmlCharset, hoWantProtocolErrorContent, hoNoReadChunked
);
I see but lazarus have install indylaz v10.2.0.3 but i have only: hoInProcessAuth, hoKeepOrigProtocol, hoForceEncodeParams
where I find the version of indy 10 that contains all the options you say?!
Ok, i find a correct version of indy. Now i change with your suggestion. But now my program closed when into browser page run fast. If you try to quickly reload the page without waiting for the page to load before the program closes without giving any kind of error. Why?
Have you tried to download and run my last attached example? Have you tried to run it?
You'll see that if you try to run my program and quickly load the page in the browser, the http server closes itself without giving an error.
You know a Lazarus developer from Indy team?!
I found the place where the problem is generated, in the IdHTTP unit there is the function
function TIdCustomHTTP.Get(AURL: string {$IFDEF STRING_IS_ANSI}; ADestEncoding: IIdTextEncoding = nil{$ENDIF} ): string; begin Result := Get(AURL, []{$IFDEF STRING_IS_ANSI}, ADestEncoding{$ENDIF}); end;
It happens that if the server receives two simultaneous calls it closes. This is on linux and on mac osx. Only I do not understand how to solve. Some idea?
Ok, I've done other tests and I understand that the problem is not the GET call, the problem is that the http server crashes when idhttpserver1.OnCommandGet is called the second time but has not finished running the first one yet.
I modified the source, if you open it you will see that now there is a sleep (4000); in order to give you time to load the page in the browser the second time.
If I open the browser from the same computer it is the server and very quickly launch two pages the program closes without daring errors.
I do not doubt it is a mistake. I'm asking for help precisely because I do not understand where I'm wrong.
What kind of crash EXACTLY? What is your logging telling you?
As I have already told you, it does not report any errors, simply the program closes itself.