Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : Re: IdNNTP - 500 Error from Server
| Subject: | Re: IdNNTP - 500 Error from Server |
| Posted by: | "Jack MacRank" (ja..@macrank.com) |
| Date: | Thu, 22 Jun 2006 19:08:39 |
Thanks for your response...please read below:
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:449b16ed$1@newsgroups.borland.com...
>
> "Jack MacRank" <jack@macrank.com> wrote in message
> news:449b12ac$1@newsgroups.borland.com...
>
>> I ran a sniffer and got this:
>>
>> From Server: 240 post accepted.
>> From Client: Quit
>> From Server: 500 syntax error or unknown command
>> From Server: 205 goodbye
>
> Looks like either you are receiving the responses in the wrong order, or
> else the server is sending an extra response that is shouldn't be. The
> last
> 205 response is what belongs with the Quit command.
> What command is the 240 in response to?
Probably the IdNNTP.Post()?
> What is the rest of the communication look like?
Here is some more of the sniffer output:
C: POST
S: 340 send article
C: *This is where the header and body data transfer*
S: 240 post accepted. *This was sent to the client after the rest of the
body followed by a period was sent*
C: Quit
S: 500 syntax error or unknown command *This was sent immediately after the
client sent Quit*
S: 205 goodbye
> What does your code look like?
Here is my code for the test posting:
procedure TfrmMain.btnPostClick(Sender: TObject);
var
postStream: TMemoryStream;
partStream: TFileStream;
procedure Msg(ALine: string);
begin
ALine := ALine + #13 + #10;
postStream.Write(ALine[1], Length(ALine));
end;
begin
nntp.Connect;
postStream := TMemoryStream.Create;
try
Msg('From: Jack MacRank' + ' <' + 'jack@macrank.com' + '>');
Msg('Newsgroups: alt.binaries.test');
Msg('Subject: CommandPost2 Test 22');
Msg('Organization: None');
Msg('X-Newsreader: CommandPost v2.00');
Msg('');
partStream := TFileStream.Create('C:\odac7.exe.ntx', fmOpenRead or
fmShareDenyNone);
try
postStream.CopyFrom(partStream, partStream.Size);
finally
partStream.Free;
end;
Msg('.');
postStream.Position := 0;
nntp.Post(postStream);
finally
postStream.Free;
end;
nntp.Disconnect(False);
end;