[twsocket] Proposal to implement NTLM v2 in HttpCli

2011-10-27 Thread Bjørnar Nielsen
Hello,

ICS HttpCli-component does currently have support for authenticating against 
proxy with NTLM, but not with NTLM v2.

I have a customer that needs this and I'm willing to pay for someone here to 
implement this. I also whish this feature to be a part of ICS after the work is 
done. Is anybody here capable and interested in doing this?

Regards
Bjørnar Nielsen
--
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] Question about NTLM2

2011-10-10 Thread Bjørnar Nielsen
Does ICS support NTLM v2?

I have a customer I have made sofware for, using ICS HttpCli with support for 
NTLM, and that works. But a customer claims that they have a proxy that needs 
authentication with NTLM v2 and can't make it work. Does anybody here have any 
experience with ICS and NTLM v2?

Regards
Bjørnar Nielsen
--
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] Does SslHttpServer support multippel domains?

2011-02-18 Thread Bjørnar Nielsen
Is it possible to host more than one domain on the same 
SslHttpServer-component? Must I have a special cert with several alternative 
names or can I just add more certs to support more domains?

Regards
Bjørnar Nielsen

--
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] Found a bug and made a fix in function UrlDecode

2010-08-09 Thread Bjørnar Nielsen
Arno,

 ... try the following code and let me know how it works for you, 

The code works for me. But should not  the first overload directive be inside 
the conditional define?

Regards Bjørnar
--
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] Found a bug and made a fix in function UrlDecode

2010-08-06 Thread Bjørnar Nielsen
Arno,

 Would you expect a correct result as well if you base64-decoded a 
 quoted-printable encoded string?

No, I agree. But the problem is not the decoding itself but the way 
Unicode-chars and Ansi-chars are treated.
This is the line where the problem lies:
MyAnsichar := AnsiChar(UnicodeUrl[I]);
If UnicodeUrl is switched to AnsiString, the problem disappears.

 Can't you use your own custom function then?

Yes I can, but I think other users could benefit from my proposed change. I 
think this is a problem that was introduced with porting to Builder 2010 and 
using UnicodeString. This problem was not there before and maybe other users 
also have this problem now without knowing it.

Why not make the changes I proposed when all it does is restoring the function 
to old behavior as when only AnsiString was used?

Regards Bjørnar
--
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] Found a bug and made a fix in function UrlDecode

2010-08-06 Thread Bjørnar Nielsen
Arno,

 The only workaround that comes to my mind was another overload that takes 
 a RawByteString instead of string. I won't use AnsiString because implicit 
 ansi string
  casts must be avoided too.

That would work for me. I'm not very familiar with the use of RawByteString, 
but I made version of the function that works for me, do you think this version 
would work for others too (I just testet in 2010 C++ builder):

Regards Bjørnar

Code follows (only change from previous version I sent is type-change of first 
in-param):

function UrlDecode(const S : RawByteString ; SrcCodePage: Cardinal = CP_ACP;
  DetectUtf8: Boolean = TRUE) : UnicodeString ;
var
I, J, L : Integer;
U8Str   : AnsiString;
Ch  : AnsiChar;
begin
L := Length(S);
SetLength(U8Str, L);
I := 1;
J := 0;
while (I = L) and (S[I]  '') do begin
Ch := AnsiChar(S[I]);
if Ch = '%' then begin
Ch := AnsiChar(htoi2(PAnsiChar(@S[I + 1])));
Inc(I, 2);
end
else if Ch = '+' then
Ch := ' ';
Inc(J);
U8Str[J] := Ch;
Inc(I);
end;
SetLength(U8Str, J);
if (SrcCodePage = CP_UTF8) or (DetectUtf8 and IsUtf8Valid(U8Str)) then
{$IFDEF COMPILER12_UP}
Result := Utf8ToStringW(U8Str)
else
Result := AnsiToUnicode(U8Str, SrcCodePage);
{$ELSE}
Result := Utf8ToStringA(U8Str)
else
Result := U8Str;
{$ENDIF}
end;
--
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] Found a bug and made a fix in function UrlDecode

2010-08-05 Thread Bjørnar Nielsen
A little change inside the function also must be made to make it work:

The line with htoi2 need a little change, the complete code is this:

function UrlDecode(const S : AnsiString; SrcCodePage: Cardinal = CP_ACP;
  DetectUtf8: Boolean = TRUE) : String;
var
I, J, L : Integer;
U8Str   : AnsiString;
Ch  : AnsiChar;
begin
L := Length(S);
SetLength(U8Str, L);
I := 1;
J := 0;
while (I = L) and (S[I]  '') do begin
Ch := AnsiChar(S[I]);
if Ch = '%' then begin
Ch := AnsiChar(htoi2(PAnsiChar(@S[I + 1])));
Inc(I, 2);
end
else if Ch = '+' then
Ch := ' ';
Inc(J);
U8Str[J] := Ch;
Inc(I);
end;
SetLength(U8Str, J);
if (SrcCodePage = CP_UTF8) or (DetectUtf8 and IsUtf8Valid(U8Str)) then
{$IFDEF COMPILER12_UP}
Result := Utf8ToStringW(U8Str)
else
Result := AnsiToUnicode(U8Str, SrcCodePage);
{$ELSE}
Result := Utf8ToStringA(U8Str)
else
Result := U8Str;
{$ENDIF}
end;

Regards
Bjørnar

-Original Message-
From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On 
Behalf Of Bjørnar Nielsen
Sent: 5. august 2010 12:52
To: ICS support mailing (twsocket@elists.org)
Subject: [twsocket] Found a bug and made a fix in function UrlDecode

Proposal to a fix on bug in UrlDecode in OverbyteIcsUrl.pas and 
OverbyteIcsHttpSrv.pas.

When calling the function like this:
Memo2-Text = UrlDecode(Ã...ge,CP_ACP,false); // Ã...ge is 
Memo2-UTF8encoding of Åge

The resulting text in Memo2 is Ãge and is impossible to UTF8-dekode back to 
the original text.

The fix is to change this:
function UrlDecode(const S : String; SrcCodePage: Cardinal = CP_ACP;
  DetectUtf8: Boolean = TRUE) : String;

To this:
function UrlDecode(const S : AnsiString; SrcCodePage: Cardinal = CP_ACP;
  DetectUtf8: Boolean = TRUE) : String;

Anyone have any comment on this fix?

Regards Bjørnar

--
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] Found a bug and made a fix in function UrlDecode

2010-08-05 Thread Bjørnar Nielsen

 Ã...ge is not a valid URL encoded string.

I know, but it is valid UTF8. I think trying to url-decode it should not break 
the string. I have a webserver that works against different clients, and not 
all of the clients url-encode data in the url. But all of the clients 
UTF8-encode data. That means that if I try to url-decode utf8-data that’s not 
url-encoded, the data gets messed up and I had a problem until I made this fix.

Regards Bjørnar
--
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] Strange bug in WSocketServer

2010-03-10 Thread Bjørnar Nielsen
I use Codegear2010 C++-builder and have a strange problem. The following code 
gives me the error:
--
TWSocketServer * WSocketServer1=new TWSocketServer(this);
WSocketServer1-Listen();
-

The call to Listen calls Abort instead of Listen in the pas-file (set a 
breakpoint to Listen and press F7 to step into the procedure). Can anyone with 
the same codegear-version test this and see if others too have the same error? 
I have no problem with HttpServer and other components.

Regards
Bjørnar


--
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 bug in WSocketServer

2010-03-10 Thread Bjørnar Nielsen
Thanks for testing.

It seems I've messed up my packages. Recompiling all installed third party 
components seems to fix my problem.

Sorry for wasting anybodys time.

Regards 
Bjørnar

-Original Message-
From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On 
Behalf Of Arno Garrels
Sent: 10. mars 2010 14:39
To: ICS support mailing
Subject: Re: [twsocket] Strange bug in WSocketServer

Bjørnar Nielsen wrote:
 I use Codegear2010 C++-builder and have a strange problem. The
 following code gives me the error: 
 --
 TWSocketServer * WSocketServer1=new TWSocketServer(this);
 WSocketServer1-Listen();
 -

No problem here, of course I get a socket exception Port not assigned.

--
Arno Garrels
--
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] Bug and proposal for fix in TsslHttpCli using proxy

2010-02-17 Thread Bjørnar Nielsen
Sorry, sent to early. Here is the rest of the text.

I got the version 706 of OverbyteIscHttpProt.pas toady.

On line 3638 and 2629 is the source of the problem.

When state is httpWaitingProxyConnect and if the answer from proxy contains 200 
OK, then the process stops and nothing more happens.

My first thougt is to change these lines:
   ) and not
   ((StrLIComp(PAnsiChar(FReceiveBuffer), AnsiString('HTTP/1.1 200 
OK'), 15) = 0) or
   (StrLIComp(PAnsiChar(FReceiveBuffer), AnsiString('HTTP/1.0 200 OK'), 
15) = 0)) then

If the proxy have an errortext to send to the client, I think the proxy sends 
200 OK and a document. I think that if we add to these lines that the 
content-length also have to be 0 all is fixed.

Then proxies that answers 200 OK and content-length is 0 (no error) when 
connection is established will work, and when content-length is more than 0 
(proxy send us a description of an error) then we don't continue to send data.

Any thoughts on this anyone?

Regards
Bjørnar Nielsen


_
From: Bjørnar Nielsen
Sent: 17. februar 2010 21:41
To: ICS support mailing
Subject: [twsocket] Bug and proposal for fix in TsslHttpCli using proxy


I have found a bug using https through proxy.

After connect-command to the the proxy it answers back to the client 200 
Connection established.

I have come across some proxy-servers that answers 200 OK back to the client. 
This is a problem for TsslHttpCli.

--
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] Bug and proposal for fix in TsslHttpCli using proxy

2010-02-17 Thread Bjørnar Nielsen
I have found a bug using https through proxy.

After connect-command to the the proxy it answers back to the client 200 
Connection established.

I have come across some proxy-servers that answers 200 OK back to the client. 
This is a problem for TsslHttpCli.

--
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] Latest change in OverbyteIcsMimeDec.p as (Bjørnar, Angus)

2009-10-18 Thread Bjørnar Nielsen
 OverbyteIcsMimeDec.pas around line #2258
 
 PFileName := DecodeMimeInlineValue (FDecodeW.FileName) ;
 PSubject := FDecodeW.Subject;   {V7.18 Bjørnar}
 
 The subject should be IMO MIME inline decoded, shouldn't it?
 
 Probably, although since the subject does not apply to MIME parts I
 did not really understand the purpose of the change, but it was fully
 backward compatible g

1) It's my understanding that the subject shouldn't be a member of 
TPartInfos at all.  

When an attachment is of type message/rfc822 it would be nice to have the 
subject of the attached message in the partinfo-object. But the subject is not 
in the mime-part so I agree it does not make sense now unless the message is 
parsed to get the subject for the attached message.

Regards
Bjørnar
--
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] Proposal for more contenttypes in DocumentToContentType in OverbyteIcsHttpSrv.pas

2009-09-13 Thread Bjørnar Nielsen
else if (Ext = 'doc') or (Ext = 'docx') then
Result := 'application/msword'
else if (Ext = 'xls') or (Ext = 'xlsx') then
Result := 'application/vnd.ms-excel'
else if (Ext = 'ppt') or (Ext = 'pptx') then
Result := 'application/vnd.ms-powerpoint'

Regards Bjørnar

--
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] WSocket.Name, NO_ADV_MT and SafeWSocketGCount

2009-08-12 Thread Bjørnar Nielsen
From latest snapshot, V7 with SSL, I get this error:
[DCC Error] OverbyteIcsSmtpProt.pas(1665): E2003 Undeclared identifier: 
'SafeWSocketGCount'
FWSocket.Name:= ClassName + '_Socket' + IntToStr(SafeWSocketGCount);

SafeWSocketGCount is defined like this:
{$IFNDEF NO_ADV_MT}
function SafeWSocketGCount : Integer;
{$ENDIF}

Is the best fix to set the name on the socket only when NO_ADV_MT is not 
defined? Or must the name on the socket always be set?

Regards Bjørnar
--
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] Proposal for new content-type in function DocumentToContentType in OverbyteIcsHttpSrv.pas

2008-04-09 Thread Bjørnar Nielsen
Hello,

The comment about the registry was there before I made any changes. My only 
change was to add 'text/xml' as content-type for extension 'xml'. For now my 
only need is this extra content-type, not another way of managing the list of 
content-types.

When using Flash, if you have the need to do cross-domain-scripting, you have 
to have a file called crossdomain.xml on the root, defining the rules for 
crossdomain-scripting. And the content-type has to be text/xml when downloaded 
to flash from a server in order to work.

Regards Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of DZ-Jay
Sent: 8. april 2008 16:11
To: ICS support mailing
Subject: Re: [twsocket] Proposal for new content-type in function 
DocumentToContentType in OverbyteIcsHttpSrv.pas

On Apr 8, 2008, at 09:45, Bjørnar Nielsen wrote:
 { We probably should use the registry to find MIME type for file
 types }

Hello:
I don't agree that the Registry should be used, because then you limit
the application to those MIME types registered at the local host.  What
I propose is that a simple list of mappings between extensions and MIME
types be kept and maintained with ICS (there are many of these
available already), and that an efficient mechanism be built into the
HttpSrv to load these on start up to some sort of searchable memory
structure.  I have done this in the past using a custom Red and Black
Balanced Tree, which can then be searched to find the MIME type of a
file extension (and even its transport encoding).  I actually
implemented this for automatic file encodings of SMTP attachments.

By keeping it in a simple list, like Apache does, it can be easily
extended and maintained.

dZ.

--
DZ-Jay [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html

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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.9/1364 - Release Date: 07.04.2008 
18:38


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.10/1366 - Release Date: 08.04.2008 
17:03

-- 
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] SMTPProt.pas

2008-04-08 Thread Bjørnar Nielsen
Arno,

I tested your version of the code in my projects and it works fine. So I would 
like to see these changes in the next version of ICS.

Regards Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Arno Garrels
Sent: 7. april 2008 17:00
To: ICS support mailing
Subject: Re: [twsocket] SMTPProt.pas

Bjørnar Nielsen wrote:
 Arno,

 I think you know this bether than me, but I think you are right.
 Calling RequestDone with errormessage would also solve the problem
 for me.

A 500 status code were probably more suitable indicating a persistent
error, like '500 Internal client error ..'.

I changed DoHighLevelAsync in my copy as below, anybody any veto?
My projects only use the non-highlevel methods, so I never hit that.


procedure TCustomSmtpClient.DoHighLevelAsync;
begin
{$IFDEF TRACE} TriggerDisplay('! HighLevelAsync ' + IntToStr(FRequestResult)); 
{$ENDIF}
if FState = smtpAbort then begin
{$IFDEF TRACE} TriggerDisplay('! Abort detected'); {$ENDIF}
FFctSet := [];
FHighLevelResult := 426;
FRequestResult   := 426;  { SJF }
FErrorMessage:= '426 Operation aborted.';
end;

FNextRequest := DoHighLevelAsync;

if FRequestResult  0 then begin
{ Previous command had errors }
{ EHLO wasn't supported, so just log in with HELO }
if FFctPrv = smtpFctEhlo then
FFctSet := [smtpFctHelo]
else begin
FHighLevelResult := FRequestResult;
if (FFctPrv = smtpFctQuit) or (not (smtpFctQuit in FFctSet)) then
FFctSet := []
else
FFctSet := [smtpFctQuit];
end;
end;

try
if smtpFctConnect in FFctSet then begin
FFctPrv := smtpFctConnect;
FFctSet := FFctSet - [FFctPrv];
Connect;
Exit;
end;

if smtpFctHelo in FFctSet then begin
FFctPrv := smtpFctHelo;
FFctSet := FFctSet - [FFctPrv];
Helo;
Exit;
end;

if smtpFctEhlo in FFctSet then begin
FFctPrv := smtpFctEhlo;
FFctSet := FFctSet - [FFctPrv];
Ehlo;
Exit;
end;

if smtpFctAuth in FFctSet then begin
FFctPrv := smtpFctAuth;
FFctSet := FFctSet - [FFctPrv];
Auth;
Exit;
end;

if smtpFctVrfy in FFctSet then begin
FFctPrv := smtpFctVrfy;
FFctSet := FFctSet - [FFctPrv];
Vrfy;
Exit;
end;

if smtpFctMailFrom in FFctSet then begin
FFctPrv := smtpFctMailFrom;
FFctSet := FFctSet - [FFctPrv];
MailFrom;
Exit;
end;

if smtpFctRcptTo in FFctSet then begin
FFctPrv := smtpFctRcptTo;
FFctSet := FFctSet - [FFctPrv];
RcptTo;
Exit;
end;

if smtpFctData in FFctSet then begin
FFctPrv := smtpFctData;
FFctSet := FFctSet - [FFctPrv];
Data;
Exit;
end;

if smtpFctQuit in FFctSet then begin
FFctPrv := smtpFctQuit;
FFctSet := FFctSet - [FFctPrv];
Quit;
Exit;
end;

except
on E : Exception do begin
  {$IFDEF TRACE}
TriggerDisplay('! ' + E.ClassName + ': ' + E.Message + '');
  {$ENDIF}
FHighLevelResult := 500;
FRequestResult   := 500;
FErrorMessage:= '500 Internal client error ' +
E.ClassName + ': ' + E.Message + '';
end;
end;

{$IFDEF TRACE} TriggerDisplay('! HighLevelAsync done'); {$ENDIF}
FFctSet  := [];
FNextRequest := nil;
FRequestDoneFlag := FALSE;
TriggerRequestDone(FHighLevelResult);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}




 Regards Bjørnar

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Arno Garrels
 Sent: 7. april 2008 12:15
 To: ICS support mailing
 Subject: Re: [twsocket] SMTPProt.pas

 Bjørnar,

 Won't it be smarter to trigger RequestDone with an error and the
 exception message?
 Someting like:

 procedure TCustomSmtpClient.DoHighLevelAsync;
 [..]
 try
 [..]
 except
 on E:Exception do begin
   {$IFDEF TRACE}
 TriggerDisplay('! ' + E.ClassName + ': ' + E.Message +
 '');
   {$ENDIF}
 FHighLevelResult := 427; // Just invented this error
 number hopefully not in use
 FRequestResult   := 427;
 FErrorMessage:= '427 ' + E.ClassName + ': ' +
 E.Message + '';
 end;
 end; {Bjørnar}

 {$IFDEF TRACE} TriggerDisplay('! HighLevelAsync done'); {$ENDIF}
 FFctSet  := [];
 FNextRequest := nil;
 FRequestDoneFlag := FALSE

Re: [twsocket] Improvements in OverbyteIcsHttpSrv.pas

2008-04-08 Thread Bjørnar Nielsen
Have anyone looked through my changes? Basicly it's enhancements for keepalive 
when serving 401, 404 etc and triggering RequestDone after serving a 401. My 
server has been running for 1 week (served 23083567 requests on 9233427 
sockets) with this code and works well.

Regards Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bjørnar Nielsen
Sent: 4. april 2008 12:57
To: ICS support mailing
Subject: [twsocket] Improvements in OverbyteIcsHttpSrv.pas



I've made som improvements on keepalive. The file can be downloaded here:

www.edialog24.no/download/OverbyteIcsHttpSrv.pas



Please look through the changes and comment.



I added new property FConnection (to define max requests pr connection, 
keepalivetime etc).

I added triggering of Httprequestdone also after answering 403 etc (not sure if 
this breaks anything)

I added keepalive string in the header also for 403 etc and closedelayed if not 
keepalive. This makes it easyer to call Answer403 etc from your own code and 
still get keepalive-stuff right without special handling.



Regards Bjørnar


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.5/1358 - Release Date: 03.04.2008 
18:36

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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.5/1358 - Release Date: 03.04.2008 
18:36


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.9/1364 - Release Date: 07.04.2008 
18:38

-- 
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] Proposal for new content-type in function DocumentToContentType in OverbyteIcsHttpSrv.pas

2008-04-08 Thread Bjørnar Nielsen
Se the new content-type at the bottom (xml):



function DocumentToContentType(FileName : String) : String;

var

Ext : String;

begin

{ We probably should use the registry to find MIME type for file types }

Ext := LowerCase(ExtractFileExt(FileName));

if Length(Ext)  1 then

Ext := Copy(Ext, 2, Length(Ext));

if (Ext = 'htm') or (Ext = 'html') then

Result := 'text/html'

else if Ext = 'gif' then

Result := 'image/gif'

else if Ext = 'bmp' then

Result := 'image/bmp'

else if (Ext = 'jpg') or (Ext = 'jpeg') then

Result := 'image/jpeg'

else if (Ext = 'tif') or (Ext = 'tiff') then

Result := 'image/tiff'

else if Ext = 'txt' then

Result := 'text/plain'

else if Ext = 'css' then

Result := 'text/css'

else if Ext = 'wav' then

Result := 'audio/x-wav'

else if Ext = 'ico' then

Result := 'image/x-icon'

{ WAP support begin }

else if Ext = 'wml' then

Result := 'text/vnd.wap.wml'

else if Ext = 'wbmp' then

Result := 'image/vnd.wap.wbmp'

else if Ext = 'wmlc' then

Result := 'application/vnd.wap.wmlc'

else if Ext = 'wmlscript' then

Result := 'text/vnd.wap.wmlscript'

else if Ext = 'wmlscriptc' then

Result := 'application/vnd.wap.wmlscriptc'

{ WAP support end }

else if Ext = 'pdf' then

Result := 'application/pdf'

else if Ext = 'xml' then

Result := 'text/xml'

else

Result := 'application/binary';

end;



Regards Bjørnar


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.9/1364 - Release Date: 07.04.2008 
18:38

-- 
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] SMTPProt.pas

2008-04-07 Thread Bjørnar Nielsen
Arno,

I think you know this bether than me, but I think you are right. Calling 
RequestDone with errormessage would also solve the problem for me.

Regards Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Arno Garrels
Sent: 7. april 2008 12:15
To: ICS support mailing
Subject: Re: [twsocket] SMTPProt.pas

Bjørnar,

Won't it be smarter to trigger RequestDone with an error and the
exception message?
Someting like:

procedure TCustomSmtpClient.DoHighLevelAsync;
[..]
try
[..]
except
on E:Exception do begin
  {$IFDEF TRACE}
TriggerDisplay('! ' + E.ClassName + ': ' + E.Message + '');
  {$ENDIF}
FHighLevelResult := 427; // Just invented this error number 
hopefully not in use
FRequestResult   := 427;
FErrorMessage:= '427 ' + E.ClassName + ': ' + E.Message + '';
end;
end; {Bjørnar}

{$IFDEF TRACE} TriggerDisplay('! HighLevelAsync done'); {$ENDIF}
FFctSet  := [];
FNextRequest := nil;
FRequestDoneFlag := FALSE;
TriggerRequestDone(FHighLevelResult);
end;

Bjørnar Nielsen wrote:
 I think there is a wakness/bug in the smtpprot.pas:

 procedure TCustomSmtpClient.RcptTo;

 begin

 if FRcptName.Count = 0 then

 raise SmtpException.Create('RcptName list is empty');



 FItemCount := -1;

 RcptToNex



 When this exception is raised, I cant catch it anywhere. No
 bgexception, no requestdone. I added try/except in this procedure
 (all the code in this procedure inside the try):

 procedure TCustomSmtpClient.DoHighLevelAsync;

  like this:

 except  {Bjørnar}

   on E:Exception do {Bjørnar}

   HandleBackGroundException(E); {Bjørnar}

 end;{Bjørnar}



 then I was able to catch it and shut down and release the
 smtp-component. Any comments on this change?



 Regards Bjørnar


 No virus found in this outgoing message.
 Checked by AVG.
 Version: 7.5.519 / Virus Database: 269.22.5/1356 - Release Date:
 02.04.2008 16:14
--
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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.8/1362 - Release Date: 06.04.2008 
11:12


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.8/1362 - Release Date: 06.04.2008 
11:12

-- 
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] Improvements in OverbyteIcsHttpSrv.pas

2008-04-04 Thread Bjørnar Nielsen


I've made som improvements on keepalive. The file can be downloaded here:

www.edialog24.no/download/OverbyteIcsHttpSrv.pas



Please look through the changes and comment.



I added new property FConnection (to define max requests pr connection, 
keepalivetime etc).

I added triggering of Httprequestdone also after answering 403 etc (not sure if 
this breaks anything)

I added keepalive string in the header also for 403 etc and closedelayed if not 
keepalive. This makes it easyer to call Answer403 etc from your own code and 
still get keepalive-stuff right without special handling.



Regards Bjørnar


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.5/1358 - Release Date: 03.04.2008 
18:36

-- 
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] SMTPProt.pas

2008-04-03 Thread Bjørnar Nielsen
I think there is a wakness/bug in the smtpprot.pas:

procedure TCustomSmtpClient.RcptTo;

begin

if FRcptName.Count = 0 then

raise SmtpException.Create('RcptName list is empty');



FItemCount := -1;

RcptToNex



When this exception is raised, I cant catch it anywhere. No bgexception, no 
requestdone. I added try/except in this procedure (all the code in this 
procedure inside the try):

procedure TCustomSmtpClient.DoHighLevelAsync;

 like this:

except  {Bjørnar}

  on E:Exception do {Bjørnar}

  HandleBackGroundException(E); {Bjørnar}

end;{Bjørnar}



then I was able to catch it and shut down and release the smtp-component. Any 
comments on this change?



Regards Bjørnar


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.5/1356 - Release Date: 02.04.2008 
16:14

-- 
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] Proposal for new feature in OverbyteIcsSmtpProt.pas

2008-03-26 Thread Bjørnar Nielsen
I did not know of this header-field.

Why not add properties for both? The xautogeneratedreply works for my purpose 
and the mailservers I have testet against.

Regards Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of DZ-Jay
Sent: 26. mars 2008 10:07
To: ICS support mailing
Subject: Re: [twsocket] Proposal for new feature in OverbyteIcsSmtpProt.pas

Hello:
I don't think this is necessary.  First, this headers should be
handled by the application (and indeed can easily be done as you
pointed out).  Second, there is a conventional X-Loop header used and
supported by many MTAs.

http://www.ninebynine.org/IETF/Messaging/draft-klyne-hdrreg-mail
-00.html#hdr.X-Loop

Most delivery agents do this automatically.  It is extremely unlikely
that two modern SMTP servers enter in a delivery loop, because this
used to be such a big problem before.  In any case, this should be
handled at the server level, and SmtpProt is intended to be an SMTP
client.

dZ.

  --
DZ-Jay [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


On Mar 25, 2008, at 15:27, Bjørnar Nielsen wrote:

 New property:

 property  XAutoGeneratedReply : Boolean  read
 FXAutoGeneratedReply  {Bjørnar}


  write FXAutoGeneratedReply; {Bjørnar}



 The reason for using this is to tell the receiving mailserver that it
 should not answer this email with I'm on holliday or similar. Two
 mailservers could send each other mails in definite if no one breaks
 the loop. So if you are sending an autogenerated mail, set this flag
 to not get a autogenerated mail back.



 In procedure TCustomSmtpClient.Data;

 if FXAutoGeneratedReply then begin
   {Bjørnar}

  FHdrLines.Add('X-Autogenerated: Reply');
   {Bjørnar}

 end;
   {Bjørnar}

 Regards Bjørnar

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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1343 - Release Date: 25.03.2008 
19:17


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1343 - Release Date: 25.03.2008 
19:17

-- 
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] Proposal for new feature in OverbyteIcsSmtpProt.pas

2008-03-26 Thread Bjørnar Nielsen
I have made a sollution where I send a receipt to the sender of an email, 
telling, Thanks for your reply, your case nr is: #234 etc.

The loop is when the mail I send the receipt to is a similar solution telling 
me their case nr etc. Off course I break the loop when I get the second reply, 
but I don't want any replys. I don't want a receipt back from my outgoing 
receipt. This is why I want to set this header-info.

Regards Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of DZ-Jay
Sent: 26. mars 2008 13:57
To: ICS support mailing
Subject: Re: [twsocket] Proposal for new feature in OverbyteIcsSmtpProt.pas

Bjørnar Nielsen wrote:
 I did not know of this header-field.

 Why not add properties for both? The xautogeneratedreply works for my purpose 
 and the mailservers I have testet against.

 Regards Bjørnar

Well, because delivery loops are a server problem, and a mail user agent
not only should not take the burden of protecting against them, but
cannot be trusted to do so (after all, if a server is vulnerable to
this, a MUA will most definitely be the attack vector to it).

Have you really encountered a delivery loop with a mail server?  If so,
you should communicate it to the server administrator, as this is
usually a configuration problem.

dZ.



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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1343 - Release Date: 25.03.2008 
19:17


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1343 - Release Date: 25.03.2008 
19:17

-- 
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] Cathing window messages for HttpSrv

2008-03-25 Thread Bjørnar Nielsen
I'm using PostThreadMessage to send messages to my thread, but I want to 
interrupt messages that is intended to go to a WSocket-component.

The reason is that I'm trying to make my HTTPSrv multithreaded. My idea was to 
intercept Do_FD_ACCEPT, pause the socket, send a custom message to another 
thread where I attach the socket and continue with Do_FD_ACCEPT. Is this a good 
way to achieve this? Or has anyone here achieved this in another way?

Regards Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Arno Garrels
Sent: 19. mars 2008 10:52
To: ICS support mailing
Subject: Re: [twsocket] Cathing window messages for HttpSrv

Bjørnar Nielsen wrote:
 I'm using the THttpSrv in a thread, and want to catch the windows
 message to the server. How is this possible?

It's safe to use PostThreadMessage() for those custom messages,
however you must check for msg.Hwnd = 0 in your message pump
otherwise you risk conflicts with the message-ID numbers ICS v6
uses internally.


 My messagepump int the execute of the thread is like this:

 while(!Terminated  GetMessage(msg, 0, 0, 0))

 {

switch(msg.message)

{

case WM_CUSTOM_SET_SERVER_SETTINGS:

[..]

 How can I catch FD_ACCEPT and other messages and get the receiving
 control for this message? I Use ICS V6 and don't understand how the
 TIcsWndHandler works. Does anyone have examples for this?

You could override the WndProc() procedure of a component and trap
FMsg_WM_ASYNCSELECT. Have a look at TCustomWSocket.WMASyncSelect()
for an example of how to catch FD_ACCEPT.

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










 Regards Bjørnar


 No virus found in this outgoing message.
 Checked by AVG.
 Version: 7.5.519 / Virus Database: 269.21.7/1332 - Release Date:
 17.03.2008 10:48
--
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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.21.7/1334 - Release Date: 18.03.2008 
20:52


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1341 - Release Date: 24.03.2008 
15:03

-- 
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] Cathing window messages for HttpSrv

2008-03-25 Thread Bjørnar Nielsen

I do lengthy operations in another context/thread than the thread where the 
servers are. I'm just looking for better IO-performance. Currently I have one 
http-server and a https-server which is working in the same thread. The 
http-server have 1200 connections and the Https-server have 150 connections 
open. In total the servers serve about 100 requests pr second. In near future 
the traffic could increase. As I understand, I could benefit from spreading the 
http-server-work in a few more threads.

- I don't use critical sections now, all communications between the threads is 
done with posting messages. I think using a few more threads and just use 
windows messages to do this would be best. Is this right? How can I achieve 
this?
- I saw that there is content-coding (Z-lib) in HttpCli, is it working? In the 
source of httpsrv it says it is not working. Is there much work needed for it 
to work? Would I gain much performance with this feature enabled on the server?

Regards Bjørnar


Bjørnar Nielsen wrote:
 I'm using PostThreadMessage to send messages to my thread, but I want
 to interrupt messages that is intended to go to a WSocket-component.

 The reason is that I'm trying to make my HTTPSrv multithreaded. My
 idea was to intercept Do_FD_ACCEPT, pause the socket, send a custom
 message to another thread where I attach the socket and continue with
 Do_FD_ACCEPT. Is this a good way to achieve this? Or has anyone here
 achieved this in another way?

I think it is not easily possible like that, since the THttpServer is
not derived from TWSocketServer. IMO, it's easier to either apply a
similar method as shown in demo ThrdSrv (V5) or to use/write a
multi-threaded WSocketServer-class and to change three or four source
lines in the THttpServer so that FWSocketServer becomes multi-threaded.
You should also consider to just move lengthy tasks into worker
threads, for instance like it's practised in the TFtpServer for
calculating MD5 checksums from big files (search for
TClientProcessingThread). I prefer the latter, perhaps in
conjunction with a little thread pool.

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




 Regards Bjørnar

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Arno Garrels
 Sent: 19. mars 2008 10:52
 To: ICS support mailing
 Subject: Re: [twsocket] Cathing window messages for HttpSrv

 Bjørnar Nielsen wrote:
 I'm using the THttpSrv in a thread, and want to catch the windows
 message to the server. How is this possible?

 It's safe to use PostThreadMessage() for those custom messages,
 however you must check for msg.Hwnd = 0 in your message pump
 otherwise you risk conflicts with the message-ID numbers ICS v6
 uses internally.


 My messagepump int the execute of the thread is like this:

 while(!Terminated  GetMessage(msg, 0, 0, 0))

 {

switch(msg.message)

{

case WM_CUSTOM_SET_SERVER_SETTINGS:

 [..]

 How can I catch FD_ACCEPT and other messages and get the receiving
 control for this message? I Use ICS V6 and don't understand how the
 TIcsWndHandler works. Does anyone have examples for this?

 You could override the WndProc() procedure of a component and trap
 FMsg_WM_ASYNCSELECT. Have a look at TCustomWSocket.WMASyncSelect()
 for an example of how to catch FD_ACCEPT.

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










 Regards Bjørnar


 No virus found in this outgoing message.
 Checked by AVG.
 Version: 7.5.519 / Virus Database: 269.21.7/1332 - Release Date:
 17.03.2008 10:48
 --
 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

 No virus found in this incoming message.
 Checked by AVG.
 Version: 7.5.519 / Virus Database: 269.21.7/1334 - Release Date:
 18.03.2008 20:52


 No virus found in this outgoing message.
 Checked by AVG.
 Version: 7.5.519 / Virus Database: 269.22.0/1341 - Release Date:
 24.03.2008 15:03
--
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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1341 - Release Date: 24.03.2008 
15:03


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1341 - Release Date: 24.03.2008 
15:03

-- 
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] Cathing window messages for HttpSrv

2008-03-25 Thread Bjørnar Nielsen
My idea was to make 5 threads. Each of the threads would have a HttpSrv, but I 
make only one of them Listen.
So one thread just listens, accepted connections would be distributed to one of 
the other 4 threads and belong to the HttpSrv-component residing in this thread 
(or even maybe make one of the 4 threads accept the connection instead of the 
listening one). The other 4 threads are owning all the connections, sending and 
receiving data and could have maybe 100 connections each, triggering 
GetDocument etc. Without analyzing code I thought this could be done with the 
least effort and without critical sections etc.

Regards Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Francois PIETTE
Sent: 25. mars 2008 19:00
To: ICS support mailing
Subject: Re: [twsocket] Cathing window messages for HttpSrv

You have an OnClientConnect event which might be used to do things at
connection time. Probably you can use it to attach to a worker thread.

In any case, you have to verify the the client socket (THttpConnection)
doesn't do anything which is not threadsafe.

Another way is to let the HTTP server component handle everything in his own
thread (usually the main threads but you can change that) and create worker
thread only to process requests to serve OnGetDocument event and the likes.
You can send the answer later, for example when the thread terminate (or is
returned to a thread pool).

--
[EMAIL PROTECTED]
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


- Original Message -
From: Bjørnar Nielsen [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Tuesday, March 25, 2008 11:56 AM
Subject: Re: [twsocket] Cathing window messages for HttpSrv


I'm using PostThreadMessage to send messages to my thread, but I want to
interrupt messages that is intended to go to a WSocket-component.

The reason is that I'm trying to make my HTTPSrv multithreaded. My idea was
to intercept Do_FD_ACCEPT, pause the socket, send a custom message to
another thread where I attach the socket and continue with Do_FD_ACCEPT. Is
this a good way to achieve this? Or has anyone here achieved this in another
way?

Regards Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Arno Garrels
Sent: 19. mars 2008 10:52
To: ICS support mailing
Subject: Re: [twsocket] Cathing window messages for HttpSrv

Bjørnar Nielsen wrote:
 I'm using the THttpSrv in a thread, and want to catch the windows
 message to the server. How is this possible?

It's safe to use PostThreadMessage() for those custom messages,
however you must check for msg.Hwnd = 0 in your message pump
otherwise you risk conflicts with the message-ID numbers ICS v6
uses internally.


 My messagepump int the execute of the thread is like this:

 while(!Terminated  GetMessage(msg, 0, 0, 0))

 {

switch(msg.message)

{

case WM_CUSTOM_SET_SERVER_SETTINGS:

[..]

 How can I catch FD_ACCEPT and other messages and get the receiving
 control for this message? I Use ICS V6 and don't understand how the
 TIcsWndHandler works. Does anyone have examples for this?

You could override the WndProc() procedure of a component and trap
FMsg_WM_ASYNCSELECT. Have a look at TCustomWSocket.WMASyncSelect()
for an example of how to catch FD_ACCEPT.

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










 Regards Bjørnar


 No virus found in this outgoing message.
 Checked by AVG.
 Version: 7.5.519 / Virus Database: 269.21.7/1332 - Release Date:
 17.03.2008 10:48
--
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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.21.7/1334 - Release Date: 18.03.2008
20:52


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1341 - Release Date: 24.03.2008
15:03

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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1341 - Release Date: 24.03.2008 
15:03


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1341 - Release Date: 24.03.2008 
15:03

-- 
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] Proposal for new feature in OverbyteIcsSmtpProt.pas

2008-03-25 Thread Bjørnar Nielsen
New property:

property  XAutoGeneratedReply : Boolean  read  FXAutoGeneratedReply  
{Bjørnar}


write FXAutoGeneratedReply; {Bjørnar}



The reason for using this is to tell the receiving mailserver that it should 
not answer this email with I'm on holliday or similar. Two mailservers could 
send each other mails in definite if no one breaks the loop. So if you are 
sending an autogenerated mail, set this flag to not get a autogenerated mail 
back.



In procedure TCustomSmtpClient.Data;

if FXAutoGeneratedReply then begin   
{Bjørnar}

 FHdrLines.Add('X-Autogenerated: Reply');
{Bjørnar}

end; 
{Bjørnar}

Regards Bjørnar




No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1341 - Release Date: 24.03.2008 
15:03

-- 
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] Cathing window messages for HttpSrv

2008-03-18 Thread Bjørnar Nielsen
I'm using the THttpSrv in a thread, and want to catch the windows message to 
the server. How is this possible?

My messagepump int the execute of the thread is like this:

while(!Terminated  GetMessage(msg, 0, 0, 0))

{

   switch(msg.message)

   {

   case WM_CUSTOM_SET_SERVER_SETTINGS:

  SetServerSettings((ServerSettings*)msg.wParam);

  break;



   default:

  TranslateMessage(msg);

  DispatchMessage(msg);

  break;

   }

}



How can I catch FD_ACCEPT and other messages and get the receiving control for 
this message? I Use ICS V6 and don't understand how the TIcsWndHandler works. 
Does anyone have examples for this?





Regards Bjørnar


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.21.7/1332 - Release Date: 17.03.2008 
10:48

-- 
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] New ICS-V6andICS-SSL-V6 available BCB COMPATIBILITY WARNING

2007-06-26 Thread Bjørnar Nielsen
I'm not sure renaming would solve the problem. If I remember correctly, I
tried to rename SendTo and 2 Send-procedures (I think it was one for sending
just a byte and another for sending more data) in the Httpclient-class. You
could try it also, maybe you could get it to work, I could not (I don't have
much experience coding Delphi).

Regards 
Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Fastream Technologies
Sent: 26. juni 2007 12:52
To: ICS support mailing
Subject: Re: [twsocket] [ICS-SSL] New ICS-V6andICS-SSL-V6 available BCB
COMPATIBILITY WARNING

Hint: I think the problem must be related with BCB making Delphi namespaces 
flat--global. IOW, the send and sendto in OverbyteIcsWinsock clashes with 
those in wsocket.pas. Not in delphi because they are in distinct separate 
namespaces in delphi but in BCB. As I said, renaming may be a solution, but 
a lot painful since would break compatibility.

Bjornar, What do you think? Agree?

Regards,

SZ

- Original Message - 
From: Fastream Technologies [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Tuesday, June 26, 2007 1:25 PM
Subject: Re: [ICS-SSL] New ICS-V6andICS-SSL-V6 available BCB COMPATIBILITY 
WARNING


 Sorry. Since the problem occurs with THttpServer, I think I should post to

 twsocket but can we assume all of the members of ics-ssl are also members 
 of twsocket?

 Also, will you (Francois) be debugging the problem? I created the most 
 simple test case for you as you always want us to do... We can pay for it.

 I wrote this as well but you said nothing about that..

 Best Regards,

 SZ

 - Original Message - 
 From: Francois Piette [EMAIL PROTECTED]
 To: SSL implementation for ICS [EMAIL PROTECTED]; ICS support 
 mailing twsocket@elists.org
 Sent: Tuesday, June 26, 2007 12:49 PM
 Subject: Re: [ICS-SSL] New ICS-V6andICS-SSL-V6 
 availableBCB2006COMPATIBILITYWARNING


 Please stop spamming the lists and myself. Use only one mailing list, the
 best suited for your problem. If you annoy please, they won't help you.
 Remember we have only volunteers here. No one is paid to answer your
 questions.

 --
 [EMAIL PROTECTED]
 http://www.overbyte.be

 - Original Message - 
 From: Fastream Technologies [EMAIL PROTECTED]
 To: 'SSL implementation for ICS' [EMAIL PROTECTED]; ICS support
 mailing twsocket@elists.org
 Cc: Francois PIETTE [EMAIL PROTECTED]
 Sent: Tuesday, June 26, 2007 11:10 AM
 Subject: Re: [ICS-SSL] New ICS-V6andICS-SSL-V6 
 availableBCB2006COMPATIBILITY
 WARNING


 Sorry it ought to be http://www.fastream.com/ics/LinkerBugTest.zip
 instead.

 Best Regards,

 SZ

 - Original Message - 
 From: Fastream Technologies [EMAIL PROTECTED]
 To: 'SSL implementation for ICS' [EMAIL PROTECTED]; ICS support
 mailing twsocket@elists.org
 Cc: Francois PIETTE [EMAIL PROTECTED]
 Sent: Tuesday, June 26, 2007 11:34 AM
 Subject: Re: New ICS-V6 andICS-SSL-V6 availableBCB2006COMPATIBILITY
 WARNING


  Hello,
 
  I have been able to reproduce the error with a 10-lines HTTP server 
  demo
  in BCB2006. Here it is: http://www.fastream.com/ics/LinkerBugTester.zip
 .
  It does not link! Francois, please help us fix this as it seems that
  Fastream is not the only company suffering from this in ALL (both SSL
 and
  normal) V6 under BCB6-2006.  You can count this for our consultancy
  budget.
 
  Best Regards,
 
  SZ
 
  - Original Message - 
  From: Bjørnar Nielsen [EMAIL PROTECTED]
  To: 'SSL implementation for ICS' [EMAIL PROTECTED]
  Sent: Tuesday, June 26, 2007 10:28 AM
  Subject: Re: [ICS-SSL] [twsocket] New ICS-V6 andICS-SSL-V6
  availableBCB2006COMPATIBILITY WARNING
 
 
  I had this problem myself when deriving the client-component in the
  webserver.
 
  I'm just guessing here that you have a project similar to the 
  webserver.
  The
  problem was that I could not use C++ to derive the client-component, I
 had
  to implement the derived class I Delphi. I never found another
 workaround.
  By the way, I use BCB Pro 6.0. I'm not sure if it's related to SSL or
 not.
  I
  got this problem when switching to ICS V6.
 
  Regards Bjørnar
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
  Behalf Of Fastream Technologies
  Sent: 25. juni 2007 20:35
  To: SSL implementation for ICS
  Subject: Re: [ICS-SSL] [twsocket] New ICS-V6 and ICS-SSL-V6
  availableBCB2006COMPATIBILITY WARNING
 
  I do not think it is a SSL problem. I saw this with versions prior to
  ICS-SSL!
 
  - Original Message - 
  From: Francois PIETTE [EMAIL PROTECTED]
  To: ICS support mailing twsocket@elists.org
  Sent: Monday, June 25, 2007 9:26 PM
  Subject: Re: [twsocket] New ICS-V6 and ICS-SSL-V6
  availableBCB2006COMPATIBILITY WARNING
 
 
  Please switch to ICS-SSL mailing list.
 
  -- 
  [EMAIL PROTECTED]
  http://www.overbyte.be
 
  - Original Message - 
  From: Fastream Technologies [EMAIL PROTECTED]
  To: ICS support mailing twsocket

Re: [twsocket] New ICS-V6andICS-SSL-V6 available BCB COMPATIBILITYWARNING

2007-06-26 Thread Bjørnar Nielsen
I don't have time to test you project, but I looked at the source, and I got
my error the same way, but the difference was that I also had to call the
send-method to trigger the linker-error. The combination of calling send and
setting classid made this error trigger.

Regards Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Fastream Technologies
Sent: 26. juni 2007 15:49
To: ICS support mailing
Subject: Re: [twsocket] New ICS-V6andICS-SSL-V6 available BCB
COMPATIBILITYWARNING

I am 99% sure it is a name clash now. I hope somebody profficient in Delphi 
can look to my demo. BTW, can you see the same error with my demo project?

Regards,

Gorkem

- Original Message - 
From: Bjørnar Nielsen [EMAIL PROTECTED]
To: 'ICS support mailing' twsocket@elists.org
Sent: Tuesday, June 26, 2007 2:54 PM
Subject: Re: [twsocket] New ICS-V6andICS-SSL-V6 available BCB 
COMPATIBILITYWARNING


I'm not sure renaming would solve the problem. If I remember correctly, I
tried to rename SendTo and 2 Send-procedures (I think it was one for sending
just a byte and another for sending more data) in the Httpclient-class. You
could try it also, maybe you could get it to work, I could not (I don't have
much experience coding Delphi).

Regards
Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Fastream Technologies
Sent: 26. juni 2007 12:52
To: ICS support mailing
Subject: Re: [twsocket] [ICS-SSL] New ICS-V6andICS-SSL-V6 available BCB
COMPATIBILITY WARNING

Hint: I think the problem must be related with BCB making Delphi namespaces
flat--global. IOW, the send and sendto in OverbyteIcsWinsock clashes with
those in wsocket.pas. Not in delphi because they are in distinct separate
namespaces in delphi but in BCB. As I said, renaming may be a solution, but
a lot painful since would break compatibility.

Bjornar, What do you think? Agree?

Regards,

SZ

- Original Message - 
From: Fastream Technologies [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Tuesday, June 26, 2007 1:25 PM
Subject: Re: [ICS-SSL] New ICS-V6andICS-SSL-V6 available BCB COMPATIBILITY
WARNING


 Sorry. Since the problem occurs with THttpServer, I think I should post to

 twsocket but can we assume all of the members of ics-ssl are also members
 of twsocket?

 Also, will you (Francois) be debugging the problem? I created the most
 simple test case for you as you always want us to do... We can pay for it.

 I wrote this as well but you said nothing about that..

 Best Regards,

 SZ

 - Original Message - 
 From: Francois Piette [EMAIL PROTECTED]
 To: SSL implementation for ICS [EMAIL PROTECTED]; ICS support
 mailing twsocket@elists.org
 Sent: Tuesday, June 26, 2007 12:49 PM
 Subject: Re: [ICS-SSL] New ICS-V6andICS-SSL-V6
 availableBCB2006COMPATIBILITYWARNING


 Please stop spamming the lists and myself. Use only one mailing list, the
 best suited for your problem. If you annoy please, they won't help you.
 Remember we have only volunteers here. No one is paid to answer your
 questions.

 --
 [EMAIL PROTECTED]
 http://www.overbyte.be

 - Original Message - 
 From: Fastream Technologies [EMAIL PROTECTED]
 To: 'SSL implementation for ICS' [EMAIL PROTECTED]; ICS support
 mailing twsocket@elists.org
 Cc: Francois PIETTE [EMAIL PROTECTED]
 Sent: Tuesday, June 26, 2007 11:10 AM
 Subject: Re: [ICS-SSL] New ICS-V6andICS-SSL-V6
 availableBCB2006COMPATIBILITY
 WARNING


 Sorry it ought to be http://www.fastream.com/ics/LinkerBugTest.zip
 instead.

 Best Regards,

 SZ

 - Original Message - 
 From: Fastream Technologies [EMAIL PROTECTED]
 To: 'SSL implementation for ICS' [EMAIL PROTECTED]; ICS support
 mailing twsocket@elists.org
 Cc: Francois PIETTE [EMAIL PROTECTED]
 Sent: Tuesday, June 26, 2007 11:34 AM
 Subject: Re: New ICS-V6 andICS-SSL-V6 availableBCB2006COMPATIBILITY
 WARNING


  Hello,
 
  I have been able to reproduce the error with a 10-lines HTTP server
  demo
  in BCB2006. Here it is: http://www.fastream.com/ics/LinkerBugTester.zip
 .
  It does not link! Francois, please help us fix this as it seems that
  Fastream is not the only company suffering from this in ALL (both SSL
 and
  normal) V6 under BCB6-2006.  You can count this for our consultancy
  budget.
 
  Best Regards,
 
  SZ
 
  - Original Message - 
  From: Bjørnar Nielsen [EMAIL PROTECTED]
  To: 'SSL implementation for ICS' [EMAIL PROTECTED]
  Sent: Tuesday, June 26, 2007 10:28 AM
  Subject: Re: [ICS-SSL] [twsocket] New ICS-V6 andICS-SSL-V6
  availableBCB2006COMPATIBILITY WARNING
 
 
  I had this problem myself when deriving the client-component in the
  webserver.
 
  I'm just guessing here that you have a project similar to the
  webserver.
  The
  problem was that I could not use C++ to derive the client-component, I
 had
  to implement the derived class I Delphi. I never found another
 workaround.
  By the way, I use BCB Pro 6.0. I'm not sure if it's

Re: [twsocket] New ICS-V6andICS-SSL-V6 availableBCB COMPATIBILITYWARNING

2007-06-26 Thread Bjørnar Nielsen
Now I'm not sure if I had to call send directly. But I had a derived class
and I set the classid. I got the same error as you when compiling. When I
removed the classid or made the the derived component in Delphi instead of
in C++ the error went away.

I got this error when upgrading from V5 to V6. I used SSL also but I'm not
sure if this has anything to do with it. I think this was the V6 awailable
about 6 months ago. I'm still using the same sources now. The version of
OverbyteIcsWinsock.pas I have now is 1.00.

Regards Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Fastream Technologies
Sent: 26. juni 2007 17:10
To: ICS support mailing
Subject: Re: [twsocket] New ICS-V6andICS-SSL-V6 availableBCB
COMPATIBILITYWARNING

Had you upgraded to the latest v6?

Regards,

SZ

- Original Message - 
From: Bjørnar Nielsen [EMAIL PROTECTED]
To: 'ICS support mailing' twsocket@elists.org
Sent: Tuesday, June 26, 2007 6:08 PM
Subject: Re: [twsocket] New ICS-V6andICS-SSL-V6 availableBCB 
COMPATIBILITYWARNING


I don't have time to test you project, but I looked at the source, and I got
my error the same way, but the difference was that I also had to call the
send-method to trigger the linker-error. The combination of calling send and
setting classid made this error trigger.

Regards Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Fastream Technologies
Sent: 26. juni 2007 15:49
To: ICS support mailing
Subject: Re: [twsocket] New ICS-V6andICS-SSL-V6 available BCB
COMPATIBILITYWARNING

I am 99% sure it is a name clash now. I hope somebody profficient in Delphi
can look to my demo. BTW, can you see the same error with my demo project?

Regards,

Gorkem

- Original Message - 
From: Bjørnar Nielsen [EMAIL PROTECTED]
To: 'ICS support mailing' twsocket@elists.org
Sent: Tuesday, June 26, 2007 2:54 PM
Subject: Re: [twsocket] New ICS-V6andICS-SSL-V6 available BCB
COMPATIBILITYWARNING


I'm not sure renaming would solve the problem. If I remember correctly, I
tried to rename SendTo and 2 Send-procedures (I think it was one for sending
just a byte and another for sending more data) in the Httpclient-class. You
could try it also, maybe you could get it to work, I could not (I don't have
much experience coding Delphi).

Regards
Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Fastream Technologies
Sent: 26. juni 2007 12:52
To: ICS support mailing
Subject: Re: [twsocket] [ICS-SSL] New ICS-V6andICS-SSL-V6 available BCB
COMPATIBILITY WARNING

Hint: I think the problem must be related with BCB making Delphi namespaces
flat--global. IOW, the send and sendto in OverbyteIcsWinsock clashes with
those in wsocket.pas. Not in delphi because they are in distinct separate
namespaces in delphi but in BCB. As I said, renaming may be a solution, but
a lot painful since would break compatibility.

Bjornar, What do you think? Agree?

Regards,

SZ

- Original Message - 
From: Fastream Technologies [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Tuesday, June 26, 2007 1:25 PM
Subject: Re: [ICS-SSL] New ICS-V6andICS-SSL-V6 available BCB COMPATIBILITY
WARNING


 Sorry. Since the problem occurs with THttpServer, I think I should post to

 twsocket but can we assume all of the members of ics-ssl are also members
 of twsocket?

 Also, will you (Francois) be debugging the problem? I created the most
 simple test case for you as you always want us to do... We can pay for it.

 I wrote this as well but you said nothing about that..

 Best Regards,

 SZ

 - Original Message - 
 From: Francois Piette [EMAIL PROTECTED]
 To: SSL implementation for ICS [EMAIL PROTECTED]; ICS support
 mailing twsocket@elists.org
 Sent: Tuesday, June 26, 2007 12:49 PM
 Subject: Re: [ICS-SSL] New ICS-V6andICS-SSL-V6
 availableBCB2006COMPATIBILITYWARNING


 Please stop spamming the lists and myself. Use only one mailing list, the
 best suited for your problem. If you annoy please, they won't help you.
 Remember we have only volunteers here. No one is paid to answer your
 questions.

 --
 [EMAIL PROTECTED]
 http://www.overbyte.be

 - Original Message - 
 From: Fastream Technologies [EMAIL PROTECTED]
 To: 'SSL implementation for ICS' [EMAIL PROTECTED]; ICS support
 mailing twsocket@elists.org
 Cc: Francois PIETTE [EMAIL PROTECTED]
 Sent: Tuesday, June 26, 2007 11:10 AM
 Subject: Re: [ICS-SSL] New ICS-V6andICS-SSL-V6
 availableBCB2006COMPATIBILITY
 WARNING


 Sorry it ought to be http://www.fastream.com/ics/LinkerBugTest.zip
 instead.

 Best Regards,

 SZ

 - Original Message - 
 From: Fastream Technologies [EMAIL PROTECTED]
 To: 'SSL implementation for ICS' [EMAIL PROTECTED]; ICS support
 mailing twsocket@elists.org
 Cc: Francois PIETTE [EMAIL PROTECTED]
 Sent: Tuesday, June 26, 2007 11:34 AM
 Subject: Re: New ICS-V6 andICS-SSL-V6 availableBCB2006COMPATIBILITY
 WARNING

Re: [twsocket] Performance on the latest ICS V6

2007-02-25 Thread Bjørnar Nielsen
I have not testet the performance on many connections. The test I did now
was a single download using Internet Explorer as client. The machine I used
(for server) is an old Pentium 3. It was not a big difference. I don't
remember the filesize, but download takes about 40 seconds. V5 used about
3-4 seconds less on the download than V6.

I did not set NO_DEBUG_LOG, this could have somthing to do with it.

I will test perfomance on many connections tomorrow.

Regards Bjørnar

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Arno Garrels
 Sent: 23. februar 2007 18:45
 To: ICS support mailing
 Subject: Re: [twsocket] Performance on the latest ICS V6
 
 Same test in the LAN, same result. Sometimes V6 was a little bit 
 faster, sometimes V5. Overall it looks like V6 was a little bit faster 
 though. But that's just my personal feeling
 ;-) I used the original Webserv demos from ICS distributions.
 
 ---
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 
 
 
 Arno Garrels wrote:
  Bjørnar Nielsen wrote:
  I'm using the latest ICS V6 and testing the THttpSrv-component.
  
  I'm doing the test on an old machine to see performance. It seems 
  that the
  V6 is slower than V5. By that I mean that I get a faster transfer- 
  rate from the server to a client (the same client on both
 test) with
  the V5 than with the V6.
  
  I compared both versions on a modern PC downloading a 150
 MB file with
  the same IE, client as well as servers on localhost.
  I couldn't measure any difference, how do you test?
  
  ---
  Arno Garrels [TeamICS]
  http://www.overbyte.be/eng/overbyte/teamics.html
 --
 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
 

-- 
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] Performance on the latest ICS V6

2007-02-23 Thread Bjørnar Nielsen

I'm using the latest ICS V6 and testing the THttpSrv-component.

I'm doing the test on an old machine to see performance. It seems that the
V6 is slower than V5. By that I mean that I get a faster transfer-rate from
the server to a client (the same client on both test) with the V5 than with
the V6.

Is this expected? Or is there something I must do to enhance perfomance in
V6? I use the setting for no advanced multithreading in both cases.

Regards Bjørnar

-- 
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] Possible bug and solution in TWndControl

2007-02-06 Thread Bjørnar Nielsen

What about using RegisterWindowMessage to let windows give you a value for
the windows-message not beeing in use? Usually this procedure is used when
sending windows messages between applications. But I don't see a reason for
not using this inside the application also. If we give the windows message a
name that is safe to assume that no other application would use, then we
would have a message that no other applications/librarys use. 

For those not familiar with this procedure, this is how it works:
const int MY_CUSTOM_MESSAGE = RegisterWindowMessage(MY_CUSTOM_MESSAGE);

The first time this is called after a reboot, windows will reserve a value
for the message-name and return it. The next time the procedure is called
with the same string, it will return the same value as earlier.

Regards Bjørnar

 I still recommend to find the sender of that anonymous 
 message as well as find a reliable range of message numbers 
 that can be used by ICS V6 exclusively. Who knows whether 
 there is still a strange third party message being processed 
 that you do not note because it simply doesn't raise the test 
 exception but triggers a ICS event? In other words I always 
 would try to find the root of the problem.

-- 
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] Freeze when using smtp after recreating itsparentform

2006-12-21 Thread Bjørnar Nielsen

I'm not sure, but I think the body of the email is automaticly encoded to
quoted printable (the plain text part), I think others in this list knows
better than me, long time ago I coded with the mail-components. If you use
html-mail, then you can encode all chars like this (C++, allthough I have
not tested this encoding on the body of the mail, only the header. Remember
that you need to set the content-type according to the encoding of the body
of the mail):
String Misc::MiscEncodeQuotedPrintable(WideString text)
{
   wchar_t tmp;
   for (int i = 1; i = text.Length(); i++)
   {
tmp = text[i];
  if (tmp  126||tmp==95||tmp==61||tmp==63)
  {
 text.Delete(i,1);
 WideString qpID = = + AnsiString::IntToHex(tmp,2).UpperCase() ;
 text.Insert(qpID, i);
 i += qpID.Length() - 1;
  }
   }
   String returnString=text;
   return returnString;
}

It might be that you need to change all spaces to underscore between the
for-loop and returning the text, at least if the text is in the subject you
must do that.

If you use this form in the subject, the use the following form
String Subject = =?iso-8859-1?Q? +
Misc::MiscEncodeQuotedPrintable(OP_UTF8Decode(source)) + ?=;

To change the html-part of the mail, you can use this:
String Misc::WideStringToHTMLEncoding(WideString html)
{
   wchar_t tmp;
   for (int i = 1; i = html.Length(); i++)
   {
tmp = html[i];
  if (tmp  126)
  {
 html.Delete(i,1);
 WideString htmlID = # + String(tmp) + ;;
 html.Insert(htmlID, i);
 i += htmlID.Length() - 1;
  }
   }
   String ret = html;
  return ret;
}

This form can hold any possible char in html.

Regards Bjørnar

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Henrik
 Sent: 21. desember 2006 15:55
 To: 'ICS support mailing'
 Subject: Re: [twsocket] Freeze when using smtp after 
 recreating itsparentform
 
 Hi Bjørnar!
 
 I've not been experiencing any problem with character 
 replacement (å-e,
 ä-d and ö-v) with ICS components, only Indy 9 and only when passing
 through ms exchange it seems, but I tried Your suggestion and 
 it works like a charm with Indy 9! 
 (Do You mean that You use that approach also with ICS smtp 
 components?)
 
 Quoted printable sounds interesting as well because one of 
 our customers report character replacing problems also with 
 the body when sending (Indy) automated emails to a customer 
 of theirs in Norway... Apparently all Swedish characters å, ä 
 and ö are substituted with ?.
 Perhaps it is possible to use Quoted printable on the whole 
 body? If You want you can send me the code to my private address. 
 
 I must say I really like the help I've received in this forum 
 and I would really like to be able to switch to ICS. It is 
 sad that we couldn't solve the dll loading error that appears 
 on some machines...
 
 Thank You very much!
 Best Regards
 Henrik
 
 
 
 -Ursprungligt meddelande-
 Från: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] För Bjørnar Nielsen
 Skickat: den 19 december 2006 17:39
 Till: 'ICS support mailing'
 Ämne: Re: [twsocket] Freeze when using smtp after recreating 
 itsparentform
 
 I use the same component and send norwegian, swedish and even 
 chinese chars in the subject (but Outlook can't show chinese 
 in the subject on my computer).
 
 Use Quoted printable or Base64 to encode special chars. 
 Example for Base64 could be like this (C++):
 
 HtmlSmtpCli1-HdrSubject = =?utf-8?B? +
 Base64Encode(UTF8Encode(SubjectInputFromUserEdit-Text)) + ?=;
 
 If you have a GUI-component that can handle WideStrings, then 
 you can have any language in the subject using the above 
 form. First the unicode-string is UTF8-encoded, then it is 
 Base64-encoded and I think this form can hold any possible char.
 
 If you use Quoted printable instead you would save a little 
 space because only the char's above 126 or so is encoded, I 
 have code for this too if you ar interested.
 
 Regards Bjørnar
 
  imagine) so I'm planning to return to Indy as long as I can solve 
  their issue with Swedish characters in the subject.
 
 --
 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
 --
 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
 

-- 
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] Freeze when using smtp after recreating itsparentform

2006-12-19 Thread Bjørnar Nielsen
I use the same component and send norwegian, swedish and even chinese chars
in the subject (but Outlook can't show chinese in the subject on my
computer).

Use Quoted printable or Base64 to encode special chars. Example for Base64
could be like this (C++):

HtmlSmtpCli1-HdrSubject = =?utf-8?B? +
Base64Encode(UTF8Encode(SubjectInputFromUserEdit-Text)) + ?=;

If you have a GUI-component that can handle WideStrings, then you can have
any language in the subject using the above form. First the unicode-string
is UTF8-encoded, then it is Base64-encoded and I think this form can hold
any possible char.

If you use Quoted printable instead you would save a little space because
only the char's above 126 or so is encoded, I have code for this too if you
ar interested.

Regards Bjørnar

 imagine) so I'm planning to return to Indy as long as I can 
 solve their issue with Swedish characters in the subject. 

-- 
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] Freeze when using smtp after recreating itsparentform

2006-12-13 Thread Bjørnar Nielsen

I have not paid very much attention to this duscussion, but I want to say
something about using ICS on many diffent computers and different platforms.
My company have made software based on ICS that run on W95, W98, NT, W2000,
WXP and Vista. The components used is HttpCli, SMTPCli, HtmlSMTPCli,
POP3Cli, HttpServer, SocketServer and WSocket (including the SSL-versions of
the components). I have no problems on any platforms. The only time I have
had problems, have been other components that needs for example Mime32.dll
or other dll's that come from installing programs that is not standard in
the platform. Or maybe to old winsock.

Some times I have had trouble when freeing a component from inside an
eventhandler for the component, or freeing a form that contains a component
that is still working, but that is bad programming, even if it made problems
only on some of the platforms.

Regards Bjørnar

  am not willing to accept that it isn't possible to use ICS 
 components 
  on all computers.
 
 I won't accept that too, but nobody from this list has 
 confirmed the problem and nobody seems to know how to solve 
 it. So it would help a lot if you could find the error condition. 
 

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

2006-12-01 Thread Bjørnar Nielsen
Thank you, I found a zip-archive there that seems the right one, I will have
a look at it. 

Regards Bjørnar

 remember I uploaded my HTTPMTServer pascal code to 
 http://www.fastream.com/ics sometime ago.. 
 Basically what it does is to move the creation of TWSocket 
 instance to the worker thread and use both thread and 
 TWSocket pooling.

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

2006-11-30 Thread Bjørnar Nielsen
If I want to have a http-server with support for very many connections and
high performance. My understanding is that this can be achieved by spreading
the connections to several threads. For example 200 connections in one
thread, 200 more in the next ect.
 
How can this be done?
One thread where where the http-server-component is, acepting connections.
Then in OnClientConnect use detach on this thread, and atach the connection
in another thread?
 
I want to stay away from critical sections and use message-posting for
communication between threads.
 
If I transfer a connection to another thread, must the connection be taken
over by another http-server-component in that thread? 
 
Anyone have some thoughts on this? Or maybe examples?
 
Regards Bjørnar
-- 
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] Using Imap

2006-11-21 Thread Bjørnar Nielsen
I can't see a component for Imap in the ICS-package.
 
I have never used IMAP and don't know much about this protocol, but now have
a customer that needs support for this. Does anyone in this list have any
tip for IMAP-components that works well with ICS?
 
Regards Bjørnar
-- 
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] Why is this list so slow?

2006-11-09 Thread Bjørnar Nielsen
Test (I send this message 9th november 10:00, +0100).

Regards Bjørnar

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Arno Garrels
 Sent: 9. november 2006 09:06
 To: ICS support mailing; [EMAIL PROTECTED]
 Subject: Re: [twsocket] Why is this list so slow?
 
 DZ-Jay wrote:
  On Nov 4, 2006, at 03:24, Francois PIETTE wrote:
  The time frame to complete will be a few days.
  
  Sounds very reasonable.
 
 Only it becomes slower and slower, the last message I got 
 (David Lewis, subject Testing (NM)) took one day. The message 
 from Johnnie Norsworthy, subject EBay API SOAP Calls (SSL) 
 was sent on
 7 Nov 2006 15:00:56 -0800 received here 09 Nov 2006 07:42:57 -.
 
 ---
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
  
 
 --
 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
 

-- 
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] TCustomWSocket.ASyncReceive infinite loop

2006-10-06 Thread Bjørnar Nielsen
I think this might happen when you don't call receive to get all the data
from the component in OnDataAvailable.

Regards Bjørnar 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Gerhard Rattinger
 Sent: 6. oktober 2006 14:01
 To: ICS support mailing
 Subject: [twsocket] TCustomWSocket.ASyncReceive infinite loop
 
 Hello we have in some applications, where we use TWSockte 
 sometimes the problem, that TWSocket hangs in an infinite loop in
 
 TCustomWSocket.ASyncReceive
 
 and therefore never handles the OnDataAvailable event.
 
 Any ideas to solve this problem are welcome.
 
 Unfortunatelly it is not reproduceable, so that we currently 
 can't post a short example.
 
 
 -- 
 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
 

-- 
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] HTTP/1.1 pipelining--any need?

2006-07-31 Thread Bjørnar Nielsen

The ICSHTTP-server already have support for pipelining as long as you are
only serving static files. But if processing a request requires
dataprocessing in another thread, the responses might be answered in the
wrong order. I put responses and requests in a list and make sure the
reponse to be sent is the correct one, if not - wait for the correct one
being finished and then send all responses ready for sending. I know Apache
support pipelining, at least if you are only getting static files, but I
have not yet seen browsers that use pipelining.

Regards Bjørnar

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Francois PIETTE
 Sent: 30. juli 2006 10:03
 To: ICS support mailing
 Subject: Re: [twsocket] HTTP/1.1 pipelining--any need?
 
  As Piotr explained, there is no need for threads--it could 
 all be async! 
  In
  the THttpConnectıonö we need a dynamıc array of requests 
 and when they 
  are storedö we answer them one by one.
 
 This is good for static pages located on the same device.
 Using multithreaded pipeline will drasticaly reduce overall 
 execution time when talking about dynamic pages which - for 
 example - involves querying a database or similar blocking 
 resources (anything which is I/O bound will benefit). Let's 
 take a simple example: Assumin a client sending two pipelined 
 requests for dynamic page. Building a dynamic page require 
 accessing a database located on a dedicated server, accessing 
 a few static files and some processing to build the actual 
 page. In a single threaded piplined operation, everything is 
 done sequenced. In a multithreaded pipeline operation, while 
 a multithreaded approach will have processing for one request 
 while the other is waiting for is database or file access. 
 Overall time is shorter, there is a better CPU usage. Without 
 mention the time shortening if the server is a multiprocessor.
 
 Conclusion: as always, multithreading is not mandatory but 
 _may_ help optimize overall performance. If badly used, it 
 may also very well lower performance. And in any case it 
 _will_ lower performance for a single request.
 
 --
 Contribute to the SSL Effort. Visit 
 http://www.overbyte.be/eng/ssl.html
 --
 [EMAIL PROTECTED]
 http://www.overbyte.be
 
 
 
 -- 
 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
 


-- 
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] Using the ftp-client

2006-05-09 Thread Bjørnar Nielsen
I tried the FTP-client of ICS for the first time today.
 
I want to conect and upload a file and quit, and found the
Transfer-prcedure. All seems fine, I get logged in and the password is
correct, but I get the following error-message when sending the file:
 500 'STOR' not understood
 
Is this a known problem?
 
I'm not wery familiar with ftp. I tried using WinSCP to upload files, and
that worked (not sure if this program uses the ftp-protocol though).
 
Regards Bjørnar
-- 
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] Making a MT HTTP Server -- NEED HELP!

2006-03-24 Thread Bjørnar Nielsen
Unresolved external usually means that you are using a unit that you have
the header-file for, but do not have the lib-file or object-file, or not
including them in you project when linking.

Regards Bjørnar 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Fastream 
 Technologies
 Sent: 23. mars 2006 14:06
 To: ICS support mailing
 Subject: Re: [twsocket] Making a MT HTTP Server -- NEED HELP!
 
 Hello,
 
 No the problem is as Dan pointed out in the C++ linker. It 
 compiles the Delphi part well as wellas the C++ part but 
 gives the below linker errors.
 
 Regards,
 
 SZ
 
 - Original Message -
 From: Wilfried Mestdagh [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Thursday, March 23, 2006 2:51 PM
 Subject: Re: [twsocket] Making a MT HTTP Server -- NEED HELP!
 
 
  Hello,
 
  I am not much familier with Delphi linker and the below 
 errors persist.
 
  Included them in a new project in delphi7, made a few changes and it
  compile fine here. Changes I did was because I dont think I have the
  latest v5 version, so I changed some in the uses clauses
 
  WSocket to OverbyteICSWSocket
  WSocketS to OverbyteICSWSocketS
  HttpSrv to OverbyteICSHttpSrv
 
  And there are a few things called with reference to the 
 HttpSrv unit, so
  also changes this few names.
 
  I am not in a good mood today and wish someone cared...
 
  Oh whell, a good coffee with some brandy in it can do a miracle :)
 
  ---
  Rgds, Wilfried [TeamICS]
  http://www.overbyte.be/eng/overbyte/teamics.html
  http://www.mestdagh.biz
 
  Thursday, March 23, 2006, 12:01, Fastream Technologies wrote:
 
  Hello,
 
  I am not much familier with Delphi linker and the below 
 errors persist.
  PLEASE DO NOTICE THAT THE CODE LINK I GAVE IS PASCAL AND 
 YOU TOO CAN 
  HELP.
 
  I am not in a good mood today and wish someone cared...
 
  Regards,
 
  SZ
 
  - Original Message - 
  From: Fastream Technologies [EMAIL PROTECTED]
  To: ICS support mailing twsocket@elists.org
  Sent: Thursday, March 23, 2006 11:05 AM
  Subject: [twsocket] Making a MT HTTP Server -- problem
 
 
  Hello,
 
  I have coded the following: 
 http://www.fastream.com/ics/icsmthttp.zip
 
  and get the following errors:
 
  Build
   [Linker Error] Unresolved external '__fastcall
  
 Httpmtsrv::THttpMTServer::TriggerCreateClient(Wsocketmts::TWSo
 cketMTClient
  *)' referenced from C:\FASTREAM\CURRENT PROJECTS\NETFILE SERVER
  ENGINE\COMMON UNITS\PROTEIN  
 NFSERVER\HTTPSERVERDERIVATIONUNIT.OBJ
   [Linker Error] Unresolved external '__fastcall
  Httpmtsrv::THttpMTServer::TriggerGetDocument(System::TObject *,
  Httpsrv::THttpGetFlag)' referenced from C:\FASTREAM\CURRENT
  PROJECTS\NETFILE SERVER ENGINE\COMMON UNITS\PROTEIN 
  NFSERVER\HTTPSERVERDERIVATIONUNIT.OBJ
   [Linker Error] Unresolved external '__fastcall
  Httpmtsrv::THttpMTServer::TriggerHeadDocument(System::TObject *,
  Httpsrv::THttpGetFlag)' referenced from C:\FASTREAM\CURRENT
  PROJECTS\NETFILE SERVER ENGINE\COMMON UNITS\PROTEIN 
  NFSERVER\HTTPSERVERDERIVATIONUNIT.OBJ
   [Linker Error] Unresolved external '__fastcall
  Httpmtsrv::THttpMTServer::TriggerPostDocument(System::TObject *,
  Httpsrv::THttpGetFlag)' referenced from C:\FASTREAM\CURRENT
  PROJECTS\NETFILE SERVER ENGINE\COMMON UNITS\PROTEIN 
  NFSERVER\HTTPSERVERDERIVATIONUNIT.OBJ
   [Linker Error] Unresolved external '__fastcall
  Httpmtsrv::THttpMTServer::TriggerFilterDirEntry(System::TObject *,
  System::TObject *, Httpsrv::THttpDirEntry *)' referenced from
  C:\FASTREAM\CURRENT PROJECTS\NETFILE SERVER ENGINE\COMMON 
 UNITS\PROTEIN 
  
  NFSERVER\HTTPSERVERDERIVATIONUNIT.OBJ
   [Linker Error] Unresolved external 
 'Httpmtsrv::THttpMTConnection::'
  referenced from C:\FASTREAM\CURRENT PROJECTS\NETFILE SERVER
  ENGINE\CGI-ISAPI\WEBCONNECTION.OBJ
   [Linker Error] Unresolved external '__fastcall
  Httpmtsrv::THttpMTConnection::~THttpMTConnection()' 
 referenced from
  C:\FASTREAM\CURRENT PROJECTS\NETFILE SERVER
  ENGINE\CGI-ISAPI\WEBCONNECTION.OBJ
   [Linker Error] Unresolved external '__fastcall
  
 Httpmtsrv::THttpMTConnection::THttpMTConnection(Classes::TComp
 onent *)'
  referenced from C:\FASTREAM\CURRENT PROJECTS\NETFILE SERVER
  ENGINE\CGI-ISAPI\WEBCONNECTION.OBJ
   [Linker Error] Unresolved external '__fastcall
  
 Httpmtsrv::THttpMTConnection::WndProc(Messages::TMessage)' referenced
  from
  C:\FASTREAM\CURRENT PROJECTS\NETFILE SERVER
  ENGINE\CGI-ISAPI\WEBCONNECTION.OBJ
   [Linker Error] Unresolved external '__fastcall
  Httpmtsrv::THttpMTConnection::AuthCheckAuthenticated()' 
 referenced from
  C:\FASTREAM\CURRENT PROJECTS\NETFILE SERVER
  ENGINE\CGI-ISAPI\WEBCONNECTION.OBJ
   [Linker Error] Unresolved external '__fastcall
  
 Httpmtsrv::THttpMTConnection::ConnectionDataAvailable(System::
 TObject *,
  unsigned short)' referenced from C:\FASTREAM\CURRENT 
 PROJECTS\NETFILE
  SERVER
  ENGINE\CGI-ISAPI\WEBCONNECTION.OBJ
   [Linker Error] Unresolved external '__fastcall
  
 

Re: [twsocket] Compiling latest ICS-beta

2006-03-10 Thread Bjørnar Nielsen
The problemt with the constants that were defined in both Winsock.pas and
WSoscket.pas went away after commenting them out in WSocket.pas. I think
Francois agreed on removing them from WSocket.pas.

The other fault with parameter mismatch with Active and Coding in
HttpContCod.hpp I have no sollution for. I just commented them out in the
pas-file since I for now don't need content encoding. I also would like a
fix for this to be able to use these properties.

Regards Bjørnar

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Merijn Terheggen
 Sent: 10. mars 2006 13:54
 To: ICS support mailing
 Subject: Re: [twsocket] Compiling latest ICS-beta
 
 I also get the same parameter mismatch errors in BCB6 that 
 Bjørnar mentioned in his mail.
 
 Any ideas?
 Bjørnar: are these errors gone in your set-up now? What did you do?
 
 I used the 20060309 beta and the forementioned constants are 
 commented-out (I checked it).
 
 On 1/27/06, Bjørnar Nielsen [EMAIL PROTECTED] wrote:
 
  I downloaded and installed latest beta and I found these problems 
  (using BCB6).
 
  The package compiled fine but I get errors when using ICS in a 
  testproject in WSocket.hpp on these:
 
  IOCPARM_MASK
  IOC_VOID
  IOC_OUT
  IOC_IN
  IOC_INOUT
 
  They are defined in both Winsock.pas and WSoscket.pas. When 
 I removed 
  them from WSocket.pas the errors was gone.
 
  I also get error in HttpContCod.hpp on
 
  __property bool Active = {read=GetActive, nodefault}; (line 85) 
  __property AnsiString Coding = {read=GetCoding}; (line 86)
 
  The error is parameter mismatch.
 
  Regards Bjørnar
 
 
 
  --
  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
 
 --
 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
 


-- 
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] Running on W95

2006-02-28 Thread Bjørnar Nielsen

 version of winsock.dll located in your %windir%. If it is 
 4.00.950, you've got Winsock 1, Winsock 2 is 4.10.1656 (at 
 least at my Win95 installation).

My winsock.dll is version 4.00.. If what you say is correct, then my
version seems to be even older than 1.1. Upgrading winsock, is it just to
switch the dll or must I use a service-pack or similar upgrading the get the
newer version?

I have MSDN-membership, I will check if I can find upgrading-tools on the
Microsoft MSDN-pages.

Regards Bjørnar


-- 
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] Running on W95

2006-02-28 Thread Bjørnar Nielsen

  version of winsock.dll located in your %windir%. If it is 4.00.950, 
  you've got Winsock 1, Winsock 2 is 4.10.1656 (at least at my Win95 
  installation).
 
 My winsock.dll is version 4.00.. If what you say is 
 correct, then my version seems to be even older than 1.1. 
 Upgrading winsock, is it just to switch the dll or must I use 
 a service-pack or similar upgrading the get the newer version?

Found update for sr1 and winsock 2 for W95 on the microsoft-pages. First hit
after searching for winsock on the download-page. After upgrading, ICS works
again.

For my part I think it's ok that it works if the updates are aplied.

Regards Bjørnar


-- 
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] Running on W95

2006-02-28 Thread Bjørnar Nielsen
Ok, but it works now after upgrade and I'm happy. But others might have
users that use W95 and outdated winsock-versions. If they switch from a
prior ICS-installation to the latest beta, the application might not work if
not updating the winsock-version also.

Regards Bjørnar


  My winsock.dll is version 4.00.. If what you say is 
 correct, then 
  my version seems to be even older than 1.1.
 
 No, 4.00.950 (4.00.0950, not 4.00.9500) is Winsock 1.0, 
 4.00. may be Winsock 1.1. 


-- 
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] Running on W95

2006-02-27 Thread Bjørnar Nielsen
I have trouble with running an exe that uses the the THttpCli component on a
W95. It works on W98 and later. And it works also on earlier versions of
ICS, but not the latest beta.
 
I get this error-message in ReasonPhrase in OnRequestDone:
Can't connect: No error (Error #0)
 
Anyone has any tips?
 
Regards Bjørnar
-- 
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] Running on W95

2006-02-27 Thread Bjørnar Nielsen
How do I find the winsock version-number?

I will check if I have all service-packs on the w95-installation.

Is there a change in wich winsock-version ICS supports or is this a bug?

Regards Bjørnar

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Fastream 
 Technologies
 Sent: 27. februar 2006 14:01
 To: ICS support mailing
 Subject: Re: [twsocket] Running on W95
 
 Which version of winsock does w95 have? I have a strong 
 feeling that upgrading to ws2 would help.
 
 Regards,
 
 SZ
 
 - Original Message -
 From: Bjørnar Nielsen [EMAIL PROTECTED]
 To: 'ICS support mailing' twsocket@elists.org
 Sent: Monday, February 27, 2006 2:57 PM
 Subject: [twsocket] Running on W95
 
 
 I have trouble with running an exe that uses the the THttpCli 
 component on a
 W95. It works on W98 and later. And it works also on earlier 
 versions of
 ICS, but not the latest beta.
 
 I get this error-message in ReasonPhrase in OnRequestDone:
 Can't connect: No error (Error #0)
 
 Anyone has any tips?
 
 Regards Bjørnar
 -- 
 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 
 
 -- 
 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

-- 
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] Running on W95

2006-02-27 Thread Bjørnar Nielsen
No, the other beta from the same date.

Regards Bjørnar 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Fastream 
 Technologies
 Sent: 27. februar 2006 14:37
 To: ICS support mailing
 Subject: Re: [twsocket] Running on W95
 
 Hello Bjørnar,
 
 When you say latest beta, do you mean v6?
 
 Regards,
 
 SZ
 
 - Original Message -
 From: Bjørnar Nielsen [EMAIL PROTECTED]
 To: 'ICS support mailing' twsocket@elists.org
 Sent: Monday, February 27, 2006 3:32 PM
 Subject: Re: [twsocket] Running on W95
 
 
 
 
   Anyone has any tips?
 
  I suspect a security product which prevent connection.
 
 There is no antivirus or similar on the system. I tried compiling a
 testproject with the latest beta and the same project on an earlier
 ICS-distribution. I get this error only on latest beta, so 
 there must be
 something with ICS that causes this.
 
 Regards Bjørnar
 
 -- 
 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 
 
 -- 
 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

-- 
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] Running on W95

2006-02-27 Thread Bjørnar Nielsen
The numbers give me
1.1
on both my XP and W95.

Hov do I control which winsock-version is installed?

Regards Bjørnar 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Francois Piette
 Sent: 27. februar 2006 15:00
 To: ICS support mailing
 Subject: Re: [twsocket] Running on W95
 
   I suspect a security product which prevent connection.
 
  There is no antivirus or similar on the system. I tried compiling a 
  testproject with the latest beta and the same project on an earlier 
  ICS-distribution. I get this error only on latest beta, so 
 there must 
  be something with ICS that causes this.
 
 Check TWSocket.ReqVerLow and ReqVerHigh which define the 
 winsock version to be loaded. Normally default to 1.1. Maybe 
 it is forced to 2.2 ?
 --
 [EMAIL PROTECTED]
 http://www.overbyte.be
 
 --
 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
 


-- 
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] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Bjørnar Nielsen
I have a similar design, but I also have a pointer to the thread in the
THttpConnection so that the connection can set a flag on the thread if the
connection is dropped before the thread has finished the work and risk using
a freed connection.

This design could serve several connections/threads at the same time.

Regards Bjørnar 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Guillaume MAISON
 Sent: 9. februar 2006 10:59
 To: ICS support mailing
 Subject: [twsocket] [QUESTION] ThttpServer and threading design
 
 Hi everyone,
 
 i've an application to write, a client and a server.
 i've choosen to use the HTTP protocol to enable communication 
 through them.
 Hence, i'll use the THttpServer as my server front-end.
 
 my question is the following :
 some requests may use some database stuff (SQLite). It 
 shouldn't be the case, but, in case the SQL stuff may need 
 long duration (long10 secs) i prefer to use threads to get 
 DB data, as there may be several clients connecting at the same time.
 
 Am i right to implement such requests as this :
 Form.OnGetDocument :
   Create a Thread with the HttpConnection attached and 
 FreeOnTerminate:=True;
   Assign a OnThreadTerminate
   Run the thread
   Set Flags to hgWillSendMySelf
 
 Form.OnThreadTerminate
   AttachedHttpConnection.AnswerString/AnswerStream/AnswerWhatever
 
 Does this design seem good ?
 i mean will i be able to serve several connections at the 
 same time (independantly of DB concurrential access that i'll 
 manage within thread context) ?
 
 Thanks in advance for your help !
 
 Regards,
 
 
 -- 
 
 Guillaume MAISON - [EMAIL PROTECTED]
 83, Cours Victor Hugo
 47000 AGEN
 Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50 e-mail : 
 [EMAIL PROTECTED] - Web : http://nauteus.com
 
 --
 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

-- 
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] SMTPcli and multipart/mixed

2006-02-08 Thread Bjørnar Nielsen

There is a THtmlSmtpCli. In this one you set both the plain-text-part and
the html-part in separate properties.

Set Contenttype to smtpHtml and set the text for PlainText and HtmlText.
This will set up the boundrys for you when sending the mail.

Regards Bjørnar

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Rod Kinnison
 Sent: 8. februar 2006 01:26
 To: twsocket@elists.org
 Subject: [twsocket] SMTPcli and multipart/mixed
 
 Hello, i'm sure this question has been answered before but I 
 searched the faq and old elists archives to no avail.
 
 I'm trying to create multipart/mixed (http and plain text) 
 e-mails with smtpcli.  My questions are:
 1. what should smtpcli.ContentType be set to?
 2. do I create the boundary manually and add it to the headers?
 3. do I place the boundaries in the e-mail body manually?
 
 Thanks for your help.
 --
 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

-- 
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] www.overbyte.be

2006-01-31 Thread Bjørnar Nielsen
Down again?
 
Regards Bjørnar
-- 
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] www.overbyte.be

2006-01-31 Thread Bjørnar Nielsen

  Down again?
 
 Works from here.
 Note that the provider is moving, so there may be some 
 interruption while they setup things, and probably when they 
 change their IPs (DNS propagation).

I understand. Now it works from here.

Regards Bjørnar

-- 
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] Compiling latest ICS-beta

2006-01-27 Thread Bjørnar Nielsen
I downloaded and installed latest beta and I found these problems (using
BCB6).

The package compiled fine but I get errors when using ICS in a testproject
in WSocket.hpp on these:

IOCPARM_MASK
IOC_VOID
IOC_OUT
IOC_IN
IOC_INOUT

They are defined in both Winsock.pas and WSoscket.pas. When I removed them
from WSocket.pas the errors was gone.

I also get error in HttpContCod.hpp on

__property bool Active = {read=GetActive, nodefault}; (line 85)
__property AnsiString Coding = {read=GetCoding}; (line 86)

The error is parameter mismatch.

Regards Bjørnar



-- 
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] Problem with the lists

2006-01-27 Thread Bjørnar Nielsen
I got the message, but have trouble sending to the ICS-SSL-list. My mail is
rejected by postmaster.

Regards Bjørnar

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Francois PIETTE
 Sent: 27. januar 2006 10:27
 To: twsocket@elists.org
 Subject: [twsocket] Problem with the lists
 
 Seems the list is down !
 36 hours without message is not normal.
 Do you see my message ?
 --
 [EMAIL PROTECTED]
 http://www.overbyte.be
 
 --
 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
 


-- 
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] Compiling latest ICS-beta

2006-01-27 Thread Bjørnar Nielsen

 You have not the latest version ! I added those constant 
 because I needed them for keep alive processing I added a few 
 days ago (remember my message ?). Maybe I added too much 
 constants, duplication from winsock ? Anyway, it shouldn't hurt.

It seems to be a problem with BCB, I could not use ICS in a project with the
duplicated constants. When I removed the duplicated constants the
compile-error went away.

Regards Bjørnar

-- 
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] Compiling latest ICS-beta

2006-01-27 Thread Bjørnar Nielsen
 Which one exactly did you remove ?

I commented these consts from WSocket.pas

IOCPARM_MASK
IOC_VOID
IOC_OUT
IOC_IN
IOC_INOUT

Regards Bjørnar

-- 
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] Bug in SmtpProt.pas

2005-10-26 Thread Bjørnar Nielsen

 Outlook *does* indeed break long subject lines.  Here's an 
 example of a message I just sent using Outlook 2000:

It does not when I test (Outlook 2003 SP1, but also with Norton Antivirus,
dont know if this affects this). Other lines are split but not the subject.

  Anyway, TCustomSmtpClient.DataNext would fail even when using 
  continuation lines every 74 char if the total length is 
 longer than 1024.
 
 Again, this is a limit imposed by the protocol itself, so the 
 application should guard against it.
 
 That said, I agree that the component could avoid potential 
 buffer overflows if it included the check, just as long as it 
 does not impact performance and functionality adversely.

Anyway, the RFC 821 says that the maximum line length including CRLF is
1000 chars. If I use a subject that is longer, and break the line at 74 with
CRLF and tab, the header-subject would be RFC-compliant, but the
smtp-component would crash.

Regards Bjørnar


-- 
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] Bug in SmtpProt.pas

2005-10-26 Thread Bjørnar Nielsen
 Anyway, the RFC 821 says that the maximum line length 
 including CRLF is 1000 chars. If I use a subject that is 
 longer, and break the line at 74 with CRLF and tab, the 
 header-subject would be RFC-compliant, but the smtp-component 
 would crash.

I guess I could use OnProcessHeader and split the lines into more lines if
to long. But I think StrPCopy should be changed to StrPLCopy, I think this
would not decrease performance, just stop the component from crashing if a
line is to long.

Regards Bjørnar


-- 
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] Bug in SmtpProt.pas

2005-10-26 Thread Bjørnar Nielsen

 
 That's what I was alluding at; I was assuming he meant that 
 the message would arrive intact with the entire subject line 
 without breaks or truncation.

It does, but I can't write more than 256 chars in the subject-line. The
subject is kept as a single line, no splits. The subject is sent this way
and I receive it back from the mailserver the same way.

Regards Bjørnar


-- 
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] Bug in SmtpProt.pas

2005-10-26 Thread Bjørnar Nielsen
 
 That's an old bug in OE, you should not copy M$ bugs but wrap 
 the subject line. BTW: I think having ~1000 chars for the 
 subject line is far enough, or do you know a client that 
 would display such long subjects properly?

I just testet Outlook, and it seems difficult to show the mail correct if
the subject is very long and the lines are split. In my test it seems the
best is to not to split the line and keep the subject not to long.

Regards Bjørnar


-- 
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] Bug in SmtpProt.pas

2005-10-25 Thread Bjørnar Nielsen
 
When using mail-client from ICS, and set the subject property with a string
length very long, my exe crashes and goes down and I found the reason here:
 
procedure TCustomSmtpClient.DataNext;
var
MsgLine  : array [0..1023] of char;
begin
{ If we have been disconnected, then do nothing.  }
{ RequestDone event handler is called from socket SessionClose event. }
if not FConnected then begin
FWSocket.OnDataSent := nil;
Exit;
end;
 
Inc(FItemCount);
if FItemCount  FHdrLines.Count then begin
{ There are still header lines to send }
--StrPCopy(@MsgLine, FHdrLines.Strings[FItemCount]);  -- here
 
There is no check for length of the line in FHdrLines before copying the
line. If the line length is longer than 1024, the copying will fail and
crash the exe.
 
I'm not sure how to fix this the best way. The easiest I guess is to use
StrPLCopy and ensure not copying more than we have room for. But is it
nessecary to copy the content before putting in the send-buffer? Would it
not be more effecient and easy to just put the underlying text in the
stringlist from the right index directly in the send-buffer? In C++ I would
do something like this:
FWSocket-PutDataInSendBuffer(FHdrLines.Strings[FItemCount].c_str(),
FHdrLines.Strings[FItemCount]..Length());
 
Regards Bjørnar
-- 
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] Bug in SmtpProt.pas

2005-10-25 Thread Bjørnar Nielsen

 The SMTP protocol doesn't allow longer lines in any case, so 
 your application could check for a correct length. Also it 
 important to wrap lines that are longer than 74 cups. Means 
 either a blank or tab in front of a continuation line.

I still think there should be check on linelength before copying, it's ok to
not send all data if breaking rfc but not take down the whole application.

Should also subject be split into continuation-lines if longer than 74 cups
(cups=chars?)? Outlook does not seem to do this with the subject.

If I understand this correct. If I have a subject of 2000 chars, I can send
this if I insert crlf and tab at every 74 char and don't break any rfc?
Anyway, TCustomSmtpClient.DataNext would fail even when using continuation
lines every 74 char if the total length is longer than 1024.

What do you think about this?

Regards Bjørnar


-- 
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] [TMimeDec] Beta version to test

2005-09-26 Thread Bjørnar Nielsen
 

 On which machine? (cpu, mainboard, amount of free RAM, 
 operating system...) If it's new/rather new machine, such 
 result is far below expectations - I get 20 sec on old P120 
 with 32MB RAM and Win95.

Pentium M 2,13 GHz - 533 MHz FSB, 1 GB ram, WinXP Pro, so I guess the
machine should perform good.

  Is there a way
  to make the decoding work faster? I have about the same 
 testresult on 
  the beta and the older version of MimeDec.
 
 There's many ways to make it faster. First, do not use 
 TMemoryStream as decoded attachment storage *unless* you set 
 it's size so TMemoryStream won't need to reallocate his 
 memory. Second, you should use larger input buffer (not that 
 4kbyte one), or change decoding logic so you could use 
 memory- mapped file. Third, do not use OnPartLine to store 
 data - set DestStream and leave OnPartLine unassigned (you'll 
 save one jump into and out of the handler, possibly dirtying 
 less processor's L1/L2 cache).
 Fourth, use TMemoryStream (or some kind of 
 TBufferedWriteStream) as decoded data storage (but remember 
 about the first note above). 
 
 Fifth - discard these fancy progressbars (and progressbar 
 updating code) ;)

I use TMemoryStream. I don't use any progressbars, but I use the old version
MimeDec. And I don't use MimeDec directly, I use it through MimeDecEx from
usermade page, It could be there that I  should use the improvements you
suggests.

If you think it's a bad idea to use the MimeDecEx from usermade page, could
you provide a working example of how to use the new beta of MimeDec?

Regards Bjørnar


-- 
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] [TMimeDec] Beta version to test

2005-09-23 Thread Bjørnar Nielsen
I have tested the beta and had some trouble with it, but I use the component
through MimeDecEX from usermade page. Did not do any changes before testing.

However, I have a question. Decoding attachments seems to take a long time.
Decoding a base64-encoded attachment of 10 MB takes 17 sec. Is there a way
to make the decoding work faster? I have about the same testresult on the
beta and the older version of MimeDec.

Regards Bjørnar


-- 
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] FHtmlCharSet property of THtmlSmtpCli

2005-09-02 Thread Bjørnar Nielsen
 I have seen but had not time yet to examine the problem.

Thanks.

You will understand the problem in a minute or so when examining. There is a
FHtmlCharSet wich is used for the html-part, but there is no way of setting
the value unless you derive the component. I just made a set-er an get-er
for it.

Regards Bjørnar


-- 
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] Assign event handler to manually created TStmpCli

2005-06-30 Thread Bjørnar Nielsen
I use CBuilder. I also sometimes have problems with debugging delphi sourse,
try rebuilding ICS with all debug options on, and the same with your
project, then try to inspect the variables.

Regards Bjørnar 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh
 Sent: 29. juni 2005 19:36
 To: ICS support mailing
 Subject: Re: [twsocket] Assign event handler to manually 
 created TStmpCli
 
 Hello Patrick,
 
  BTW, the mail can be sent out by ignoring the error.  
 Calling the exe 
  out of the IDE does not have error at all.
 
 This is very strange. It looks to me a CBulder IDE bug. Can 
 someone confirm this ?
 
 I have no CBuilder installed at the moment, but is there 
 someone who can step trough the code if Patrick make a simple 
 project to demonstrate the behaviour ?
 
 ---
 Rgds, Wilfried
 http://www.mestdagh.biz
 
 
 --
 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
 



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

2005-06-30 Thread Bjørnar Nielsen
It's the OS that get notified when a client wants to connecto to your
program. If the Backlog is 1, the OS wont accept any more connections before
your program have accepted the previous attempt to connect.

On a non-server-platform, this backlog is usually limited to 5 or 10. On a
server-platform, this limitation is usually 200. The backlog setting in ICS
wont do any good if higher than the OS permits.

With a high backlog value, you can have short periods of time where clients
try to connect to your program faster then your program can handle, and
still dont loose any connections.

Regards Bjørnar

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Paul
 Sent: 29. juni 2005 23:15
 To: twsocket@elists.org
 Subject: [twsocket] Listenbacklog
 
 Hi all,
 
 I have a written an application that uses the Httpsrv 
 component but I don't know the exact meaning of the property 
 'listenbacklog' which is automatically set to 5.
 
 What does it stand for and what value should I use.
 Is there a difference using it on a WinXP pro or on an 
 Windows2003 server?
 
 
 T.I.A.
 
 
 Paul
 --
 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
 



--
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] No response problem [THttpServer - TCustomLineWSocket]

2005-06-20 Thread Bjørnar Nielsen
 When users clicks links or post forms in their browsers, 
 sometimes they don't get any answer. By debugging the server 
 I realized that in such a case the OnPostDocument event is 
 never triggered.

Are you sure the request you don't get an answer from is received on the
server?

When you run a server on a non-server-platform you might miss some requests
when many requests arrive at the same time. On a non-server-platform (w2000,
XP etc) there is a listen backlog set to 5. That means that 5 connects is
queued by the os if your server is not ready to accept the connection yet.
The sixth connection will be lost. On a server-platform (w2000 server, w2003
server etc), this backlog is set to 200.

Regards
Bjørnar



--
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] No response problem [THttpServer - TCustomLineWSocket]

2005-06-20 Thread Bjørnar Nielsen

 Yes, as I explained in my last mail, when a user makes a 
 request (GET or 
 POST or HEAD or whatever), the server get it, and start to analyze it 
 but stops inside TCustomLineWSocket.TriggerDataAvailable.

Ok, I missed that part, my previos message does not explain your problem.

In PostedData-event, be sure to call PostedDataReceived on the
client-connection (linemode is set to true and FState is set to hcRequest).
This will enable the client to receive more requests on same connection (if
http1.1 and keepalive).

It would be interesting to se if the lost requests is happening on newly
created connections, or maybe only on connections that are used a second
time (many requests on same connection, http1.1 and keepalive).


Regards Bjørnar



--
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] Internet cafe software

2005-05-31 Thread Bjørnar Nielsen

Look through the demos and find a demo that uses the WSocketServer. This
component handles the connection of clients, disconnection of clients and so
on and has a list of all connected clients. And you can build your own
protocol your self. The HttpSrv component is a webserver, this is built on
top of the WSocketServer.

Derive your own class from the connection-class that the WSocketServer uses
for the clients that connects, and put in some ids etc to identify each
client with an ID to be sure to sendt to right client when you want to send
commands.

Since the component is async, you don't need any threads to avoid blocking.

Regards Bjørnar

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of George
 Sent: 31. mai 2005 00:42
 To: twsocket@elists.org
 Subject: [twsocket] Internet cafe software
 
 Hello,
 
 I want to make an internet cafe software that will use ICS to 
 communicate. Here's the specs:
 
 1. There is one server and X number of clients. We dont know 
 how much clients, this number is configured by user. So I 
 need to dynamically create sockets.
 
 2. The server will listen and the clients will connect to server.
 
 3. The clients will be always connected to server, because 
 server has to know if clients are connected/disconnected.
 
 4. The server sends commands to client in the form of a 
 simple string or maybe a stream.
 
 5. Most of the time the sockets will be idle.
 
 Can you give me some suggestions please? What example to use 
 from the demos as a base?
 
 Thanks
 George
 --
 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
 



--
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] Using THtmlSmtpCli

2005-05-25 Thread Bjørnar Nielsen

I'm going to make a mail-client for sending email, and I think about using
THtmlSmtpCli.

CharSet seems to be default to iso-8859-1. When using non-english chars in
the content of the email, and names to sender in the header, must I encode
to this iso-format my self before setting the properties, or is this done
automaticly when setting or sending the mail?

If I must encode my self which component should I use, MimeDec? Is
encoding/decoding of wide chars also possible, or must I then use utf8
instead?

If a non-html-enabled mail client receives a mail sent with html and
THtmlSmtpCli, will it show the plain text part instead of the html?

Regards Bjørnar



--
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] Little question... TList of HTTPCli

2005-05-03 Thread Bjørnar Nielsen
In C++ I would do something like this:

int index=list-Remove(Sender);

If Sender (your httpcli) is in that list, it will be removed, and it will
return the index of the position before it is removed if the Sender was in
the list.

You should see the helpfiles, many examples and usefull hints there..

Regards Bjørnar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Ann
Sent: 3. mai 2005 13:53
To: ICS support mailing
Subject: Re: [twsocket] Little question... TList of HTTPCli

yes but im not asking about sender but how do i find this sender in tlist of
components...

do i have to make something like this or is there easier way?

for i:=0 to list.item.count-1 do
 begin
  if list.item[i] = sender then this_is_the_one?
 break;
 end;

- Original Message -
From: Francois Piette [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Tuesday, May 03, 2005 11:26 AM
Subject: Re: [twsocket] Little question... TList of HTTPCli


  Just one little question...
  When i have a TList of busy HTTPCli'ents how do i
  know which one should i
  remove on OnRequestDone event?

 You have the sender argument in OnRequestDone. It's the Http component
that sent the event. You can
 cast it to THttpCli and do whatever you like.

 btw: This is basic Delphi programming. The sender argument of any event
always refers to the
 component source of the event. You always need it when the same handler is
used for many components.

 --
 [EMAIL PROTECTED]
 http://www.overbyte.be


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





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



--
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] Is there a way to download a file in threads?

2005-04-14 Thread Bjørnar Nielsen
 

 The only shortcoming of ICS is the web server which has no official and/or
optimized CGI/ISAPI
 component and by design async which is bad for a web server. 

SZ, why do you think async design is bad for a webserver?

Regards Bjørnar



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