🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: IdHTTP in a thread crashes when using CodeGuard

#1836
From: tsokas
Date: Tue, 10 Oct 2006 08:52
22 lines
2165 bytes
Hi Remy, thanks indeed for your quick answers...

> You are not protecting the thread from exceptions.  You should wrap the call
> to Get() in a try..catch or try..finally block, or use the STL's auto_ptr
> class, to ensure that the TIdHTTP is freed properly even when Get() throws
> an exception when the download fails.

In fact the code I presented is actually a small project I created just
to figure out what is going wrong. The problem appeared in a larger
project, in which I do use auto_ptr's and try-catch blocks.

The idea is to use 50 or more threads to download chunks of the same
file (segmented doanloading) using IdHTTP's ContentRangeStart and
ContentRangeEnd facility (the server I'm testing my program against
does support this facility).

> How much data are you actually downloading from the URL?

The file I'm testing the project with is 18MB.

Nicolas
Technical Details
Message-ID: <1160470350.947063.299430@b28g2000cwb.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!b28g2000cwb.googlegroups.com!not-for-mail
References: <1160465153.402484.273810@h48g2000cwc.googlegroups.com> <452b5ac8$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,b248989b16d7f878
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!b28g2000cwb.googlegroups.com!not-for-mail
From: tsokas@gmail.com
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: IdHTTP in a thread crashes when using CodeGuard
Date: 10 Oct 2006 01:52:31 -0700
Organization: http://groups.google.com
Lines: 23
Message-ID: <1160470350.947063.299430@b28g2000cwb.googlegroups.com>
References: <1160465153.402484.273810@h48g2000cwc.googlegroups.com>
   <452b5ac8$1@newsgroups.borland.com>
NNTP-Posting-Host: 194.177.215.42
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1160470355 22737 127.0.0.1 (10 Oct 2006 08:52:35 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 10 Oct 2006 08:52:35 +0000 (UTC)
In-Reply-To: <452b5ac8$1@newsgroups.borland.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: b28g2000cwb.googlegroups.com; posting-host=194.177.215.42;
   posting-account=LB_1bg0AAABl0H9GiltpD-YjI3JGPk1V