🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
2 messages
2 total messages Started by Colin B Maharaj Thu, 28 Feb 2008 10:14
Weird Problem with Indy 9.0.50
#34
Author: Colin B Maharaj
Date: Thu, 28 Feb 2008 10:14
27 lines
1976 bytes
Hi all I wrote this little web server wrapped using IdTCPServer
But it crashes under this condition..

1. Create a Connection to the server that will take a while to finish
2. While that connection is up abort that connection and create a
new one - but let the 1st thread still be active.
3. Let the 2nd connection finish sending out it's data.
4. Later when the 1st thread tries to send out it's data, it will
probably do some memory overrunning. This happens if you use

// Note connection was aborted earlier...
AThread->Connection->WriteStream(stream);
delete stream; //  <-- Crashes here...

but not

AThread->Connection->WriteBuffer(stream->Memory, stream->Size);
delete stream;

Why? Oh Why are am I talking about Indy 9.x when we have heard it
a thousand times we are using Indy 10.x?

Well I still have to move to Indy 10.x but just in case this issue
has propagated into Indy 10 maybe you guys/gals can look into this.

Cheers!
Colin B Maharaj
Re: Weird Problem with Indy 9.0.50
#35
Author: Remy Lebeau (TeamB)
Date: Thu, 28 Feb 2008 17:44
25 lines
1829 bytes
"Colin B Maharaj" <noreply@myhost.com> wrote in message 
news:47c68994@newsgroups.borland.com...

> 1. Create a Connection to the server that will take a while to finish
> 2. While that connection is up abort that connection and create a
> new one - but let the 1st thread still be active.

Please show your actual code that reproduces the problem.

> 4. Later when the 1st thread tries to send out it's data,
> it will probably do some memory overrunning.

If it is, then you likely coded it wrong, and are causing the overrun in 
your own code.

> // Note connection was aborted earlier...
> AThread->Connection->WriteStream(stream);
> delete stream; //  <-- Crashes here...

Where is stream declared?  Is it shared between both connections?  Or does 
each connection have its own TStream?


Gambit 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads