🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #1869

Re: TIdHTTPServerf

#1869
From: Remy Lebeau (TeamB)
Date: Tue, 17 Oct 2006 01:08
34 lines
1976 bytes
"Christer Borgqvist" <christer.borgqvist10@bredband.net> wrote in message
news:4533fc25@newsgroups.borland.com...
> Hello all,
>
> I have a TIdHTTPServer and in the Connect event i do like this

Make sure you free the TServObj object in the OnDisconnect event.

> in the IdHTTPServerCommandGet like this

Are you setting a response if the request data is less than 10 characters?

> ResponseInfo->ContentStream = new
> TStringStream(dataptr->sResponse);

You don't need to wrap the Response string into a TStringStream.
TIdHTTPResponseInfo has a ContentText property that you can use instead:

    ResponseInfo->ContentText = dataptr->sResponse;

> ResponseInfo->ContentStream->Write("OK", 2 );

Why are you appending an OK to the end of the response data?

> the problem is that in the Taskmanager i can se that the
> handles is increase every time i fire the event, why?

I don't see you freeing anything.  But then again, the code you showed is
incompletely to begin with.  You didn't even show what your event handler is
actually doing.


Gambit
Technical Details
Message-ID: <45342e47$2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4533fc25@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,e98299ee94200151
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <4533fc25@newsgroups.borland.com>
Subject: Re: TIdHTTPServerf
Date: Mon, 16 Oct 2006 18:08:21 -0700
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 69.169.4.232
Message-ID: <45342e47$2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1161047623 69.169.4.232 (16 Oct 2006 18:13:43 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail