Re: [twsocket] Evaluating TOverbyteIcsSysLogServer

2011-11-11 Thread Francois PIETTE

Changes applyed.
Thanks.
--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Evaluating TOverbyteIcsSysLogServer

2011-11-11 Thread Busai Péter



Hello Peter,

Thanks for your feedback. While you are at it, maybe you could fix the 
issues you see and propose it to the community ?
Before doing that, be sure to download the very latest development 
snapshot, preferably directly out of the SVN repository. Then make 
your changes and submit a SVN diff file.


Regards,
--
francois.pie...@overbyte.be


Sure

Just an other question.
Sample from Memo output:
   TimeStamp= 2011-11-11T11:45:48.000+01:00
   DateTime = 2011-11-11 11:45:48.000

Shouldnt DecodedMessage.Hour be corrected by DecodedMessage.TZBias ?

Checked out latest SVN today. Revision 818.

In case attachment does not go through.

OverbyteIcsSysLogServer.diff:
--- 
C:/DOCUME~1/Peter/LOCALS~1/Temp/OverbyteIcsSysLogServer.pas-revBASE.svn000.tmp.pas
P nov. 11 12:13:37 2011
+++ C:/delphi/ics_svn/trunk/Delphi/Vc32/OverbyteIcsSysLogServer.pasP 
nov. 11 11:40:36 2011

@@ -198,7 +198,7 @@
((RawMessage[Index] >= 'A') and (RawMessage[Index] <= 'Z')) or
((RawMessage[Index] >= 'a') and (RawMessage[Index] <= 'z')) or
((RawMessage[Index] >= '0') and (RawMessage[Index] <= '9')) or
-(RawMessage[Index]  = '.') or
+(RawMessage[Index]  = '.') or (RawMessage[Index]  = '-') or
 (RawMessage[Index]  = '_')
   ) do
 Inc(Index);
@@ -455,6 +455,15 @@
 SMSec := '0';
 end;

+SMsec := '0' + DecimalSeparator + SMSec;
+DecodedMessage.Year := StrToInt(SYear);
+DecodedMessage.Month:= StrToInt(SMonth);
+DecodedMessage.Day  := StrToInt(SDay);
+DecodedMessage.Hour := StrToInt(SHour);
+DecodedMessage.Minute   := StrToInt(SMinute);
+DecodedMessage.Second   := StrToInt(SSecond);
+DecodedMessage.MilliSec := Trunc(1000 * StrToFloat(SMsec));
+
 case Delim of
 'Z', ' ' : DecodedMessage.TZBias := 0;
 '+', '-' :
@@ -486,14 +495,6 @@
   String(RawMessage) + '"');
 end;

-SMsec := '0' + DecimalSeparator + SMSec;
-DecodedMessage.Year := StrToInt(SYear);
-DecodedMessage.Month:= StrToInt(SMonth);
-DecodedMessage.Day  := StrToInt(SDay);
-DecodedMessage.Hour := StrToInt(SHour);
-DecodedMessage.Minute   := StrToInt(SMinute);
-DecodedMessage.Second   := StrToInt(SSecond);
-DecodedMessage.MilliSec := Trunc(1000 * StrToFloat(SMsec));
 DecodedMessage.TimeString := String(Copy(RawMessage, Index1, Index 
- Index1));


 if (Index > Length(RawMessage)) or



OverbyteIcsSysLogServerDemo.pas.diff:
--- 
C:/DOCUME~1/Peter/LOCALS~1/Temp/OverbyteIcsSysLogServerDemo1.pas-revBASE.svn000.tmp.pas
P nov. 11 12:16:39 2011
+++ 
C:/delphi/ics_svn/trunk/Delphi/Internet/OverbyteIcsSysLogServerDemo1.pas
P nov. 11 11:15:16 2011

@@ -53,16 +53,19 @@
 ToolsPanel: TPanel;
 DisplayMemo: TMemo;
 StartButton: TButton;
+StopButton: TButton;
 procedure FormShow(Sender: TObject);
 procedure FormClose(Sender: TObject; var Action: TCloseAction);
 procedure FormCreate(Sender: TObject);
 procedure StartButtonClick(Sender: TObject);
 procedure SysLogServer1DataAvailable(Sender: TObject; const SrcIP, 
SrcPort,

   RawMessage: AnsiString);
+procedure StopButtonClick(Sender: TObject);
   private
 FIniFileName : String;
 FInitialized : Boolean;
 FSysLogServer: TSysLogServer;
+procedure SetButtons(Listening:Boolean);
   public
 procedure Display(Msg : String);
 property IniFileName : String read FIniFileName write FIniFileName;
@@ -89,6 +92,7 @@
 FSysLogServer := TSysLogServer.Create(Self);
 FIniFileName := OverbyteIcsIniFiles.GetIcsIniFileName;
 DisplayMemo.Clear;
+FSysLogServer.OnDataAvailable := SysLogServer1DataAvailable;
 end;


@@ -150,14 +154,27 @@
 end;
 end;

+procedure TSysLogServerForm.SetButtons(Listening:Boolean);
+begin
+  StartButton.Enabled := not Listening;
+  StopButton.Enabled  := Listening;
+end;

+
 {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
* * *}

 procedure TSysLogServerForm.StartButtonClick(Sender: TObject);
 begin
 FSysLogServer.Listen;
+SetButtons(TRUE);
 end;


+procedure TSysLogServerForm.StopButtonClick(Sender: TObject);
+begin
+FSysLogServer.Close;
+SetButtons(FALSE);
+end;
+
 {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
* * *}

 procedure TSysLogServerForm.SysLogServer1DataAvailable(
 Sender: TObject;


OverbyteIcsSysLogServerDemo.dfm.diff:
--- 
C:/DOCUME~1/Peter/LOCALS~1/Temp/OverbyteIcsSysLogServerDemo1.dfm-revBASE.svn000.tmp.dfm
P nov. 11 12:18:13 2011
+++ 
C:/delphi/ics_svn/trunk/Delphi/Internet/OverbyteIcsSysLogServerDemo1.dfm
P nov. 11 11:15:00 2011

@@ -1,9 +1,9 @@
 object SysLogServerForm: TSysLogServerForm
   Left = 70
   Top = 187
-  Width = 379
-  Height = 247
   Caption = 'SysLogServer - http://www.overbyte.be'
+  ClientHeight = 220
+  ClientWidth = 371
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Co

Re: [twsocket] Evaluating TOverbyteIcsSysLogServer

2011-11-11 Thread Francois PIETTE

Hello Peter,

Thanks for your feedback. While you are at it, maybe you could fix the 
issues you see and propose it to the community ?
Before doing that, be sure to download the very latest development snapshot, 
preferably directly out of the SVN repository. Then make your changes and 
submit a SVN diff file.


Regards,
--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

-Message d'origine- 
From: Busai Péter

Sent: Friday, November 11, 2011 11:40 AM
To: ICS support mailing
Subject: Re: [twsocket] Evaluating TOverbyteIcsSysLogServer


If client hostname contains negative sign "-" , for example 
"somename-peter", than between lines 520-532 it is evaluated as "invalid 
PID delimter" and an exception is raised.

I dont know if this is a valid hostname for that RFC

Some digging in the RFCs:

http://tools.ietf.org/html/rfc5424#page-13

 "The HOSTNAME field SHOULD contain the hostname and the domain name of
   the originator in the format specified in STD 13 [RFC1034 
<http://tools.ietf.org/html/rfc1034>]"


According to RFC1034 a hypen is a valid character.
http://tools.ietf.org/html/rfc1034 Page 10.

IMHO unit OverbyteIcsSysLogServer.pas function GetWord should also check
for hypen-minus "-" character

Regards
Peter
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be 


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Evaluating TOverbyteIcsSysLogServer

2011-11-11 Thread Busai Péter


If client hostname contains negative sign "-" , for example 
"somename-peter", than between lines 520-532 it is evaluated as 
"invalid PID delimter" and an exception is raised.

I dont know if this is a valid hostname for that RFC

Some digging in the RFCs:

http://tools.ietf.org/html/rfc5424#page-13

 "The HOSTNAME field SHOULD contain the hostname and the domain name of
   the originator in the format specified in STD 13 [RFC1034  
]"

According to RFC1034 a hypen is a valid character.
http://tools.ietf.org/html/rfc1034 Page 10.

IMHO unit OverbyteIcsSysLogServer.pas function GetWord should also check 
for hypen-minus "-" character


Regards
Peter
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be