Article View: borland.public.cppbuilder.internet.socket
Article #4915Re: TIdHTTP end of content problem
From: Ted Tripp
Date: Tue, 07 Dec 2004 19:50
Date: Tue, 07 Dec 2004 19:50
39 lines
2536 bytes
2536 bytes
FYI--StringReplace does not work. Can only assume it is identifying the \0 as the end of the string rather than the length. "Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message news:41b41051$1@newsgroups.borland.com... > > "Ted Tripp" <ttripp@rankexec.com> wrote in message > news:41b25214@newsgroups.borland.com... > >> OK--my solution--roughly > > There is a bug in that code - you are ignoring the AnsiString's last > character when checking for '\0' characters. Your loop should be using > the > '<=' operator instead of '<'. > > Also, you could do away with the loop altogether by just using > StringReplace() instead of looping manually. > >> Oddly, the asBigString.Length() reported an accurate size > > As well it should. The string returned by TIdHTTP will contains all of > the > transmitted characters, regardless of what they actually are. The actual > characters are irrelevant to the transmission, they are stored in the > AnsiString as-is. > >> Not sure why it would truncate the string and then report it a >> size well past what it considered the end of the string. > > The only way that can happen is if your own code is treating the > AnsiString > content as a null-terminated C string rather than a true AnsiString. > > > Gambit > > >
Technical Details
Message-ID:
<41b60987@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed.bit.nl!newsfeed.bit.nl!feeder2.cambrium.nl!feed.tweaknews.nl!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<41b15c54$1@newsgroups.borland.com> <41b25214@newsgroups.borland.com> <41b41051$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,6b94060483c79e05 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Ted Tripp" <ttripp@rankexec.com> From: "Ted Tripp" <ttripp@rankexec.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <41b15c54$1@newsgroups.borland.com> <41b25214@newsgroups.borland.com> <41b41051$1@newsgroups.borland.com> Subject: Re: TIdHTTP end of content problem Date: Tue, 7 Dec 2004 13:50:28 -0600 Lines: 41 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 216.160.57.213 Message-ID: <41b60987@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1102449031 216.160.57.213 (7 Dec 2004 11:50:31 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed.bit.nl!newsfeed.bit.nl!feeder2.cambrium.nl!feed.tweaknews.nl!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail