🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Indy 9 NNTP

#4383
From: John Borchers
Date: Fri, 18 Feb 2005 18:11
59 lines
3416 bytes
The answer is it needs the control period character at the end of the post

"\r\n.\r\n"

John

"John Borchers" <jborchers@nohere.rcn.com> wrote in message 
news:2Y-dnZ73hLhfvYvfRVn-hQ@rcn.net...
> All,
>
> I'm losing my Indy application in the Post() function. It only returns 
> after the news server connection times out and automatically disconnects 
> (5 minutes or so later). This code was working with the old Borland 
> sockets. Everything else with indy seems to port just fine. Any idea whats 
> wrong? The LineToStream function simply appends "\r\n"
>
> Why might the Post() function hang?
>
>       LineToStream("From: test@nomail.com");
>       LineToStream("Newsgroups: " + Group->Text);
>       AnsiString subLine="Subject: ";
>       subLine+=Subject->Text+" ";
>       subLine+=IntToStr(IndexFile->Data.Posting.ID)+" ("+curPos+
>                "\\"+total+")";
>       LineToStream(subLine);
>       // End of header is a blank line
>       LineToStream("");
>       TMemoryStream* fileMem=new TMemoryStream();
>       fileMem->LoadFromFile(search.Name);
>       //add this file size to the total post body size
>       TotalPostSize+=fileMem->Size;
>       //now add the file to the stream
>       FDataStream->Write("Just A Test\n\r",13);
>       //clean
>       do
>        {
>         // Set stream pointer to beginning of stream because TNntpCli will 
> post
>         // from the current position
>         FDataStream->Seek(0, soFromBeginning);
>         // Ask the component to post the stream. The posting occurs in the
>         // background ! We will receive the OnRequestDone event when done.
>         // It's in this event handler that the stream must be destroyed
>         //set the group
>         Label4->Caption="Posting "+subLine;
>         //check the connection
>         try
>          {
>           CheckConnect();
>           IdNNTP1->SelectGroup(Group->Text);
>           IdNNTP1->Post(FDataStream);
>          }
>         catch(Exception &E)
>          {
>           ShowMessage("Problem because "+E.Message+" during posting.");
>          }
>
>
> 
Technical Details
Message-ID: <z4SdnXg5MLjKrYvfRVn-ug@rcn.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.rcn.net!news.rcn.net.POSTED!not-for-mail
References: <2Y-dnZ73hLhfvYvfRVn-hQ@rcn.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,95a0a99bcb958c6f
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.rcn.net!news.rcn.net.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 18 Feb 2005 12:13:43 -0600
From: "John Borchers" <jborchers@nohere.rcn.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <2Y-dnZ73hLhfvYvfRVn-hQ@rcn.net>
Subject: Re: Indy 9 NNTP
Date: Fri, 18 Feb 2005 13:11:56 -0500
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Response
Message-ID: <z4SdnXg5MLjKrYvfRVn-ug@rcn.net>
Lines: 61
NNTP-Posting-Host: 65.78.104.119
X-Trace: sv3-qsakAyMBrcYSpP204MC2seoSJkontsHt6xIAjTLgITsLKyHkWn/TXR/fTVw/h5y0vgY5+DS+2stN8Jp!iCTvuVqv16TCFKPanu/IMCaP0grPV27nFKGxYf04DukiZajdfZ3Nch/s8ILB++8D
X-Complaints-To: abuse@rcn.net
X-DMCA-Complaints-To: abuse@rcn.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.31