 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
C Albrecht Guest
|
Posted: Thu Jan 29, 2004 6:26 pm Post subject: NNTPServer errof |
|
|
Any body know this one?
I am using Delphi 6/pro and Indy 9.14
Building Picsi NewsServer
My problem is as follows when posting the first time it runs fine
but the second time I get a big error ( my most recent code seems to reduce
the error from catastrophic to just plain bad ,
no more blue screen )
error:
Outlook Express could not post your message. Subject 'TW0', Account:
'127.0.0.1', Server: '127.0.0.1', Protocol: NNTP, Server Response: '503
Access violation at address 004A034C in module 'PICSINEWS.EXE'. Read of
address FFFFFFFF', Port: 119, Secure(SSL): No, Server Error: 503, Error
Number: 0x800CCCA9
Code:
procedure TServer.idNNTPServerPost(AThread: TIdNNTPThread;
var VPostOk: Boolean; var VErrorText: String);
var
SR : TidMessage;
head,body : TStrings;
begin
DisplayMessage('News: ' + AThread.Connection.Socket.Binding.PeerIP +
' Posting ' );
Head := TStringList.Create;
Body := TStringList.Create;
SR := TidMessage.Create( Self );
SR.Headers.Clear;
SR.Body.Clear;
if not assigned( SR.Headers ) then SR.Create( self );
if not assigned( SR.body ) then SR.Create( self );
VPostOK := true;
VErrorText := '';
try
AThread.Connection.Capture( Head , '');
AThread.Connection.Capture( Body , '.');
SR.Headers.AddStrings( head );
SR.Body.AddStrings( body );
except
on e: exception do
begin
VPostOK := false;
VErrorText := e.Message;
end;
end;
SR.ProcessHeaders;
if ( SR.NewsGroups.Count > 1 ) and ( not cbMultiPost.Checked ) then
begin
VErrorText := 'Sorry no multi posting allower';
VPostOK := false;
exit;
end;
SaveMessage( SR );
head.Free;
body.Free;
SR.Free;
end;
--
Thanks,
Charles Albrecht
free software at http://www.cwalbrec.com
Home of Back Door Guard
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Jan 29, 2004 7:42 pm Post subject: Re: NNTPServer errof |
|
|
"C Albrecht" <cwalbrec (AT) NoSpamsover (DOT) net> wrote
| Quote: | Access violation at address 004A034C in module
'PICSINEWS.EXE'. Read of address FFFFFFFF
|
An AccessViolation at address FFFFFFFF means that a NULL pointer was
referenced..
| Quote: | DisplayMessage('News: ' + AThread.Connection.Socket.Binding.PeerIP +
' Posting ' );
|
What does DisplayMessage() do?
| Quote: | SR.Headers.Clear;
SR.Body.Clear;
|
You don't need to Clear() anything, they are already empty since you just
created the TIdMessage in the line above them.
| Quote: | if not assigned( SR.Headers ) then SR.Create( self );
if not assigned( SR.body ) then SR.Create( self );
|
What are you trying to do with those lines exactly?
| Quote: | AThread.Connection.Capture( Head , '');
AThread.Connection.Capture( Body , '.');
SR.Headers.AddStrings( head );
SR.Body.AddStrings( body );
|
You could just Capture() into the TIdMessage directly and remove the
TStringList instances altogether:
AThread.Connection.Capture( SR.Head, '' );
AThread.Connection.Capture( SR.Body, '.');
| Quote: | if ( SR.NewsGroups.Count > 1 ) and ( not cbMultiPost.Checked ) then
|
You should not be accessing VCL components from the main thread directly
like that. Indy servers are multithreaded, and most of the VCL is not
thread-safe. All of the event handlers in Indy servers that have an AThread
parameter are triggered in the context of the specified thread, not the main
VCL thread. You must use the thread's Synchronize() method when accessing
components of the main thread in order to access them safely.
| Quote: | SaveMessage( SR );
|
What does SaveMessage() do exactly?
Gambit
|
|
| Back to top |
|
 |
C Albrecht Guest
|
Posted: Fri Jan 30, 2004 6:29 am Post subject: Re: NNTPServer errof |
|
|
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote
| Quote: |
"C Albrecht" <cwalbrec (AT) NoSpamsover (DOT) net> wrote in message
news:401950ef$1 (AT) newsgroups (DOT) borland.com...
Access violation at address 004A034C in module
'PICSINEWS.EXE'. Read of address FFFFFFFF
An AccessViolation at address FFFFFFFF means that a NULL pointer was
referenced..
DisplayMessage('News: ' + AThread.Connection.Socket.Binding.PeerIP +
' Posting ' );
What does DisplayMessage() do?
DisplayMessage ( Log to file ); |
| Quote: |
SR.Headers.Clear;
SR.Body.Clear;
You don't need to Clear() anything, they are already empty since you just
created the TIdMessage in the line above them.
if not assigned( SR.Headers ) then SR.Create( self );
if not assigned( SR.body ) then SR.Create( self );
What are you trying to do with those lines exactly?
AThread.Connection.Capture( Head , '');
AThread.Connection.Capture( Body , '.');
SR.Headers.AddStrings( head );
SR.Body.AddStrings( body );
You could just Capture() into the TIdMessage directly and remove the
TStringList instances altogether:
AThread.Connection.Capture( SR.Head, '' );
AThread.Connection.Capture( SR.Body, '.');
Tryed this ( Blue Screen error big creash ). |
| Quote: | if ( SR.NewsGroups.Count > 1 ) and ( not cbMultiPost.Checked ) then
You should not be accessing VCL components from the main thread directly
like that. Indy servers are multithreaded, and most of the VCL is not
thread-safe. All of the event handlers in Indy servers that have an
AThread
parameter are triggered in the context of the specified thread, not the
main
VCL thread. You must use the thread's Synchronize() method when accessing
components of the main thread in order to access them safely.
SaveMessage( SR );
What does SaveMessage() do exactly?
|
Saves the message to a file and updates data files...
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Jan 30, 2004 7:23 am Post subject: Re: NNTPServer errof |
|
|
"C Albrecht" <cwalbrec (AT) NoSpamsover (DOT) net> wrote
| Quote: | What does DisplayMessage() do?
DisplayMessage ( Log to file );
|
I meant, what does its actual code look like? Are you sure that the AV is
not occuring in it?
If you step through the code with the debugger, what is the EXACT line that
is actually throwing the exception?
| Quote: | AThread.Connection.Capture( SR.Head, '' );
AThread.Connection.Capture( SR.Body, '.');
Tryed this ( Blue Screen error big creash ).
|
Those lines should work just fine. Those same lines are used inside Indy
itself in several places without problem.
| Quote: | What does SaveMessage() do exactly?
Saves the message to a file and updates data files...
|
Again, what does the actual code look like, and are you sure the exception
in question is not coming from it?
Gambit
|
|
| Back to top |
|
 |
C Albrecht Guest
|
Posted: Fri Jan 30, 2004 8:11 am Post subject: Re: NNTPServer errof |
|
|
Many Thanks,
I have bin going through code all night
boy did I miss this one ( one of the calls in Save message used ULock , and
of course two .free = crash )
it of course was locked as I was directly accessing the id message Tstrings
thanks much
and have fun
Charles
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote
| Quote: |
"C Albrecht" <cwalbrec (AT) NoSpamsover (DOT) net> wrote in message
news:4019fa5a$1 (AT) newsgroups (DOT) borland.com...
What does DisplayMessage() do?
DisplayMessage ( Log to file );
I meant, what does its actual code look like? Are you sure that the AV is
not occuring in it?
If you step through the code with the debugger, what is the EXACT line
that
is actually throwing the exception?
AThread.Connection.Capture( SR.Head, '' );
AThread.Connection.Capture( SR.Body, '.');
Tryed this ( Blue Screen error big creash ).
Those lines should work just fine. Those same lines are used inside Indy
itself in several places without problem.
What does SaveMessage() do exactly?
Saves the message to a file and updates data files...
Again, what does the actual code look like, and are you sure the exception
in question is not coming from it?
Gambit
|
|
|
| Back to top |
|
 |
C Albrecht Guest
|
Posted: Sun Feb 01, 2004 7:58 am Post subject: Re: NNTPServer errof |
|
|
Thanks Remy
It seems to work well enough to try a few days of testing before I start
to add the user base
and news and mail clients for the time being I'm trying it out on a dsl line
at news://207.136.234.16 port 2119
I'll see how it goes
Have fun
Charles
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote
| Quote: |
"C Albrecht" <cwalbrec (AT) NoSpamsover (DOT) net> wrote in message
news:4019fa5a$1 (AT) newsgroups (DOT) borland.com...
What does DisplayMessage() do?
DisplayMessage ( Log to file );
I meant, what does its actual code look like? Are you sure that the AV is
not occuring in it?
If you step through the code with the debugger, what is the EXACT line
that
is actually throwing the exception?
AThread.Connection.Capture( SR.Head, '' );
AThread.Connection.Capture( SR.Body, '.');
Tryed this ( Blue Screen error big creash ).
Those lines should work just fine. Those same lines are used inside Indy
itself in several places without problem.
What does SaveMessage() do exactly?
Saves the message to a file and updates data files...
Again, what does the actual code look like, and are you sure the exception
in question is not coming from it?
Gambit
|
|
|
| Back to top |
|
 |
C Albrecht Guest
|
Posted: Mon Feb 02, 2004 7:21 am Post subject: Re: NNTPServer errof |
|
|
Hi Again , Remy
One other thing has come up I need to know witch event is going to fire on
the command 'LIST NEWSGROUPS'
right now I only get back '..' followed by a '.'
As I want to be able to send Descriptions with the newsgroup list
Thanks much
Charles
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote
| Quote: |
"C Albrecht" <cwalbrec (AT) NoSpamsover (DOT) net> wrote in message
news:4019fa5a$1 (AT) newsgroups (DOT) borland.com...
What does DisplayMessage() do?
DisplayMessage ( Log to file );
I meant, what does its actual code look like? Are you sure that the AV is
not occuring in it?
If you step through the code with the debugger, what is the EXACT line
that
is actually throwing the exception?
AThread.Connection.Capture( SR.Head, '' );
AThread.Connection.Capture( SR.Body, '.');
Tryed this ( Blue Screen error big creash ).
Those lines should work just fine. Those same lines are used inside Indy
itself in several places without problem.
What does SaveMessage() do exactly?
Saves the message to a file and updates data files...
Again, what does the actual code look like, and are you sure the exception
in question is not coming from it?
Gambit
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Feb 02, 2004 9:19 am Post subject: Re: NNTPServer errof |
|
|
"C Albrecht" <cwalbrec (AT) NoSpamsover (DOT) net> wrote
| Quote: | I need to know witch event is going to fire on the
command 'LIST NEWSGROUPS'
|
The OnListGroups event.
However, TIdNNTPServer does not natively support the NEWSGROUPS extension to
the LIST command. If you need to detect that, you will have to rewrite
TIdNNTPServer yourself unless someone from Indy can implement it for you.
It is currently not implemented in either Indy 9 or 10.
Gambit
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Feb 02, 2004 9:27 am Post subject: Re: NNTPServer errof |
|
|
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote
| Quote: | However, TIdNNTPServer does not natively support the NEWSGROUPS
extension to the LIST command. If you need to detect that, you will have
to
rewrite TIdNNTPServer yourself unless someone from Indy can implement it
for you. It is currently not implemented in either Indy 9 or 10.
|
Actually, it is implemented, it is just not implemented fully. The command
itself is registered with the command handlers, but there is no event
handler implemented for it, the command simply sends back an empty response
to the client.
Gambit
|
|
| Back to top |
|
 |
C Albrecht Guest
|
Posted: Mon Feb 02, 2004 5:45 pm Post subject: Re: NNTPServer errof |
|
|
Ok So I take a stab at completing it
I will send the code when I do
Charles
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote
| Quote: |
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote in
message
news:401e1460$1 (AT) newsgroups (DOT) borland.com...
However, TIdNNTPServer does not natively support the NEWSGROUPS
extension to the LIST command. If you need to detect that, you will
have
to
rewrite TIdNNTPServer yourself unless someone from Indy can implement it
for you. It is currently not implemented in either Indy 9 or 10.
Actually, it is implemented, it is just not implemented fully. The
command
itself is registered with the command handlers, but there is no event
handler implemented for it, the command simply sends back an empty
response
to the client.
Gambit
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Feb 02, 2004 10:46 pm Post subject: Re: NNTPServer errof |
|
|
"C Albrecht" <cwalbrec (AT) NoSpamsover (DOT) net> wrote
| Quote: | Ok So I take a stab at completing it
I will send the code when I do
|
I have just been given the go-ahead from the Indy team to implement the
necessary support into the official code, so I will do that tonight if you
are willing to wait a day or so for the official implementation.
Gambit
|
|
| Back to top |
|
 |
C Albrecht Guest
|
Posted: Tue Feb 03, 2004 3:54 am Post subject: Re: NNTPServer errof |
|
|
Already done
Up and running on my test server at news://207.136.234.16 Port 2119
Its an easy enough install but putting back Indy into Delphi is not always
easy but we run
I have posted the new code in attachments have a look
Thanks
Charles
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote
| Quote: |
"C Albrecht" <cwalbrec (AT) NoSpamsover (DOT) net> wrote in message
news:401e8d42 (AT) newsgroups (DOT) borland.com...
Ok So I take a stab at completing it
I will send the code when I do
I have just been given the go-ahead from the Indy team to implement the
necessary support into the official code, so I will do that tonight if you
are willing to wait a day or so for the official implementation.
Gambit
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|