Board index » cppbuilder » Weird Problem with Indy 9.0.50

Weird Problem with Indy 9.0.50


2008-02-28 06:14:42 PM
cppbuilder30
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

"Colin B Maharaj" < XXXX@XXXXX.COM >wrote in message
Quote
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.
Quote
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.
Quote
// 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