Re: [twsocket] Reading e-mail

2012-02-02 Thread Angus Robertson - Magenta Systems Ltd
 reminder that many times and where IWEditMsgNum.Text is increased / 
 decreased with the values __of an array that contains all msgnum.
 I can only read the first message. Why? 

Since you do not answer any of the questions you are asked, and only copy
parts of your code with no explanation of what you application is
actually trying to achieve, it is difficult to actually provide any more
support.  

But setting a valid MsgNum before RetrSync or TopSync is the correct way
to use the component, and will always work with a proper POP3 server.  I
suggest you test against multiple POP3 mail servers to see if the server
itself is at fault in ignoring the message number.  There are some
non-standard POP3 servers around, mostly cloud web based systems like
Google Mail and Live Mail/Hotmail that do strange things. 

You can try my free MailMaint application against the mailbox, it uses
the latest ICS POP3 component and has a debug window that shows all the
command being sent and received, which I copied for you yesterday. 

http://www.magsys.co.uk/mailmaint/

Angus

--
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] [PATCH] THttpSrv: add support for returning partial streams

2012-02-02 Thread Tobias Rapp
Hi!

I have added a new function AnswerStreamPart in component THttpConnection
to allow answering partial retrieve requests using any tStream descendant
(see attached patch file).

It would be nice if the patch could be considered for inclusion in the
upstream ICS sources and I am open for suggestions regarding possible
improvements.

Kind regards,
Tobias
--
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] [PATCH] THttpSrv: add support for returning partial streams

2012-02-02 Thread Tobias Rapp
Index: OverbyteIcsHttpSrv.pas
===
--- OverbyteIcsHttpSrv.pas  (revision 887)
+++ OverbyteIcsHttpSrv.pas  (working copy)
@@ -807,6 +807,9 @@
  const Status   : String;
  const ContType : String;
  const Header   : String); virtual;
+procedure   AnswerStreamPart(var Flags  : THttpGetFlag;
+ const ContType : String;
+ LastModified   : TDateTime = 0); virtual;  { 
Added by TR 2012-01-30 }
 procedure   AnswerString(var   Flags: THttpGetFlag;
  const Status   : String;
  const ContType : String;
@@ -2862,6 +2865,129 @@
 
 
 {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
+{ANDREAS Byte-range-separator (use the same as IIS) }
+const
+ByteRangeSeparator = '[lka9uw3et5vxybtp87ghq23dpu7djv84nhls9p]';
+
+
+{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
+{ANDREAS Helperfunction to create the HTTP-Header }
+function CreateHttpHeader(
+Version   : String;
+ProtoNumber   : Integer;
+AnswerContentType : String;
+RangeList : THttpRangeList;
+DocSize   : THttpRangeInt;
+CompleteDocSize   : THttpRangeInt): String;
+begin
+if ProtoNumber = 200 then
+Result := Version + ' 200 OK' + #13#10 +
+  'Content-Type: ' + AnswerContentType + #13#10 +
+  'Content-Length: ' + _IntToStr(DocSize) + #13#10 +
+  'Accept-Ranges: bytes' + #13#10
+{else if ProtoNumber = 416 then
+Result := Version + ' 416 Request range not satisfiable' + #13#10}
+else if ProtoNumber = 206 then begin
+if RangeList.Count = 1 then begin
+Result := Version + ' 206 Partial Content' + #13#10 +
+  'Content-Type: ' + AnswerContentType + #13#10 +
+  'Content-Length: ' + _IntToStr(DocSize) + #13#10 +
+  'Content-Range: bytes ' +
+  
RangeList.Items[0].GetContentRangeString(CompleteDocSize) +
+  #13#10;
+end
+else begin
+Result := Version + ' 206 Partial Content' + #13#10 +
+  'Content-Type: multipart/byteranges; boundary=' +
+  ByteRangeSeparator + #13#10 +
+  'Content-Length: ' + _IntToStr(DocSize) + #13#10;
+end;
+end
+else
+raise Exception.Create('Unexpected ProtoNumber in CreateHttpHeader');
+end;
+
+
+{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
+procedure THttpConnection.AnswerStreamPart(
+var   Flags: THttpGetFlag;
+const ContType : String;   { if emtpy, default to text/html  }
+LastModified   : TDateTime = 0);
+var
+NewDocStream: TStream;
+ProtoNumber : Integer;
+CompleteDocSize : THttpRangeInt;
+SyntaxError : Boolean;
+ContEncoderHdr  : String;
+ContStatusHdr   : String;
+begin
+Flags := hgWillSendMySelf;
+ProtoNumber := 200;
+ContEncoderHdr := '';
+if ContType  '' then
+FAnswerContentType := ContType
+else
+FAnswerContentType := 'text/html';
+FLastModified := LastModified;
+
+CompleteDocSize := FDocStream.Size;
+{ANDREAS Create the virtual 'byte-range-doc-stream', if we are ask for 
ranges}
+if RequestRangeValues.Valid then begin
+{ NewDocStream will now be the owner of FDocStream - don't free 
FDocStream }
+NewDocStream := RequestRangeValues.CreateRangeStream(FDocStream,
+ FAnswerContentType, CompleteDocSize, SyntaxError);
+if Assigned(NewDocStream) then begin
+FDocStream := NewDocStream;
+FDocStream.Position := 0;
+ProtoNumber := 206;
+end
+else begin
+if SyntaxError then
+{ Ignore the content range header and send entire document in case 
}
+{ of syntactically invalid byte-range-set  
}
+FDocStream.Position := 0
+else begin
+{ Answer 416 Request range not satisfiable  }
+FDocStream.Free;
+FDocStream := nil;
+if not FKeepAlive then
+PrepareGraceFullShutDown;
+Answer416;
+Exit;
+end;
+end;
+end;
+
+FDataSent := 0;   { will be incremented after each send part of data }
+FDocSize := FDocStream.Size;
+OnDataSent := ConnectionDataSent;
+
+{ V7.21 are we allowed to compress content }
+if CheckContentEncoding(FAnswerContentType) then begin
+ContEncoderHdr := DoContentEncoding;   { V7.21 do it, returning new 
header }
+   

[twsocket] Package problems

2012-02-02 Thread Stefan Paege
Hi, 

I need to add some functionality to an old project created with Delphi 5. 
This functionality is already available as a component I wrote for D2007.
The component internally uses a TWSocket to communicate over UDP.
Now I want to backport the component to Delphi 5.

I installed ICS-V5 into D5 by loading, compiling and installing
IcsDel50.dpk. That worked fine.

In my component's source I changed the ICS-related unit names as necessary.
Like this:

uses
{$IFDEF VER130}
  WSocket,
{$ELSE}
  OverbyteIcsWndControl,
  OverbyteIcsWSocket,
{$ENDIF}

There are no references to other ICS units in my source code.

Then I created a new package, added my component and compiled. 
Got a message that I need to add IcsDel50 to the package. Hit OK.
After that I get compilation errors. Unit MD5.pas is opened in the editor. 
It has only one line:
Bomb('This file has been renamed from MD5 to IcsMD5. Update your uses
clause !');

Well, I certainly would do that. But I'm nowhere referencing that unit. And
as far as I can see the ICS-Source is clean, too. I have looked for old
IcsDel50.* files on my disk. Nada.

Can anyone share some advice?

Oh, btw: I can sucessfully compile and run a test project that creates my
component at runtime. So that might be the workaround if the package problem
cannot be solved.

Regards
  Stefan Paege




--
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] TCustomFtpCli - minor change

2012-02-02 Thread twsocket


How long does it take a 14.4k dial up to upload 4gig?


twsoc...@kglt.net wrote:
 
 FDurationMsecs and
DurationMsecs should be INT64.
 
 Do you think that any
of your transfers might ever
 take more than 24 days?


 --
 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] TCustomFtpCli - minor change

2012-02-02 Thread Darin McGee
Days
 On Feb 2, 2012 11:38 AM, twsoc...@kglt.net wrote:



 How long does it take a 14.4k dial up to upload 4gig?

 
 twsoc...@kglt.net wrote:
 
  FDurationMsecs and
 DurationMsecs should be INT64.
 
  Do you think that any
 of your transfers might ever
  take more than 24 days?
 

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

--
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] Package problems

2012-02-02 Thread Arno Garrels
Stefan Paege wrote:
 Unit MD5.pas is opened in the
 editor. It has only one line:
 Bomb('This file has been renamed from MD5 to IcsMD5. Update your
 uses clause !');

This file doesn't exist in current ICSv5, where did the compiler find
it?

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