Author: remi
Date: 2008-12-18 18:55:55 +0100 (Thu, 18 Dec 2008)
New Revision: 3209
Modified:
software_suite_v2/software/http_server_resources/chatter_tux/trunk/ChatterTux/Unit1.pas
Log:
* cleaning
* removed unneeded code
* updated the maximal redirections number to 100 (Internet connection check)
Modified:
software_suite_v2/software/http_server_resources/chatter_tux/trunk/ChatterTux/Unit1.pas
===================================================================
---
software_suite_v2/software/http_server_resources/chatter_tux/trunk/ChatterTux/Unit1.pas
2008-12-18 17:38:55 UTC (rev 3208)
+++
software_suite_v2/software/http_server_resources/chatter_tux/trunk/ChatterTux/Unit1.pas
2008-12-18 17:55:55 UTC (rev 3209)
@@ -25,11 +25,10 @@
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, Winsock,
- Wsocket,
- MagentaMonsock, MagentaMonpcap, MagentaPacket32, MagentaPcap,
- MagentaPackhdrs, Magsubs1, MagClasses, StdCtrls, HttpProt,
- IdBaseComponent, IdComponent, IdIPWatch, IdHTTP, IdException;
+ Dialogs,
+ MagentaMonsock, MagentaPacket32,
+ MagentaPackhdrs, MagClasses, StdCtrls,
+ IdBaseComponent, IdComponent, IdHTTP, IdException, HttpProt;
const
MSN_MSG_REQ =
'http://127.0.0.1:270/0/status/send?name=chatter&value=MSN|MSG|Nickname|%s';
@@ -99,6 +98,7 @@
idHTTP.Request.CacheControl := 'no-cache';
idHTTP.Request.UserAgent:= 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1)';
idHTTP.HandleRedirects := true;
+ idHTTP.RedirectMaximum := 100;
result := 'None';
try
idHTTP.Head('http://www.google.com/');
@@ -198,25 +198,16 @@
// Wait a valid IP address
while true do
begin
- // Need at least one IP address
- if LocalIPList.Count = 0 then
- // No IP address - failed
+ // Check internet status
+ myIP := getInternetConnectionAvailable;
+ if myIP = 'None' then
begin
sleep(2000);
- application.ProcessMessages;
+ continue;
end else
- // At least one IP address found
begin
- // Check internet status
- myIP := getInternetConnectionAvailable;
- if myIP = 'None' then
- begin
- continue;
- end else
- begin
- sleep(1000);
- break;
- end;
+ sleep(1000);
+ break;
end;
end;
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn