Re: [twsocket] THttpCli exception errors

2008-03-28 Thread retnyg
i am also suffering from those exceptions, especially in pop3prot and
smtpprot. i wrapped several try except blocks around every possible
call but it still crashes (the except block gets never called).
could you provide an example code how such errors could be handled ?

regards, retnyg

 Why not just give the option of sending an alert
 instead of closing the app with a fatal error?

FP The app close only because you don't handle the exception.
FP You can handle the exception as you like. It is not the component which has
FP to display an alert, it is your application.

FP Contribute to the SSL Effort. Visit
FP http://www.overbyte.be/eng/ssl.html
FP --
FP [EMAIL PROTECTED]
FP Author of ICS (Internet Component Suite, freeware)
FP Author of MidWare (Multi-tier framework, freeware)
FP http://www.overbyte.be


FP - Original Message - 
FP From: [EMAIL PROTECTED]
FP To: twsocket@elists.org
FP Sent: Thursday, March 27, 2008 8:41 AM
FP Subject: [twsocket] THttpCli exception errors


 Why is ICS written to trigger an exception error upon events such as an
 internal server error, or when a connection request is aborted in the
 middle of receiving data from the server? The code I am referring to is
 this:

 if (FStatusCode = 400) and (FStatusCode  401) and (FStatusCode  407)
 then
 raise EHttpException.Create(FReasonPhrase, FStatusCode);

 Why not just give the option of sending an alert instead of closing the
 app with a fatal error?

 -- 
 Want an e-mail address like mine?
 Get a free e-mail account today at www.mail.com!

 -- 
 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




-- 
Mit freundlichen Grüßen
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]


-- 
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] Newbie Question: How to use the HTTPCli component to connect to USPS

2008-02-18 Thread retnyg
Guten Tag SoftTech,

am Montag, 18. Februar 2008 um 15:55 schrieben Sie:

S Return-Path: [EMAIL PROTECTED]
S X-Flags: 1001
S Delivered-To: GMX delivery to [EMAIL PROTECTED]
S Received: (qmail invoked by alias); 18 Feb 2008 14:56:02 -
S Received: from enterprise.codeboffins.com (EHLO
S enterprise.codeboffins.com) [66.135.48.88]
S   by mx0.gmx.net (mx081) with SMTP; 18 Feb 2008 15:56:02 +0100
S Received: (qmail 6423 invoked from network); 18 Feb 2008 14:56:01 +
S Received: from localhost (HELO enterprise.codeboffins.com) ([EMAIL 
PROTECTED])
S   by localhost with SMTP; 18 Feb 2008 14:56:00 +
S Delivered-To: [EMAIL PROTECTED]
S Received: (qmail 6338 invoked from network); 18 Feb 2008 14:55:59 +
S Received: from eastrmmtao104.cox.net (68.230.240.46)
S by enterprise.codeboffins.com with SMTP; 18 Feb 2008 14:55:59 +
S Received-SPF: none (enterprise.codeboffins.com: domain at softtechks.com does
S not designate permitted sender hosts)
S Received: from eastrmimpo03.cox.net ([68.1.16.126]) by eastrmmtao104.cox.net
S (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP
S id
S [EMAIL PROTECTED]
S for twsocket@elists.org; Mon, 18 Feb 2008 09:55:23 -0500
S Received: from michael ([24.255.172.206]) by
S eastrmimpo03.cox.net with bizsmtp
S id r2sb1Y0044TYytC000; Mon, 18 Feb 2008 09:52:37 -0500
S Message-ID: [EMAIL PROTECTED]
S From: SoftTech [EMAIL PROTECTED]
S To: ICS support mailing twsocket@elists.org
S References:
S [EMAIL PROTECTED][EMAIL PROTECTED]
S [EMAIL PROTECTED]
S Date: Mon, 18 Feb 2008 08:55:30 -0600
S MIME-Version: 1.0
S X-Priority: 3
S X-MSMail-Priority: Normal
S X-Mailer: Microsoft Outlook Express 6.00.2900.3138
S X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
S Subject: [twsocket] Newbie Question: How to use the HTTPCli component to
S connect to USPS
S X-BeenThere: twsocket@elists.org
S X-Mailman-Version: 2.1.9
S Precedence: list
S Reply-To: ICS support mailing twsocket@elists.org
S List-Id: ICS support mailing twsocket.elists.org
S List-Unsubscribe:
S http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket, 
S mailto:[EMAIL PROTECTED]
S List-Archive: http://lists.elists.org/pipermail/twsocket
S List-Post: mailto:twsocket@elists.org
S List-Help: mailto:[EMAIL PROTECTED]
S List-Subscribe:
S http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket,
S mailto:[EMAIL PROTECTED]
S Content-Type: text/plain; charset=us-ascii
S Content-Transfer-Encoding: 7bit
S Sender: [EMAIL PROTECTED]
S Errors-To: [EMAIL PROTECTED]
S X-Anti-Virus: Kaspersky Anti-Virus for MailServers
S 5.5.12.2/Plesk_SWsoft, bases: 18022008 #531244, status: notchecked
S X-GMX-Antivirus: -1 (not scanned, may not use virus scanner)
S X-GMX-Htest: 0.53
S X-GMX-Antispam: 0 (Mail was not recognized as spam)
S X-GMX-UID: 7fHbE1M0bXBt0QX1FTQ2vsEqLyUmZcin

S Greetings All,

S This is my first attempt at programing to communicate with a web server and
S althought I have been a Delphi programer for 11 years mainly in the database
S field, I'm a newbie at this kind of programming and I now remember how
S overwhelmed I was when first starting to learn Delphi.

S I'm currently using Delphi 5.1 and want to communicate with a web server
S hosted by USPS.

S Using the webtools proviced by USPS at 
S http://www.usps.com/webtools/address.htm I would like to use their address
S correction and lookup tools from within my Delphi application.

S After reading their technical guides they do mention that software 
S developers can also use these tools from within their own software.

S I have signed up to use there tools and have tested calling their web server
S by simply plugging in the following HTTP url (which includes XML) and it
S works returning an XML value in internet explorer.  (Yeah)

S Here is what I need to do:

S I need to connect to a web server, send an xml message, the server receives
S and respond to my
S message responding with XML.

S I can connect to a webserver using my internet browser and send it a string
S of information like this:

S 
http://SERVERNAME/ShippingAPITest.dll?API=CityStateLookupXML=CityStateLookupRequest%20USERID=ZipCode%20ID=%200Zip590210/Zip5/ZipCode/CityStateLookupRequest

S NOTE: SERVERNAME and USERID above are of course replaced with the actual
S server I'm logging onto and the User ID assigned to me

S and it returns a response like this in XML format that I see in my internet
S browser

S   ?xml version=1.0 ?
S - CityStateLookupResponse
S - ZipCode ID=0
S   Zip590210/Zip5
S   CityBEVERLY HILLS/City
S   StateCA/State
S   /ZipCode
S   /CityStateLookupResponse

S I understand I need to use the HTTPCli component to connect to the 
S webserver, but am having trouble in how to use and hope that someone on this
S list would take pitty on me and help to guide me in how to accomplish this.

S Any guidance on how to get started would really be appreciated.

S Thanks,
S Mike 



just use the api 

Re: [twsocket] Newbie Question: How to use the HTTPCli component toconnect to USPS

2008-02-18 Thread retnyg

S URLDownloadToFile must be something found in a greater version than Delphi
S 5.1

uses UrlMon;
or define to use the function from urlmon.dll yourself:
HRESULT URLDownloadToFile(  LPUNKNOWN pCaller,
LPCTSTR szURL,
LPCTSTR szFileName,
DWORD dwReserved,
LPBINDSTATUSCALLBACK lpfnCB
);

S However, I was able to do something on my own using the wininet unit.

nice.

S So again, thanks for your help,
S Mike



S just use the api function URLDownloadToFile for such an easy task. you
S will find examples in google with URLDownloadToFile delphi.
S the only thing you have to be able is correct forming of the url
S string .


greetz, ret




-- 
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] pop3 component not ready - Bug in TPop3Cli

2008-01-17 Thread retnyg

AG It helps alot to post a short message when you either think
AG the problem is resolved or not. Thanks.

it didnt fix the issue, got a pop3 not ready exception today.



AG --
AG Arno Garrels [TeamICS]
AG http://www.overbyte.be/eng/overbyte/teamics.html



 
 i also hope that the bug gets eliminated in the next release by
 FPIETTE.
 i don't really like using custom-patched components.



-- 
Mit freundlichen Grüßen
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]


-- 
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] smtp component not connected/ready

2008-01-07 Thread retnyg
hi,

i changed the code as follows:

procedure TMailer.SmtpClientRequestDone;

  function isError : boolean;
  begin
result := false;
if ((Error  399) and (Error  600)) or (error = 1) then result := 
true;
if result then if assigned(FOnError) then  FOnError(FSmtp.ErrorMessage);
  end;

begin
  // it is possible that an exception arises here : smtp component not 
connected so
  with FSmtp do begin
if isError then Rset
else
if not Connected then exit //Rset // fehlerbehandlung einbauen
else
case RqType of
  smtpConnect:
  begin
if AuthType = smtpAuthNone then Helo else Ehlo;
  end;
  smtpHelo: MailFrom;
  smtpEhlo: Auth;
  smtpAuth: MailFrom;
  smtpMailFrom: RcptTo;
  smtpRcptTo: Data;
  smtpData: Quit;
//  smtpRset: Quit;
//  smtpQuit: begin
//FBusy := false;
//if assigned(FOnMailSent) then FOnMailSent(FMailId);
//  end;
end;
  end;
end;


still i get the error smtp component not connected, even if i check
explicitly for it.

any ideas ?

tia, retnyg


AG [EMAIL PROTECTED] wrote:
 hi there,
 
 is there also such a known bug in smtpprot.pas ?

AG No known issues. Please check your code. An error is anything  0!
AG This can be a winsock error code  1 or an SMTP error
AG code. The action to be taken depends on both current request
AG type and error code, read the RFCs for a description of SMTP
AG error codes. Also a reconnect should never be tried by calling
AG Connect from a component event handler but by posting a 
AG custom message, in the message handler calling Connect is safe. 

AG --
AG Arno Garrels [TeamICS]
AG http://www.overbyte.be/eng/overbyte/teamics.html


 (testing with a gmx account)
 my app receives mail through pop3prot.pas then forwards them through
 smtpprot.pas.
 
 at first i received the exception smtp component not connected in
 smtpclientrequestdone, now i built in a check if not connected, now i
 receive smtp component not ready.
 
 procedure TMailer.SmtpClientRequestDone;
 
   function isError : boolean;
   begin
 result := false;
 if (Error  399) and (Error  600) then result := true;
 if result then if assigned(FOnError) then 
 FOnError(FSmtp.ErrorMessage);   end;
 
 begin
   // it is possible that an exception arises here : smtp component
 not connected so   with FSmtp do begin
 if isError then Rset
 else
 if not Connected then Connect
 else
 case RqType of
   smtpConnect:
   begin
 if AuthType = smtpAuthNone then Helo else Ehlo;
   end;
 
 
 tia, retnyg



-- 
Mit freundlichen Grüßen
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]


-- 
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] aspx page ICS Auto Fill, Post, and Read Answer

2008-01-04 Thread retnyg
is there a specific reason you want to use ics for that ?
imho its much simpler to do stuff like this with selenium.
you can remote control your browser via a perl script, ie.:

my $sel = Test::WWW::Selenium-new( host = localhost,
port = , 
browser = *firefox, 
browser_url =
https://www.yahoo.com; );

$sel-open_ok(https://www.yahoo.com/login.aspx;);
$sel-wait_for_page_to_load_ok(3);
$sel-type_ok(username, hanswurst);
$sel-type_ok(password, f00);
$sel-click_ok(link=log in);
$sel-wait_for_page_to_load_ok(3);

#writetofile tempfile
my $src = $sel-get_html_source();
my $tempfile = temp.html;
open (TEST, $tempfile);
print TEST $src;
close (TEST);

inside that script you can do anything that you could do with perl.



TG I have been looking through peoples usage of ICS Components today and
TG have  found it very interesting.

TG I came across a posting where an individual was asking if you could
TG use these components inside of Delphi to auto fill a form and click Ok.

TG Is that what the sample that was posted does?
TG HttpCli1.URL := 'http://www.borland.com'; HttpCli1.RcvdStream := 
TG TFileStream.Create('borland.html', fmCreate); HttpCli1.Get; if 
TG HttpCli1.StatusCode  200 then
TGShowMessage(HttpCli1.ReasonPhrase);
TG HttpCli1.RcvdStream.Pos := 0;
TG Memo1.Lines.LoadFromStream(HttpCli1.RcvdStream);
TG HttpCli1.RcvdStream.Free;

TG There is no mention of Post or Put anywhere?

TG Would you be able to provied a better example of how you are able to
TG auto-fill aspx input fields automatically and post the information,
TG causing the page to update which would allow us to read the received
TG strem
TG containing the answer?

TG Thanks very much for your help,
TG Terry



-- 
Mit freundlichen Grüßen
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]


-- 
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] Strange e-mail problems Server 2003

2008-01-02 Thread retnyg
did you try telnetting manually to the smtp server, or use another
client ? maybe some antivirus stuff involved ?

AG Dod wrote:
 Hello Arno,
 
 I see in the log that there is 5 seconds delay between DATA and the
 10054 error. This may be interesting.

AG No, the delay is 2 minutes and 5 seconds.
AG One thing I can imagine is a problem with MTU Discovery,
AG since small packets (SMTP command/response) go thru,
AG may be the required ICMP packets are filtered?
AG Does someone know what has to be configured to ensure MTU Discovery
AG will not fail?

AG --
AG Arno Garrels
  

 
 During  this  delay  do you send data ? I say this because some server
 will  close cnx if no data transmitted fast enought and do not receive
 data for xx seconds, usually the timeout is between 1 or 3 minutes but
 I know a server that wait only 3 seconds (may be bad configuration).
 
 The  best  is  to ask client to manualy telnet port 25 into the server
 and  type  a  SMTP  sequence and wait 5 seconds betweent each line you
 type.
 
 Also may be there is some check-back cnx to the client's machine and
 if FW is ON then machine cannot be checked.
 
 regards.
 
 AG One of my customers reported problems sending mail with an
 TSmtpCli AG application when the Windows firewall is turned on.
 Strange is that AG sending mail data fails for some reason and the
 server drops the AG connection after ~2 minutes (of inactivity) even
 though port 25 AG is explicitely opened.
 
 AG First log is with firewall turned off, mail is sent successfully,
 AG second log with firewall turned on and port 25 explicitely opened:
 
 AG 01.01.08 2:22:47 PM  MAIL FROM:[EMAIL PROTECTED]
 AG 01.01.08 2:22:48 PM  250 2.1.0 [EMAIL PROTECTED]... Sender ok
 AG 01.01.08 2:22:48 PM  RCPT TO:[EMAIL PROTECTED]
 AG 01.01.08 2:22:48 PM  250 2.1.5 [EMAIL PROTECTED]... Recipient ok
 AG 01.01.08 2:22:48 PM  DATA
 AG 01.01.08 2:22:48 PM  354 Enter mail, end with . on a line by
 itself AG 01.01.08 2:22:48 PM  .
 AG 01.01.08 2:22:48 PM  250 2.0.0 m01JMoVp009311 Message accepted
 for delivery AG 01.01.08 2:22:48 PM  QUIT
 AG 01.01.08 2:22:48 PM  221 2.0.0 ms-smtp-xyz.com closing connection
 
 
 AG 01.01.08 4:43:40 PM  MAIL FROM:[EMAIL PROTECTED]
 AG 01.01.08 4:43:41 PM  250 2.1.0 [EMAIL PROTECTED]... Sender ok
 AG 01.01.08 4:43:41 PM  RCPT TO:[EMAIL PROTECTED]
 AG 01.01.08 4:43:41 PM  250 2.1.5 [EMAIL PROTECTED]... Recipient ok
 AG 01.01.08 4:43:41 PM  DATA
 AG 01.01.08 4:43:41 PM  354 Enter mail, end with . on a line by
 itself AG 01.01.08 4:45:46 PM  Error=10054 Session aborted!
 
 AG Adding the application to the exception list makes no difference.
 AG Anybody any idea?
 
 AG --
 AG Arno Garrels



-- 
Mit freundlichen Grüßen
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]


-- 
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] ICS hidden window cannot be created error #8--what isthis?

2008-01-02 Thread retnyg
there may be also another problem: afaik windows xp 32bit has only 64K
handle numbers for windows available. this problem also occurs if you have a
lot of apps open, ie. 2 browsers with a lot of tabs, and the the bat
email client which uses a lot of handles, also some instances of
winrar and explorer.
if that condition occurs you cannot open a new window even if you have
plenty of ram available, it may be that you open an explorer window
and a part is completely gray.
you can use taskmanager to see the number of handles a process uses
(in the view menu).

FT Hello,

FT What about increasing WH_MSG_MAX to 1000 from 100? Isn't this suppose to
FT reduce this problem by creating less number of hidden windows? I know that
FT it would be slower for the for loop to find the message but there seems to
FT be no other way to support 10k users, wrong?

FT Thanks,

FT SZ


FT On 1/1/08, Francois PIETTE [EMAIL PROTECTED] wrote:

  Please see http://www.fastream.com/ics/icshiddenwindow.png .

 Basically, it shows error #8 when creating a window.

  This occurs
  when I run the service with attach to process and with full debug
  information. There are 8000-1 clients connected. Optimizations on.
  What
  could be the reason?

 According to MSDN, error #8 is not enough memory.

  I configured for 512 clients (plus 512 thttpcli's)
  for each reverse proxy thread. Is this too much? What is the ideal
  clients/thread ratio? How can I support 10k clients? I have 2GB RAM.

 Add more RAM.


 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html
 --
 [EMAIL PROTECTED]
 The author of the freeware multi-tier middleware MidWare
 The author of the freeware Internet Component Suite (ICS)
 http://www.overbyte.be





-- 
Mit freundlichen Grüßen
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]


-- 
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


[twsocket] pop3 component not ready

2007-12-11 Thread retnyg
hi, i use a custom pop3 component in my program, and frome time to
time i get this errormessage from the server:

-ERR System temporarily unavailable, please try again later.

on the next connect try i get the pop3 component not ready exception,
even if i check for connected:

function TMailAlert.CheckError:boolean;
begin
  result := false;
  with fpop do
   if (errormessage  '') then begin
 if assigned(FOnError)  then
   FOnError(ErrorMessage);
 ClearErrorMessage;
 result := true;
   end;
end;

procedure TMailAlert.CheckNewMail;
begin
   with FPop do
   if not Connected then
   begin
 Fbusy := true;
 ClearErrorMessage;
 Connect;
   end;
end;

procedure TMailAlert.Pop3ClientRequestDone;
begin
  if (FPop.connected) and (CheckError) then begin
FPop.quit;
exit;
  end;  

...

what could be the cause that the component is not ready after the
error ?

TIA, retnyg


ps. pop3prot.pas Version:  2.27

-- 
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


[twsocket] [request] smtpprot: make X-Mailer a property

2007-02-04 Thread retnyg
pls make it a property, so we dont have to mess around in ICS source
on every new release.

best regards, retnyg

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


Re: [twsocket] [request] smtpprot: make X-Mailer a property

2007-02-04 Thread retnyg
good to know but thats not the clean way.
and needs some additional cpu cycles on every headerline of course.

best regards, retnyg

AG [EMAIL PROTECTED] wrote:
 pls make it a property, so we dont have to mess around in ICS source
 on every new release.

AG There's an event OnHeaderLine. No need to add a new property.

AG procedure TMySmtp.SmtpHeaderLine(Sender: TObject;
AG   Msg: Pointer; Size: Integer);
AG begin
AG if StrLIComp(Msg, 'X-Mailer:', 9) = 0 then
AG StrCopy(Msg, PChar('X-Mailer: MyMailer - www.mymailer.de'));
AG end;

AG ---
AG Arno Garrels [TeamICS]
AG http://www.overbyte.be/eng/overbyte/teamics.html


 best regards, retnyg



-- 
Mit freundlichen Grüßen
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]


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


Re: [twsocket] [request] smtpprot: make X-Mailer a property

2007-02-04 Thread retnyg
a protected variable of the object would suffice, so experienced users
could do a hack typecast to access it, if for some reason somebody
dont wont the value to be easily accessible.

rgn good to know but thats not the clean way.
rgn and needs some additional cpu cycles on every headerline of course.

rgn best regards, retnyg

AG [EMAIL PROTECTED] wrote:
 pls make it a property, so we dont have to mess around in ICS source
 on every new release.

AG There's an event OnHeaderLine. No need to add a new property.

AG procedure TMySmtp.SmtpHeaderLine(Sender: TObject;
AG   Msg: Pointer; Size: Integer);
AG begin
AG if StrLIComp(Msg, 'X-Mailer:', 9) = 0 then
AG StrCopy(Msg, PChar('X-Mailer: MyMailer - www.mymailer.de'));
AG end;

AG ---
AG Arno Garrels [TeamICS]
AG http://www.overbyte.be/eng/overbyte/teamics.html


 best regards, retnyg



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


Re: [twsocket] [request] smtpprot: make X-Mailer a property

2007-02-04 Thread retnyg

 good to know but thats not the clean way.
 and needs some additional cpu cycles on every headerline of course.

FP The clean way to add features you need is to derive your own component from
FP ICS component and add what you need in that derived component. I agree to do
FP slight changes to ICS to allow easy changes where is could be difficult now.

FP The idea is to not try to build a giant component by adding tons of feature
FP which will not be used in most cases. All less used features should be in
FP derived components, mostly made by the users and not part of ICS. That's
FP what OOP is all about.

i see. though deriving a custom class becomes difficult if stuff is
hardcoded in the base component. could you imagine a component like
IdHttp with a hardcoded useragent ?

best regards, retnyg

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


[twsocket] httpServer auth problem

2007-01-31 Thread retnyg
hi, i am trying to write a wrapper class for httpserv.
unfortunately i have problems implementing the digest auth.

function THttpConnection.AuthDigestGetParams always returns false here:

t1 := EncodeTime(1, 0, 0, 0);
t2 := Now;
try
LastTime := RFC822ToDateTime(Trim(Base64Decode(FAuthDigestNonce)));
except
Exit;
end;

if (LastTime + t1)  t2 then
Result := TRUE;// THAT IS NOT THE CASE IN MY CODE

what is happening here ? the overbyte example always returns true even
i dont find the difference.

my code:
constructor TmyWebServer.Create;
begin
  FSrv := THttpServer.Create(nil);
  FAuthPages := TAuthPages.Create;
  with FSrv do begin
Port := inttostr(ListenPort);
OnGetDocument := HttpServerOnGetDocument;
OnPostDocument := HttpServerOnPostDocument;
OnPostedData := HttpServerOnPostedData;
OnAuthGetType := HttpServerOnAuthGetType;
OnAuthGetPassword := HttpServerOnAuthGetPassword;
ClientClass := TMyHttpConnection;
Start;
  end;
end;

procedure TMyWebServer.HttpServerOnAuthGetType( Sender, Client: TObject);
var
  i : integer;
begin
  if (assigned(FAuthPages)) and (FAuthPages.Count  0) then
with TMyHttpConnection(Client) do
  for i := 0 to FAuthPages.Count - 1 do // this checks if te
//  pageurl is saved in a list
with FAuthPages.AsRecord(i) do
  if (CompareText (sPageUrl,Path) = 0) then
  begin
 AuthType := atDigest;
 AuthRealm := extractfilename(sPageUrl);
  end;
end;

procedure TmyWebServer.HttpServerOnAuthGetPassword(Sender: TObject; Client: 
TObject; var Password: String);
var
  i: integer;
begin
  // this proc is never cALLED
  if (assigned(FAuthPages)) and (FAuthPages.Count  0) then
with TMyHttpConnection(Client) do
  for i := 0 to FAuthPages.Count - 1 do
with FAuthPages.AsRecord(i) do
  if (CompareText (sPageUrl,Path) = 0) then
if (CompareText (sUser,AuthUserName) = 0) then
begin
   password := sPassword;
   exit;
end;
end;



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


Re: [twsocket] httpServer auth problem

2007-01-31 Thread retnyg
found it, required this line in the OnGet event

  if Flags = hg401 then
Exit;


rgn hi, i am trying to write a wrapper class for httpserv.
rgn unfortunately i have problems implementing the digest auth.

rgn function THttpConnection.AuthDigestGetParams always returns false here:

rgn t1 := EncodeTime(1, 0, 0, 0);
rgn t2 := Now;
rgn try
rgn LastTime :=
rgn RFC822ToDateTime(Trim(Base64Decode(FAuthDigestNonce)));
rgn except
rgn Exit;
rgn end;

rgn if (LastTime + t1)  t2 then
rgn Result := TRUE;// THAT IS NOT THE CASE IN MY CODE

rgn what is happening here ? the overbyte example always returns true even
rgn i dont find the difference.

rgn my code:
rgn constructor TmyWebServer.Create;
rgn begin
rgn   FSrv := THttpServer.Create(nil);
rgn   FAuthPages := TAuthPages.Create;
rgn   with FSrv do begin
rgn Port := inttostr(ListenPort);
rgn OnGetDocument := HttpServerOnGetDocument;
rgn OnPostDocument := HttpServerOnPostDocument;
rgn OnPostedData := HttpServerOnPostedData;
rgn OnAuthGetType := HttpServerOnAuthGetType;
rgn OnAuthGetPassword := HttpServerOnAuthGetPassword;
rgn ClientClass := TMyHttpConnection;
rgn Start;
rgn   end;
rgn end;

rgn procedure TMyWebServer.HttpServerOnAuthGetType( Sender, Client: TObject);
rgn var
rgn   i : integer;
rgn begin
rgn   if (assigned(FAuthPages)) and (FAuthPages.Count  0) then
rgn with TMyHttpConnection(Client) do
rgn   for i := 0 to FAuthPages.Count - 1 do // this checks if te
rgn //  pageurl is saved in a list
rgn with FAuthPages.AsRecord(i) do
rgn   if (CompareText (sPageUrl,Path) = 0) then
rgn   begin
rgn  AuthType := atDigest;
rgn  AuthRealm := extractfilename(sPageUrl);
rgn   end;
rgn end;

rgn procedure TmyWebServer.HttpServerOnAuthGetPassword(Sender:
rgn TObject; Client: TObject; var Password: String);
rgn var
rgn   i: integer;
rgn begin
rgn   // this proc is never cALLED
rgn   if (assigned(FAuthPages)) and (FAuthPages.Count  0) then
rgn with TMyHttpConnection(Client) do
rgn   for i := 0 to FAuthPages.Count - 1 do
rgn with FAuthPages.AsRecord(i) do
rgn   if (CompareText (sPageUrl,Path) = 0) then
rgn if (CompareText (sUser,AuthUserName) = 0) then
rgn begin
rgnpassword := sPassword;
rgnexit;
rgn end;
rgn end;






-- 
Mit freundlichen Grüßen
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]


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


Re: [twsocket] Exception on compiling SocketSpy with newest ICS v5/6

2006-10-27 Thread retnyg
Hello Wilfried,

i used the most recent version 5 and 6 from the website.
Is it possible that you do a right-click on the main form, select
Text-DFM then save it and attach the whole project to a mail ?
maybe i did something wrong in the BannerTo(o)Busy-Case.

TIA, retnyg

WM Hello retnyg,

WM I just downloaded it and compiled and did a test with a server. All
WM seems to work normal. Wich version of ICS do you use ?

WM ---
WM Rgds, Wilfried [TeamICS]
WM http://www.overbyte.be/eng/overbyte/teamics.html
WM http://www.mestdagh.biz

WM Thursday, October 26, 2006, 21:02, [EMAIL PROTECTED] wrote:

 Hello Wilfried,

 thank you, i need the source to be working because i need a tunneling
 app with easy to change target ip adress.
 btw, inside the app source code is no reference to
 WSocketServer.LastError,
 It seems to happen inside the core Socket code.

WM Hello retnyg,

WM Maybe SocketSpy code does something that is not anymore possible using
WM receint ICS version ?  You find the executable on my site. I try to look
WM in the code when I have a moment of time.

WM ---
WM Rgds, Wilfried [TeamICS]
WM http://www.overbyte.be/eng/overbyte/teamics.html
WM http://www.mestdagh.biz

WM Wednesday, October 25, 2006, 22:12, [EMAIL PROTECTED] wrote:

 Hello,

 when i compile the socketspy program i get an exception (after fixing
 the Bannertobusy problem by ignoring it):

 Im Projekt 5ocket5py.exe ist eine Exception der Klasse EReadError
 aufgetreten. Meldung: 'Fehler beim Lesen von WSocketServer.LastError:
 Eigenschaft kann nur gelesen werden1.
 that means that WSocketServer.LastError is  a read-only property.

 this seems to be a bug in the ICS Source code.

 do you know how i can get that program to run ?

 thanks in advance,
 Retnyg






 -- 
 Mit freundlichen Grüßen
 [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]






-- 
Mit freundlichen Grüßen
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]


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


Re: [twsocket] Exception on compiling SocketSpy with newest ICS v5/6

2006-10-26 Thread retnyg
Hello Wilfried,

thank you, i need the source to be working because i need a tunneling
app with easy to change target ip adress.
btw, inside the app source code is no reference to
WSocketServer.LastError,
It seems to happen inside the core Socket code.

WM Hello retnyg,

WM Maybe SocketSpy code does something that is not anymore possible using
WM receint ICS version ?  You find the executable on my site. I try to look
WM in the code when I have a moment of time.

WM ---
WM Rgds, Wilfried [TeamICS]
WM http://www.overbyte.be/eng/overbyte/teamics.html
WM http://www.mestdagh.biz

WM Wednesday, October 25, 2006, 22:12, [EMAIL PROTECTED] wrote:

 Hello,

 when i compile the socketspy program i get an exception (after fixing
 the Bannertobusy problem by ignoring it):

 Im Projekt 5ocket5py.exe ist eine Exception der Klasse EReadError
 aufgetreten. Meldung: 'Fehler beim Lesen von WSocketServer.LastError:
 Eigenschaft kann nur gelesen werden1.
 that means that WSocketServer.LastError is  a read-only property.

 this seems to be a bug in the ICS Source code.

 do you know how i can get that program to run ?

 thanks in advance,
 Retnyg






-- 
Mit freundlichen Grüßen
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]


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


[twsocket] Exception on compiling SocketSpy with newest ICS v5/6

2006-10-25 Thread retnyg
Hello,

when i compile the socketspy program i get an exception (after fixing
the Bannertobusy problem by ignoring it):

Im Projekt 5ocket5py.exe ist eine Exception der Klasse EReadError aufgetreten. 
Meldung: 'Fehler beim Lesen von WSocketServer.LastError: Eigenschaft kann nur 
gelesen werden1.
that means that WSocketServer.LastError is  a read-only property.

this seems to be a bug in the ICS Source code.

do you know how i can get that program to run ?

thanks in advance,
Retnyg


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