Board index » delphi » HTTPServer problem :(

HTTPServer problem :(

Hiya folks,

I'm using D5 with Indy 8.0.23 on Win2k Pro SP2.

I've written a service that uses the HTTPServer and basically writes the
request out to a disk file, looks for a response and sends it back.  Pretty
simple stuff.

However, after about 70-80 approx requests the HTTPServer dies.  There's no
error or exception reported - the entire exe just removes itself from
memory!

I've tried using the same code in a standard .exe any get the same results
:(

(The read/write code itself is also used in a TISAPIApplication without any
problems too)

Has anyone seen this behaviour before?  Is there anything I should watch out
for when using the HTTPServer component?  Are there any known issues with
this component in 8.0.23 of Indy (Can't see the Bug List at the moment).
Should I go 8.1?

TIA for any help (and sorry for so many qwestions :(  )

Regards

CP

 

Re:HTTPServer problem :(


Did you try checking it with Indy 8.1 ? (you can find it on Nevrona's FTP
Server -- ftp://indy81:ind...@nevrona.com). There have been some bug fixes
in the HTTP server. Please check and let us know if it still happens.

---
Sergio.

Re:HTTPServer problem :(


Thanks Sergio!

Well I got 8.1 installed thanx, but you guys have made some changes! :)

No more headers property in tRequestInfo?  I changed to rawHeaders and that
did the trick.  Is this a permanent feature or just a feature of the beta
process?  And cookies ... see you've fully implemented the RFC's too!

Anyway I eventually tracked my problem down to an invalid pointer (my bad
programming in other words <g>) and the requestInfo.contentStream.

Basically I have a tMemoryStream with the content I want to feed back.  What
I did was this:

// Create and Load memory stream etc ...
responseInfo.contentStream.copyFrom( memoryStream, memoryStream.size );
memoryStream.free;

// etc...
// OnRequestGet ends ...

Now when the system calls tResponseInfo.writeContent() it throws an invalid
pointer exception. Perhaps what I should have done is:

// Create and Load memory stream etc ...
responseInfo.contentStream.copyFrom( memoryStream, memoryStream.size );

responseInfo.writeHeaders;
responseInfo.writeContent;
responseInfo.contentStream := nil;

memoryStream.free;

// etc...
// OnRequestGet ends ...

What do you think?  At the moment I'm back to using contentText instead of
contentStream with a tStringStream instead of a tMemoryStream (which is the
way the demo HTTP Server does it too ).

Have you got any examples of how to use the contentStream properly? :)

Thanks for you help!

Regards

Cap'n C
USS Sprezzatura
NZZ-2001

Well I got 8.1 installed
"Sergio Perry - Team Indy" <per...@spidernet.com.cy> wrote in message
news:3b4aaeaa_1@dnews...

Quote
> Did you try checking it with Indy 8.1 ? (you can find it on Nevrona's FTP
> Server -- ftp://indy81:ind...@nevrona.com). There have been some bug fixes
> in the HTTP server. Please check and let us know if it still happens.

> ---
> Sergio.

Re:HTTPServer problem :(


Dear Sergio and Captain C,

I am experiencing the same problem.  I tried to get Indy 8.1
installed, but when I try to install the package in Delphi I get an
error about a registry setting missing or so and therefore the install
fails. What can I do?

Something about my code: I am developing an application which will
continue to listen for requests from a web application, i.e. it should
produce a wbmp file to be sent to a WAP device. Now the code:

procedure TMainForm.theIdHTTPServerCommandGet(AThread: TIdPeerThread;
  RequestInfo: TIdHTTPRequestInfo; ResponseInfo: TIdHTTPResponseInfo);
begin
  CreateWbmpFile('');
  ResponseInfo.ContentStream.CopyFrom(theStream, theStream.Size);
  ResponseInfo.ContentType := 'image/vnd.wap.wbmp';
  ResponseInfo.WriteHeader();
  ResponseInfo.WriteContent();
end;

After the call to CreateWbmpFile('') a wbmp image is stored in the
theStream (of type TMemoryStream). The method CopyFrom results in an
Access Violation: Read of Address 00000000. What can I do? Please
help! TIA

Kind regards,
Dobedani

Quote
"Captain C" <c...@sprezzNOSPAMatura.com> wrote in message <news:3b4c30c8_2@dnews>...
> Thanks Sergio!

> Well I got 8.1 installed thanx, but you guys have made some changes! :)

> No more headers property in tRequestInfo?  I changed to rawHeaders and that
> did the trick.  Is this a permanent feature or just a feature of the beta
> process?  And cookies ... see you've fully implemented the RFC's too!

> Anyway I eventually tracked my problem down to an invalid pointer (my bad
> programming in other words <g>) and the requestInfo.contentStream.

> Basically I have a tMemoryStream with the content I want to feed back.  What
> I did was this:

> // Create and Load memory stream etc ...
> responseInfo.contentStream.copyFrom( memoryStream, memoryStream.size );
> memoryStream.free;

> // etc...
> // OnRequestGet ends ...

> Now when the system calls tResponseInfo.writeContent() it throws an invalid
> pointer exception. Perhaps what I should have done is:

> // Create and Load memory stream etc ...
> responseInfo.contentStream.copyFrom( memoryStream, memoryStream.size );

> responseInfo.writeHeaders;
> responseInfo.writeContent;
> responseInfo.contentStream := nil;

> memoryStream.free;

> // etc...
> // OnRequestGet ends ...

> What do you think?  At the moment I'm back to using contentText instead of
> contentStream with a tStringStream instead of a tMemoryStream (which is the
> way the demo HTTP Server does it too ).

> Have you got any examples of how to use the contentStream properly? :)

> Thanks for you help!

> Regards

> Cap'n C
> USS Sprezzatura
> NZZ-2001

> Well I got 8.1 installed
> "Sergio Perry - Team Indy" <per...@spidernet.com.cy> wrote in message
> news:3b4aaeaa_1@dnews...
> > Did you try checking it with Indy 8.1 ? (you can find it on Nevrona's FTP
> > Server -- ftp://indy81:ind...@nevrona.com). There have been some bug fixes
> > in the HTTP server. Please check and let us know if it still happens.

> > ---
> > Sergio.

Other Threads