Re: [twsocket] HttpCli / Async in thread problems --- Tryng to trace
Arno Garrels wrote: Frans van Daalen wrote: One was using webmarshal and the other ISA. But i'm not behind a proxy and also still keep getting the HTTP component is busy error message when using the async get. It still doesn't work probably so don't send it to your customer yet. I'm working on this stuff again since a couple of hours with some progress, I'll commit another fix soon when it's ready, not before monday. Ok ! There is other work laying around so... ;-) Well, I just checked in a new change with log: Any progress with patch rev #669+ ? It's on my list to test this week. WIll let you know as soon as I have done my first test run. If that seems to work I will send it to a client to also test it. Arno, Sorry to inform you that the problem is still there. Even when not behind a proxy the GetAsync will fired the requestdone even when not ready causing the next call to generate an exception HTTP component is busy Used V7 daily archive download from the site for testing. -- 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] HttpCli / Async in thread problems --- Tryng to trace
Hi, thanks for the report. Sorry to inform you that the problem is still there. Even when not behind a proxy the GetAsync will fired the requestdone even when not ready causing the next call to generate an exception HTTP component is busy Are you able to reproduce the issue with OverbyteHttpAsy demo? Is it an URL publicly accessible? If yes, please send me that URL or post it to this list. Maybe the reason is not related to redirection and proxy usage at all? It's an page request that generates a 301 status. HttpAsy is not a threaded application, seems there the same url will then not generate a problem. HttpThr1 doesn't do a async call so again no problem. I can send you a few links but then again I do not know if those always generate that error. My test does a few thousand calls and some generate that error. -- 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] HttpNoBasicAuth
it's time for a rewrite from scratch IMO. And give it a different name, to bypass the no brake early code rule, or some of the annoyances will have to remain. Or start a new branch of renewed components. And, IMHO, if technically possible, the THttpCli should mix HTTP and HTTPS, and handle internally what protocol to use, based in the current URL, that can originate from an usual HTTP to HTTPS redirect. In my opinion, the future cross platform Delphi which will come sooner or later (hopefully sooner) will be the best candidate for a rewrite. It will be ICS V8. Given the fact that even the basic function (GetASync) is broken and hard to correct IMHO waiting for a next version of delphi is to late to start ( planning ) a rewrite. -- 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] HttpCli / Async in thread problems --- Tryng to trace
That's not all, I found and fixed some more problems so far. I just checked in Rev. #670 into SVN, please test the fix and report back as soon as possible, thanks for your help. Log: Proxy authentication with relocations (hopefully) fixed. SSL not tested yet. If it still doesn't work it's probably a buggy proxy server i.e. 3Proxy. Parse NTLM user codes into domain and user name parts and pass them to NtlmGetMessage3 in method GetNTLMMessage3. Arno, Thanks again for the work! I will make time next week to test together with the user that had the problem, so I know for sure it is solved :-) In the mean while i wrote a workaround by recalling the get and resetting the proxy values when a 407 was received. Easy to do in my application as that 407 should never happen at that moment. -- 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] HttpCli / Async in thread problems --- Tryng to trace
What proxy server does your client use? One was using webmarshal and the other ISA. But i'm not behind a proxy and also still keep getting the HTTP component is busy error message when using the async get. -- 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] HttpCli / Async in thread problems --- Tryng to trace
Update : Seems there are still scenario's where the problem returns also sometimes the proxy settings are lost creating a 407 when a relocation happens. Seems to happen when executing a GetAsync and a relocate is triggered (with follow relocation set) Thanks for the report. That's probably because SetReady is skipped with it's code related to proxy and www-authentication :( The HTTP component is a TRUE beast. Yes, it is! Is there not something like a full-blown http test tool which we can run against it and then start rewriting some parts to get it back in it's cage ? I found several on the web but have no idea if it has ever been used for THttpcli Can you locate that setready skipping somewhere? I have been maintenace programmer for a long time so used to reading others code but this one is hard to read and understand. -- 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] HttpCli / Async in thread problems --- Tryng to trace
You are right, I did not test the GetAsync, in async mode RequestDone is actually fired with StatusCode 0 after relocation. Triggered by a call to CheckDelaySetReady in GetBodyLineNext. When I add a check for FLocationFlag there it _SEEMS_ to fix it, has to be still tested very hard in order not to introduce new bugs: TriggerDocEnd; if {(FResponseVer = '1.0') or (FRequestVer = '1.0') or } { see above} { [rawbite 31.08.2004 Connection controll] } (FCloseReq) then { SAE 01/06/04 } FCtrlSocket.CloseDelayed else if not FLocationFlag then // == Try this change and test, test, test... CheckDelaySetReady; { 09/26/08 ML } I tested it and it seems indeed to solve the problem. I spend several hours extra trying to read and understand the reason behind this but httprot file is not that easy to read :-) Well done and thank you! Update : Seems there are still scenario's where the problem returns also sometimes the proxy settings are lost creating a 407 when a relocation happens. Seems to happen when executing a GetAsync and a relocate is triggered (with follow relocation set) -- 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] HttpCli / Async in thread problems --- Tryng to trace
Frans van Daalen wrote: seems that the bug is also somewhere related to the NTLM code or call because the icslogger shows the following - Starting relocation process - state = httpReady - PrepareNTLM - PrepareNTLM - RequestDone psss why is that there?? It will trigger the onRequestDone That is intended in case of SetReady was called in StartRelocation or LocationSessionClosed because LocationChangeMaxCount reached the limit. It did not reached its locationmaxcount. I think it it a SetReady from procedure THttpCli.StateChange(NewState : THttpState); line 1478 if PrepareNTLMAuth(FlgClean) or {$IFDEF UseDigestAuthentication} PrepareDigestAuth(FlgClean) or {$ENDIF} PrepareBasicAuth(FlgClean) then begin else line 1534 TriggerRequestDone; * - But I have trouble tracing the exact moment the ready is set. Question : Before we re-enter login should we not set the state to htttpNotConnected when moving from www.xxx to www2.xxx ? -- 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] HttpCli / Async in thread problems --- Tryng to trace
You are right, I did not test the GetAsync, in async mode RequestDone is actually fired with StatusCode 0 after relocation. Triggered by a call to CheckDelaySetReady in GetBodyLineNext. When I add a check for FLocationFlag there it _SEEMS_ to fix it, has to be still tested very hard in order not to introduce new bugs: TriggerDocEnd; if {(FResponseVer = '1.0') or (FRequestVer = '1.0') or } { see above} { [rawbite 31.08.2004 Connection controll] } (FCloseReq) then { SAE 01/06/04 } FCtrlSocket.CloseDelayed else if not FLocationFlag then // == Try this change and test, test, test... CheckDelaySetReady; { 09/26/08 ML } I tested it and it seems indeed to solve the problem. I spend several hours extra trying to read and understand the reason behind this but httprot file is not that easy to read :-) Well done and thank you! -- 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] HttpCli / Async in thread problems
Forgot to say that the logged status after the call is almost always HttpDnsLookup and that the exact line in HttpRequestDone is If (Sender as ThttpCli).State in [httpReady,httpAborting,httpClosing] then Begin PostMessage((Sender as THttpCli).CtrlSocket.Handle, WM_QUIT, 0, 0); - Original Message - From: Frans van Daalen i...@hedaal.nl To: ICS support mailing twsocket@elists.org Sent: Thursday, December 23, 2010 6:32 PM Subject: [twsocket] HttpCli / Async in thread problems I have this code HttpClient.OnRequestDone := HttpRequestDone; HttpClient.OnCommand := HttpClientCommand; HttpClient.OnLocationChange := HttpClientRelocate; httpclient.GetASync; httpclient.CtrlSocket.MessageLoop in HttpRequestDone i have the following code PostMessage((Sender as THttpCli).CtrlSocket.Handle, WM_QUIT, 0, 0); /// Sometimes when I check the status after the GetAsync with this code if HttpClient.State httpready then LogEvent('Execute','After MakeTheCall',StateToStr(HttpClient.State),HttpClient.Url); I find several entries in the log event, but I have trouble understanding. Can someone give me a hint As far as I can find the problems begin when the call gets a 302 and in this case the 302 will relocate from www. to www2.xxx Tested both in V6 and V7 Frans -- 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] HttpCli / Async in thread problems --- Tryng to trace
Forgot to say that the logged status after the call is almost always HttpDnsLookup and that the exact line in HttpRequestDone is If (Sender as ThttpCli).State in [httpReady,httpAborting,httpClosing] then Begin PostMessage((Sender as THttpCli).CtrlSocket.Handle, WM_QUIT, 0, 0); I have this code HttpClient.OnRequestDone := HttpRequestDone; HttpClient.OnCommand := HttpClientCommand; HttpClient.OnLocationChange := HttpClientRelocate; httpclient.GetASync; httpclient.CtrlSocket.MessageLoop in HttpRequestDone i have the following code PostMessage((Sender as THttpCli).CtrlSocket.Handle, WM_QUIT, 0, 0); /// Sometimes when I check the status after the GetAsync with this code if HttpClient.State httpready then LogEvent('Execute','After MakeTheCall',StateToStr(HttpClient.State),HttpClient.Url); I find several entries in the log event, but I have trouble understanding. Can someone give me a hint As far as I can find the problems begin when the call gets a 302 and in this case the 302 will relocate from www. to www2.xxx Tested both in V6 and V7 Frans Found an error in OverbyeIcsHttpProt, not the reason for the error above line 1760 : DebugLog(loProtSpecDump, Format('PrepareNTLMAuth end, FStatusCode = %d ' + should be DebugLog(loProtSpecDump, Format('PrepareNTLMAuth Begin, FStatusCode = %d ' + seems like a copy past errror. seems that the bug is also somewhere related to the NTLM code or call because the icslogger shows the following - Starting relocation process - state = httpReady - PrepareNTLM - PrepareNTLM - RequestDone psss why is that there?? It will trigger the onRequestDone but at the same time the relocation is still going on because this is the rest of the ics log while I also get the trace from my own software due to the trigger. - Login www2.xxx - State = httpDnsLookup -- 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] help on httpcli post
Hi Xavier, Francois is trying to tell you that you need to read some more about the difference between post and get and the way those work in a form. Try the following Host: 81.184.21.22:100 url = POST /hfs/. data = fileupload1=C%3A%5CDocuments+and+Settings%5C%5CDesktop%5Ctest.txtupbtn=Upload+files this will upload a file (test.txt) from the desktop of user XX to the server - Original Message - From: Xavier Mor-Mur xmor...@telepolis.com To: ICS support mailing twsocket@elists.org Sent: Tuesday, October 12, 2010 1:23 PM Subject: Re: [twsocket] help on httpcli post Hello Francois As I know HFS have a some kind of code but I don't know how to call it from client. Open on your navigator http://81.184.21.22:100/hfs/; and will see a very easy web page with list of files with two buttons UPLOAD and LOGIN. Upload button allow select up to 10 files and then upload it using UPLOAD FILES button. HFS is one exe and one config file, don't need install and all work is done internally. I tried some demos using http post and only found one which works. Demo which works is submitfile from http://www.clevercomponents.com/products/inetsuite/demos/submitfile.asp I don't know it does but it works, but other http demos from same site using post don't work. Any idea is welcome, in the mean time will try with options of HFS. Regards Xavi Al 12/10/2010 09:48, En/na Francois PIETTE ha escrit: I try to include http get and post to my program and doing tests on OverbyteIcshttptst demo. I get function GET work but not with function POST. I configured at home free HFS - HTTP File Server from http://www.rejetto.com/hfs/ When running demo I set URL = http://81.184.21.22:100/hfs/c-obfuscado.txt Data = C:\Mis documentos\c-obfuscado.txt Button GET works and how text file in panel Button POST give sequence events bellow. POST Failed ! StatusCode = 404 ReasonPhrase = Request aborted on timeout Sure I missing to do something but I don't know what. You cannot do a post to a document link unless there is a script (or whatever code is required) at server side to handle the post. I suggest you first try posting using your favorite internet navigator to validate the webserver configuration, then you may start doing the same with the component. Usually, the webserver has an HTML form with some fields (including file field) and a submit button. behing the submit button, you have the URL used to post the form. This is the URL you have to use with the component. -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be Se certifico que el correo entrante no contiene virus. Comprobada por AVG - www.avg.es Version: 9.0.862 / Base de datos de virus: 271.1.1/3192 - Fecha de la version: 10/12/10 08:34:00 -- Xavier Mor-Mur -- 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] FTP client supports Utf-8 in ICSv7 now
- Original Message - From: Francois Piette [EMAIL PROTECTED] Angus and I added UTF-8 support to the TFtpCli V7. I think Angus and Arno deserve a BIG thank from all of us for the huge work they've done supporting internationalisation in FTP component. Thanks guys ! +1 ! -- 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] trying to avoid MS tcp throttling ('half-open' connections limit); problems with aborting connections.
- Original Message - From: Merijn Bosma [EMAIL PROTECTED] To: twsocket@elists.org Sent: Monday, March 10, 2008 1:57 PM Subject: [twsocket] trying to avoid MS tcp throttling ('half-open' connections limit); problems with aborting connections. Hi all, We've been using ICS for quite a while now, but recenlty we've come at the point that we hit the limit of 10 'half-open' connections introduced in Windows XP SP2. See: http://www.microsoft.com/technet/support/ee/transform.aspx?ProdName=Windows%20Operating%20SystemProdVer=5.2EvtID=4226EvtSrc=TcpipLCID=1033 In an attempt to avoid hitting the maximum of 10 'half-open' connetions (meaning status is SYN_SENT, client sent SYN, but did not receive ACK (yet)) when trying to build up a lot of TCP connections, I'm limiting the time each connection has to 'get connected'. I download some software to patch the system file http://lvllord.de/ -- 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] HTTP Get problem.
did you test it with overbyteicshttptst.exe ? I get the same results as in IE Frans - Original Message - From: Jean-Paul Passama Hi all, I try this request with my browser : http://www.bridgeplus.com/get_participation_essai.php?cl=5500051trn=M200704 I have a good result (Ok at the end). When I try it with the HTTPclient component, not the same result. (The PHP script is looking in a table for the club number 5500051 and the tournament M200704 : if found : Ok) Thank you for your ideas JP Passama Gary Stafford a écrit : Hi, I have an application that creates the data to send over a socket on the fly and would like to have a progress bar that tells me how much data is left to send. So what is the best way to get information about the buffer that is used by Twsocketclient.PutDataInSendBuffer Thanks for your help Gary -- 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] Httpcli cookie
While the discussion for the urlencode on autorelocate is going nicely :-) I also have a small remark to make about the cookie property. Currently the following is done when a cookie is received - else if Field = 'set-cookie' then begin bAccept := TRUE; TriggerCookie(Data, bAccept); end - would it not be beter to save the recieved cookie somewhere in the httpcli component? I believe that this cookie-property is the only received property that is not feed back into the component when recieved. Currently I handle this in the oncookie event but that means that I have extra variables laying around for every httpcli component I use and i really not like that. It's a kind of weird that after a get or post I need to access on variable to see the real returned cookie value. I have the code available so i can propose the change but would like to see some comments on the basic idea first Kind regards, Frans -- 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] Httpcli cookie
From: Francois PIETTE Normally, cookies are managed by the application. It is not always that simple because of path and expiration. You can have a lot of cookies grabbed from one or even several URL while redirecting. So you should really write some manager code to have cookies somewhat persistant. That's why the event pass the cookie thru an event and do not store it in the component. Note that you can derive your own HTTP component from ICS component and add the storage or manager you like. In my opinion, it is better to write a separate class for cookie management and link that class to your HTTP component. A cookie manager component would be a nice addon to ICS :-) Yes, deriving would be an option, did not think about that one. But just recently I came across some weird and wonderful websites that did non-standard thinks to the cookie, so far for bad excuses :-) How would you add to the current httpcli (v6) component a cookie-manager in a non code breaking manner as the current cookie is defined as a string? I'm willing to spend time on writing a rudimentary manager as this would add more value the your component and it's a nice way to contribute something other then the postcard :-) -- 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] Httpcli cookie
From: Francois PIETTE Note that you can derive your own HTTP component from ICS component and add the storage or manager you like. In my opinion, it is better to write a separate class for cookie management and link that class to your HTTP component. A cookie manager component would be a nice addon to ICS :-) How would you add to the current httpcli (v6) component a cookie-manager in a non code breaking manner as the current cookie is defined as a string? Write a TCookieManager component. Create a new property CookieManager in the HTTP component. At design time, link the cookie manager component to the http component. In the http component, when a cookie is received and the cookie manage is assigned, the HTP component call the appropriate methods in the cookie manager. The same when a request is sent: if cookie manager is assigned, the http component request the cookie manager to get the cookie list to add to the request. Nice, agreed. I will add this to my list. As soon as a first version is available I will post it here. For all readers, if you can think of any cookiemanager functions etc, just list them and I'll see what I can do. Frans -- 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] Httpcli cookie
From: Francois PIETTE For all readers, if you can think of any cookiemanager functions etc, just list them and I'll see what I can do. Your funtions are based on the assumption that there is a manager per httpcli, but maybe beter to have a manager that can handle multiple httpcli? procedure AddCookie(const Cookie : String); procedure AddCookie(Host : String; Data : String); Add cookie for a host to the collection. Maybe terurn value must be set to see if the cookie is accepted by the manager? function ScanCookies(const URL : String) : String; // Return a list of header lines (CR/LF delimited) with all stored cookie valid for the given URL. procedure ScanCookies(Host:String;Path:String): String; Returns a string with all cookies for a specifiek path for a specifiek host, maybe use ; as delimeter as that would allow to connect it to the current cookie in thttpcli. If Path is not given default path =/ will be used. procedure Clear; // Delete all procedure ClearAll Clears all cookies for all hosts procedure Clear(Host: String; Path:String) Clear cookies set for a host and specifiek path. If path not set default path =/ will be used. function GetCookiePath(Host : String) : TStringList; will return all available paths for which a cookie has been saved for named host. procedure SaveToStream(Stream : TSream); Maybe also SaveHostCookieToStream(Host : String : Stream : TStream) saves all cookies for all paths for 1 specifiek host procedure LoadFromStream(Stream : TStream); Maybe also LoadHostCookieFromStrea,(Host : String : Stream : TStream) loads all cookies for all paths for 1 speciek host procedure Purge; // Purge all expired cookies ? what should this one do? -- 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
Re: [twsocket] httpcli v6 bad request
From: Arno Garrels Instead the component should provide access to parts of a URL, either by var-parameters in event OnLocationChange As said before the OnLocationChange is to late. That event is triggered just before the relocate will execute. All properties of the thttpcli are then already set. Therefor my proposal for a new event - 2) A new event OnRelocationRecieved(data : String; Accept : Boolean) to be called around line 2675 (procedure getheaderlinenext) - -- 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] Httpcli cookie
From: Frans van Daalen procedure Purge; // Purge all expired cookies ? what should this one do? arg maybe I schould read the command about the expired cookies :-) -- 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] httpcli v6 bad request
- Original Message - From: DZ-Jay [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Thursday, April 19, 2007 11:44 AM Subject: Re: [twsocket] httpcli v6 bad request On Apr 18, 2007, at 15:11, Frans van Daalen wrote: Please note that the following will cause the server to include a %20 before sending the header p = http://www.hedaal.nl/tmp/to here.html response.redirect p Are you sure it is the server and not the client that is making the translation? It may also be an ASP feature that performs the translation, in which case it is still a client solution (by client I mean that it is not directly the server, but a consumer of the services provided by the server, in this case the ASP framework). No idea, I can only see that the send header in this case will have the %20 included already. -- 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] httpcli v6 bad request
Notice that replacing spaces may not suffice, as it may fail too if any other unencoded character is included; so if you want HttpCli to handle it, I would suggest rather a call to an HTML-Encode function for the URL prior to posting the response. However, I still think that this should go at the point of actually sending the response, to make sure that *any* URL requested is encoded properly, regardless of where it was captured (user, redirect response, etc.). dZ. Or allow to do it yourself at onrelocation event but as stated before that event is constructed such that it does not allow access to the url. So either a new event at the correct point or a automatic urldecode call to format the url correctly. -- 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] httpcli v6 bad request
Frans, As I mentioned before, replacing spaces will still leave you open to other invalid characters. If you want a quick fix for your current problem, then I suggest URL-encoding the entire URL instead of just the the spaces. Its been a while since I've used HttpCli, so I'm not sure if it provides one, but creating a URL encoding function is not that hard (its basically turning every invalid character into a code of the form %XX where XX represents the ASCII code for character in Hex), contact me privately if you need help with it. thank you for the offer. Urldecode and Urlencode are present in the ics library so that is not a 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] httpcli v6 bad request
my 2 cents on this : If you feed Thttpcli.url with a invalid url no urldecode is executed. To keep consistency in behavior I would not just do an automatic urldecode on a relocate. The main issue is however that with the followrelocate set it will generate an error while a browser will not. To allow a programmer to make a decision on an invalid relocate url the component must provide an option to do so. I therefore see 3 possible solutions. 1) A new property AutoDecodeRelocationUrl type Boolean. Default FALSE. If set TRUE will execute a urldecode on the relocate AND possible on the httpcli.url also. But if it include the later option as well the name maybe should be AutoUrlDecode. 2) A new event OnRelocationRecieved(data : String; Accept : Boolean) to be called around line 2675 (procedure getheaderlinenext) -- { co=32js=1.4sr=1024x768re=http://www.thesite.com/you.html } FLocationFlag := TRUE; if Proxy '' then begin -- something like -- { co=32js=1.4sr=1024x768re=http://www.thesite.com/you.html } baccept := true; if Assigned(FOnRelocationRecieved) then FOnRelocationRecieved(data,baccept); If baccept then FLocationFlag := TRUE; if Proxy '' then begin -- This would allow the programmer to temporary overrule the FFollowRelocation setting on demand but also allow adjustment of the received header data. I think that would enhance flexibility. 3) A change to the procedure getheaderlinenext to just change the received data. In my opion not the best option as it can cause confusion about what is really received. Feedback appreciated : -- 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] httpcli v6 bad request
Francois, The website and page that is the cause of this problem is rather hard to get to. I'm trying to create a simial problem on one of the website I have myself. As soon as I have done that I will let you know. I have solved it for now by with httpClient.FPath := stringreplace(httpclient.fpath,' ','%20',[rfreplaceall]); in a onLocationChange event Frans - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, April 18, 2007 2:38 PM Subject: Re: [twsocket] httpcli v6 bad request Hello Frans, I'm back from vacation and see your messages. Do you have a reproductible case that I could try easily ? -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Frans van Daalen [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Monday, April 16, 2007 7:29 PM Subject: Re: [twsocket] httpcli v6 bad request arggg...found it! The location url contains a space. I'm now trying to solve this. Using the OnLocationChange to adjust the url doesn't work because of --- THttpCli.StartRelocation . . . if Assigned(FOnLocationChange) then FOnLocationChange(Self); SaveLoc := FLocation; { 01/05/03 } InternalClear; FLocation := SaveLoc; FDocName := FPath; AdjustDocName; . . . --- FPath already holds the new location value. Anyone with some ideas? -- 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] httpcli v6 bad request
Francois, I constructed a 301 page for you at www.hedaal.nl/tmp/fromhere.asp If you use IE this link will relocate you to http://www.hedaal.nl/tmp/to%20here.html If you use OverbyteIcsHttpTst it will give you a 400 Bad Request because of the space in to here.html The asp code for the fromhere.asp is - p = http://www.hedaal.nl/tmp/to here.html Response.Status=301 Moved Permanently Response.AddHeader Location, p Please note that the following will cause the server to include a %20 before sending the header p = http://www.hedaal.nl/tmp/to here.html response.redirect p Frans - Original Message - From: Frans van Daalen [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, April 18, 2007 6:49 PM Subject: Re: [twsocket] httpcli v6 bad request Francois, The website and page that is the cause of this problem is rather hard to get to. I'm trying to create a simial problem on one of the website I have myself. As soon as I have done that I will let you know. I have solved it for now by with httpClient.FPath := stringreplace(httpclient.fpath,' ','%20',[rfreplaceall]); in a onLocationChange event Frans - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, April 18, 2007 2:38 PM Subject: Re: [twsocket] httpcli v6 bad request Hello Frans, I'm back from vacation and see your messages. Do you have a reproductible case that I could try easily ? -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Frans van Daalen [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Monday, April 16, 2007 7:29 PM Subject: Re: [twsocket] httpcli v6 bad request arggg...found it! The location url contains a space. I'm now trying to solve this. Using the OnLocationChange to adjust the url doesn't work because of --- THttpCli.StartRelocation . . . if Assigned(FOnLocationChange) then FOnLocationChange(Self); SaveLoc := FLocation; { 01/05/03 } InternalClear; FLocation := SaveLoc; FDocName := FPath; AdjustDocName; . . . --- FPath already holds the new location value. Anyone with some ideas? -- 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 -- 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] httpcli v6 bad request
That appears correct, the THttpCli changes a POST to a GET request when automatically redirecting. RFC1945 however say that this is wrong: That's true. We found the same thing while building an interface to one server. Note, however, the major browsers all change the POST to a GET. The server we interface with, in fact, expects a GET at the location it redirects us to with the 302 response. I remember long time ago we discussed this topic (post changed to get after relocation) and we concluded that it must be done so because most browser do not follow the standard and not doing like the browser will result in failure. That is probably how a bug in a well known browser become a de-facto standard ! Like it or not, if you don't do the same, your program will be accused of malfunction even if it perfectly follow the standard. Is it possible that httpcli will not send/set the cookies after recieving a 302? I think that might be the reason for recieving the bad request response. -- 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] httpcli v6 bad request
arggg...found it! The location url contains a space. I'm now trying to solve this. Using the OnLocationChange to adjust the url doesn't work because of --- THttpCli.StartRelocation . . . if Assigned(FOnLocationChange) then FOnLocationChange(Self); SaveLoc := FLocation; { 01/05/03 } InternalClear; FLocation := SaveLoc; FDocName := FPath; AdjustDocName; . . . --- FPath already holds the new location value. Anyone with some ideas? -- 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] httpcli v6 bad request
Hi all, Something i'm trying to solve for some time now I have http.postasync call that returns a h1Bad Request/h1 Using a sniffer however I see no such respons from the server, in fact I can only see the expected response! (302) Anyone with a hint where to start looking? -- 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] httpcli v6 bad request
Tested it without firewall etc. The first postasync generate 302 from the server. As follow is set the httpcli will also do a get for the relocation. after processing of the result of that relocation the second postasync to the same server will generate again 302, follow is set. This time in the code I see the response bad request. In the sniffer I will however see the 302 (as expected) but there is no additional get to relocate send out by the software. So it seems that after receiving the 302, the thttpcli tries to generate the correct values to do a relocation and fails somewhere/somehow? Kind regards, Frans - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Thursday, April 05, 2007 6:44 PM Subject: Re: [twsocket] httpcli v6 bad request Maybe some security product which filter your requests ? -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Frans van Daalen [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Thursday, April 05, 2007 6:11 PM Subject: [twsocket] httpcli v6 bad request Hi all, Something i'm trying to solve for some time now I have http.postasync call that returns a h1Bad Request/h1 Using a sniffer however I see no such respons from the server, in fact I can only see the expected response! (302) Anyone with a hint where to start looking? -- 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] Confirming an Abort in THttpCli
I have a multi-threaded application that uses a dynamically created THttpCli synchronously. I know that ICS is normally used asynchronously, but I could not determine a good way to handle that with all the dynamically created threads I have to use for database access anyway. When I want to terminate the thread normally or when I force it to terminate I call the THttpCli.Abort method. How can I insure that the THttpCli component is indeed aborted before freeing it and ending the thread? Right now I do: HTTP.Abort; while HTTP.StatehttpReady do Sleep(10); Is this incorrect, unecessary or adequate? I was getting some ICS errors when freeing the thread which may have been related to freeing the THttpCli or the underlying receive stream. Thanks, -Johnnie Norsworthy Johnnie, I did the same thing (except for the sleep) but keep getting troubles with the abort (hangs). The sleep I did not because I called the abort outside the thread and you don't want to sleep the main thread! I guess you also call it outside the thread as you use a sync call in the thread :-) I changed to async calls but with the http.CtrlSocket.MessageLoop to mimic sync behaviour. And for the abort I then used the PostMessage(Http.CtrlSocket.Handle, WM_QUIT, 0, 0) to kill it. Never had any troubles again! Nice thing is that my multihreaded app is now showing much beter cpu load then with the sync call ! -- 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] How to uses many THttpCli simultaneously ?
... and I get a Violation access. I guess it's because all the THttpCli uses the same RequestDone procedure (the THttpCli is known by its Tag : 1 to 5). where did you get the av, and can you show the code for that line? -- 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
So how to proceed? Can we come up with some other test scenarios? The answer must have something to do with _how_ ICS load the dll... or any other ideas? // Henrik Henrik, any default units that gets automatically added in your project like madexcept or fastmm4 ? -- 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 its parentform
Question: We do understeand the word 'Freeze' the right way ? Form cannot moved, closed, application cannot quit, etc... Right ? It was writen in some previous posting that the application was then at 50% cpu, so on a hyperthreaded cpu, the application is in some fast loop, i gues -- 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
Question: We do understeand the word 'Freeze' the right way ? Form cannot moved, closed, application cannot quit, etc... Right ? It was writen in some previous posting that the application was then at 50% cpu, so on a hyperthreaded cpu, the application is in some fast loop, i gues It's an Intel Core Duo on the machine I use to duplicate the problem. Can the type of processor be a problem in this case? // Henrik I have really no idea, I was just guessing that the problem was a fast loop due to the reported cpu load. But with the log you provided maybe someone is able to help. I can not :( -- 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] TWSocket Digest, Vol 199, Issue 2 (Aleksey Potjomkin)
Have a look at FtpAsy sample program (In ICS-V5 but also good for V6 provided you change the uses clause). Sorry, but i couldn't find any such sample as in ICS archive, same not at your website (User made section). Can you please give me exact way where to get this sample ? You may also have a look at the MailSndAsync demo of V5, it's SMTP but Same problem as with FtpAsy, i can't find that anywhere. just download the ics v5 and then have a look in de ics/internet directory -- 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] TWSocket Digest, Vol 199, Issue 2 (Aleksey Potjomkin)
- Original Message - From: Aleksey Potjomkin [EMAIL PROTECTED] To: twsocket@elists.org Sent: Tuesday, December 12, 2006 10:36 PM Subject: Re: [twsocket] TWSocket Digest, Vol 199, Issue 2 (Aleksey Potjomkin) Hello ! just download the ics v5 and then have a look in de ics/internet directory OK, I did. But i'm still can't understand main point of it. How to handle concurrent connections ??? As I understood, main feature of it is event OnRequestDone and there I can make a switch: just create some more ftp's components or maybe as many needed. Have a look at the httpasy project for some nice idea's :-) -- 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 its parent form
- Original Message - From: Henrik [EMAIL PROTECTED] To: twsocket@elists.org Sent: Monday, December 11, 2006 9:59 AM Subject: [twsocket] Freeze when using smtp after recreating its parent form Hi! I have probably misunderstood something because I get the same behavior described below no matter which of the components SmtpCli, SyncSmtpCli and HtmlSmtpCli I use. The problem has to do with freeing the smtp-components parent form. You can easily duplicate the behavior with one of the standard demo applications: * Open Your favorite demo of MailSnd, MimeTst or MailHtml. (I proceed with MailSnd-demo below.) * Add a new form with a button to the project. Write the following in the buttons OnClick method: procedure TForm2.Button1Click(Sender: TObject); begin SmtpTestForm := TSmtpTestForm.Create(Application); try SmtpTestForm.ShowModal; finally SmtpTestForm.Release; end; end; When entering the second time is the form already released then? I normally just call .free never used .released. I also make the SmtpTestForm a procedure based variable in these kind of constructions. -- 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
I normally just call .free never used .released. You have to use Release when called from an event handler which originate from the form you are freeing. Release make sure all curent events are processed. Free does an immediate free which will crash the application if one event handler is still running. But that was not the case with this code, there was just a showmodal -- 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
Hi Frans! Yes, each time You press the button the form is created and then released. You also get the same problem if You set Action to caFree in the OnClose of the created form. Sorry, for not expressing myself any better. My question was If you run the debug and while entring the buttonclick is the .release finished so did you find the form to be free-ed already and my second remark was If you replace the .release with .free is the problem still there?. My final remark was that I normally have the form as a procedure variable as it is not needed to be defined outside the buttonclick event and maybe that also solves your issue. -- 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] Acess Violation - TCustomWSocket
What is the value of WSocketGCount when you get the av? - Original Message - From: Marcelo Grossi [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Monday, December 04, 2006 1:17 PM Subject: Re: [twsocket] Acess Violation - TCustomWSocket Anyone has any idea on this? Best regars, Marcelo Grossi - Original Message - From: Marcelo Grossi [EMAIL PROTECTED] To: twsocket@elists.org Sent: Friday, December 01, 2006 10:20 AM Subject: [twsocket] Acess Violation - TCustomWSocket Hello everyone, There is this weird AE happening when I free my TWSocket... I managed to debug it up to the point below: TWSocket.pas * Line 3516 * Dec(WSocketGCount); if WSocketGCount = 0 then begin WSocketUnloadWinsock;// AE happens here { WSocketGCount := 0; // it is set to 0 in WSocketUnloadWinsock } end; * Line 1798 * function WSocket_Synchronized_WSACleanup : Integer; begin if @FWSACleanup = nil then @FWSACleanup := WSocketGetProc('WSACleanup'); Result := FWSACleanup; // --- AE happens right after this end; I don't know what I did wrong for this AE to be thrown. I can't even catch the exception. This happens all the time on my machine but on most machines using my app this problem never occurs... I cannot give you more details on the architecture of my app right, but any help on this matter will be greatly apreciated. Thanks, Marcelo Grossi -- 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] THttpCli.GetAsync without any time-out implementation?
- Original Message - From: Cosmin Prund [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, November 25, 2006 2:07 PM Subject: [twsocket] THttpCli.GetAsync without any time-out implementation? Hello! Two simple questions, both related: (1) Is it OK to create a new THttpCli component and call GetAsync from an THttpCli.OnDocData event handler? If tha getasync is the one of the new thhtpcli component, yes it is ok (2) If I do THttpCli.GetAsync *without* any kind of time-out mechanism, what's the worst thing that might happen? Will the component run for ever or will it stop when the TCP/IP stack gives up? Only thing I can think of is that the component will hang/run for ever -- 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] What might cause ICS to fail and we need to be aware of?
- Original Message - From: Cosmin Prund [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Monday, November 20, 2006 10:16 AM Subject: Re: [twsocket] What might cause ICS to fail and we need to be aware of? Francois Piette wrote: I don't know of ANY component where it is safe to call the message pump from one of its event without knowing what happend. Even for a simple TButton.OnClick, you can get strange result if you call the message pump within the OnClick handler because the handler is re-entered. The problem is more visible with TWSocket since it is likely the event is always reentered because of the high rate network I/O has. That's not entirely true. Delphi's GUI model is event-driven so I'm willing to bet ANY call to Application.ProcessMessages will be made as a result of handling an message or event. And I'm willing to bet most calls to Application.ProcessMessages can be traced to ether an TButton.OnClick event or a menu item's OnClick! And if it's such a big issue for ICS, why isn't there a simple 5-line-of-code test that would raise an exception if any code is re-entered? Why ? It is correct that it should enter that event. Incorrect use of processmessage lead to the incorrect moment of entry! Besides, I'm asking about such behavior because of the way the THttpCli component behaves for me. If you remember one of my earlier questions, I had lots of problems with the component failing to connect to my HTTP server. Using Ethereal I determined the connection is poor (lost packets, duplicate ACK's) BUT the component still averages an too high number of failed connections. I don't think I've had 5 consecutive sessions where no connections timed-out. And I'm saying the failure rate is too high because I never saw such a problem using my web browser. Not once! And after the time out expires and the component aborts and restarts it's Get, it usually finishes very very quickly. So I need to ask: Is there some other obvious thing I'm missing, like a call to Application.ProcessMessage? What else should I be looking for. So did you trace you browser then ? My gues is that there are as many failures but they are handled by the browser. You could do that as well in you application. It is not the responsibility of the httpcli component. repeat try xxx.get callok := true except inc(tried) end until callok or tried5 -- 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] Connection Problem SFTP
- Original Message - From: Beacon - Business Solution Architects [EMAIL PROTECTED] To: twsocket@elists.org Sent: Wednesday, October 18, 2006 12:20 PM Subject: [twsocket] Connection Problem SFTP Hi, I'm struggling with a strange problem at the moment establishing a SFTP connection. (Delphi 6) When executing the following procedure FTPClient1.PutAsync. I get the error . Application raised exception class FTPException with message 'FTP component not ready.' FTPClient1.ConnectAsync; FTPClient1.PutAsync; ß CAUSE ERROR FTPClient1.QuitAsync; I'm not a export on the ftp component but the connect is async so at the moment the putasync is called the connect might not be ready yet -- 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] ICS V6. and W98/W95
- Original Message - From: jan hek [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, October 18, 2006 3:48 PM Subject: Re: [twsocket] ICS V6. and W98/W95 Hello François, Applications generated by Delphi 7 with ICS v6 don't work under W95/W98. I tested in W95 and W98SE. If the application has a twsocket or derived on the form the application gives a : eedfade error. In the case the socket is created after a buttonclick, the creation fails.I don't have details : I don't have delphi 7 running in W98 regards jan - I have no problems with v6 on W98SE. Application is build using D7 and uses THTTPCLI -- 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 found in THttpCli--seeking solution, please help!
- Original Message - From: Fastream Technologies [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Monday, October 09, 2006 5:21 PM Subject: [twsocket] Bug found in THttpCli--seeking solution, please help! Dear ICS People, Please use the THttpCli demo to navigate to http://www.zaman.com.tr/pics . This Apache server returns a chunked encoded response of 301--a redirection to http://www.zaman.com.tr/pics/ but the component cannot understand the header ends and data starts!! Looking forward to your attention. Best Regards, SubZero Confirmed : tested in v5 and v6. Version 5 works as aspected Version 6 not. Frans -- 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 found in THttpCli--seeking solution, please help!
- Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Monday, October 09, 2006 6:36 PM Subject: Re: [twsocket] Bug found in THttpCli--seeking solution, please help! Please use the THttpCli demo to navigate to http://www.zaman.com.tr/pics . This Apache server returns a chunked encoded response of 301--a redirection to http://www.zaman.com.tr/pics/ but the component cannot understand the header ends and data starts!! Confirmed : tested in v5 and v6. Version 5 works as aspected Version 6 not. The bug is in THttpCli.GetHeaderLineNext. I checked V5 and V6 and the code is the same. Which V5 version are you using ? I mean which HttpProt.pas version do you have ? I have V1.93. 1.87 -- 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] How to use THttpCli with threads?
- Original Message - From: Abdullah AlQasim [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Friday, October 06, 2006 3:51 PM Subject: Re: [twsocket] How to use THttpCli with threads? I think the best way Francois provide us a full multi-threading example for HttpCli or any member in the list already done sample for that. like HttpThrd which is a http thread demo and available in the demo directory ??? -- 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] Http traffic counters
Hi, I have several thttpcli's in serveral threads doing some websearching. Can someone point me to a way to keep track of the total kb send/recieved /minute by all thttpcli's together. Thanks in advance Frans -- 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 THttpCli
some proxy-servers do not allow the head command. Frans - Original Message - From: Fastream Technologies [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Thursday, August 03, 2006 3:36 PM Subject: [twsocket] Problem with THttpCli Hello, I am trying to add our web server cache to proxy server. So far so good but there is a problem: I first send the HEAD command to learn the last modified date and file size. Then in onheaderend, I launch the GET command if the cache cannot satisfy the request. Here, sometimes the component does not fire the onheaderdata and onheaderend of the GET. They all use the same component and no exception is raised. I put socketspy between the proxy and the web server and the data reaches the web proxy however what I could figure out from the delphi code is that the state of the component is httpwaitingheader after the HEAD whereas it ought to be httpReady. Any idea? Best Regards, SubZero -- 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] THttpCli v6 - Relocation Problem
- Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Tuesday, July 04, 2006 7:29 PM Subject: Re: [twsocket] THttpCli v6 - Relocation Problem Frans van Daalen wrote: Arno, I tested this url and your change (only GetHeaderLineNext) and yes with connection keep-alive of no setting on connection all is fine. However with connection set to close the relocation fails on the third one. If I try to find where it hangs it shows DoRequestSync Application.ProcessMessages with fstate = httpwaitingbody. Hmm, I'm still not familiar with this component (looks rather complicated), however that error doesn't happen if I include the second change. Just tested HTTP1.1 with Connection := 'Close' successfully, are you able to reproduce the same? Arno mhhh, just found some time to continue... At this moment without your second change also a Close will work correctly...It seems that the httpwaitingbody already had a startrelocation implementated so I think that during the tests the server responded rather slow on a connection close ...goes away and makes extra checks arr...forget the above it seems the link is not langer making 3 relocations but only twoanyone with a new link to test this? -- 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] THttpCli v6 - Relocation Problem
Arno, I tested this url and your change (only GetHeaderLineNext) and yes with connection keep-alive of no setting on connection all is fine. However with connection set to close the relocation fails on the third one. If I try to find where it hangs it shows DoRequestSync Application.ProcessMessages with fstate = httpwaitingbody. - Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Tuesday, July 04, 2006 8:07 AM Subject: Re: [twsocket] THttpCli v6 - Relocation Problem Frans van Daalen wrote: If you want me to check it in detail just let me know and I will do so for you. Thanks, could you please check my small changes below? Try with both HTTP 1.0/1.1, with as well as w/o property Connection set to 'Keep-Alive'/ 'Close'. It's working here using GET, only I'm not sure whether it might have some other side effects, RequestDone is not triggered on each relocation. Problem URL: http://feeds.feedburner.com/foxsports/RSS/headlines?m=4765 leads to three relocations, first goes to a different host. 1 - procedure THttpCli.GetHeaderLineNext [..] { FContentLength = -1 when server doesn't send a value } if ((FContentLength = -1) and { Added 12/03/2004 } ((FStatusCode 200) or{ Added 12/03/2004 } (FStatusCode = 204) or{ Added 12/03/2004 } (FStatusCode = 301) or{ Added 06/10/2004 } (FStatusCode = 302) or{ Added 06/10/2004 } (FStatusCode = 304) or{ Added 12/03/2004 } (FStatusCode = 401) or{ Added 12/28/2005 } //AG 12/28/05 (FStatusCode = 407))) { Added 12/28/2005 } //AG 12/28/05 or (FContentLength = 0) or (FRequestType = httpHEAD) then begin { TriggerHeaderEnd; }{ Removed 10/01/2004 } if {(FResponseVer = '1.0') or (FRequestVer = '1.0') or} { [rawbite 31.08.2004 Connection controll] } FCloseReq then begin if FLocationFlag then { Added 16/02/2004 } StartRelocation{ Added 16/02/2004 } else begin { Added 16/02/2004 } if FRequestType = httpHEAD then begin { Added 23/07/04 } { With HEAD command, we don't expect a document } { but some server send one } FReceiveLen := 0; { Cancel received ta } StateChange(httpWaitingBody); FNext := nil; end; FCtrlSocket.CloseDelayed; { Added 10/01/2004 } end; end = else begin // not FCloseReq = if FLocationFlag then = StartRelocation else SetReady; = end; Exit; end; [..] 2 - Not so important, but LocationChangeCurCount has been counted incorrectly. procedure THttpCli.StartRelocation [..] FRcvdCount:= 0; FReceiveLen := 0; FHeaderLineCount := 0; FBodyLineCount:= 0; if {(FResponseVer = '1.1') and} { [rawbite 31.08.2004 Connection controll] } (FCurrentHost = FHostName) and (FCurrentPort = FPort) and (FCurrentProtocol = FProtocol) and (not FCloseReq) then begin { SAE 01/06/04 } { This block moved 03/07/2006 } = { V1.90 25 Nov 2005 - restrict number of relocations to avoid continuous loops } inc (FLocationChangeCurCount) ; if FLocationChangeCurCount FLocationChangeMaxCount then begin AllowMoreRelocations := false; if Assigned (FOnLocationChangeExceeded) then FOnLocationChangeExceeded(Self, FLocationChangeCurCount, AllowMoreRelocations); if not AllowMoreRelocations then begin SetReady; exit; end; = end; { No need to disconnect } { Trigger the location changed event 27/04/2003 } [..] --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Frans van Daalen wrote: - Original Message - From: Arno Garrels [EMAIL PROTECTED] .. Since I've never been using THttpCli in one of my applications I'm not very familiar with HTTP as well as the THttpCli. That's why I wonder whether it is intented to trigger RequestDone on each relocation or not (sometimes it's triggered in V5, V6 sometimesnot), probably someone more familiar with the component can clear me up? With two simple changes I can make the FollowRelocation feature working for the problem URL of the OP, however w/o RequestDone being triggered on relocation. If I remember
Re: [twsocket] V6 ThreadDetach #2
and if you replace waitfor it with a ThreadTerminated construction, maybe thats easier? I used waitfor only once and had deadlock issues which caused me to removed asap :-) - Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Thursday, June 22, 2006 8:01 PM Subject: Re: [twsocket] V6 ThreadDetach #2 Francois PIETTE wrote: This is surely not the problem, but WaitFor should be avoided when possible. It is known to create deadlocks. I already exchanged it by a simple WaitForSingleObject(ThreadHandle) since WaitFor is know to make trouble, anyway the problem persists. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Thursday, June 22, 2006 6:59 PM Subject: Re: [twsocket] V6 ThreadDetach #2 Fastream Technologies wrote: I had the same problem. In my case, I had to post a message before ending the thread. There was pending messages that called GetHandle which called AllocateHwnd()!!! My problem still persists, sometimes the exception Cannot attach when not detached is raised. However I cannot imagine that exchanging WaitFor by your method can change anything basically. Probably the strange GetHandle() getter is the culprid? Regards, SZ - Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Thursday, June 22, 2006 4:20 PM Subject: [twsocket] V6 ThreadDetach #2 I have the following problem in V6: constructor TListenThread.Create(AServer: TMtWSocketServer); begin inherited Create(True); FreeOnTerminate := FALSE; FServer := AServer; FServer.ThreadDetach; end; procedure TListenThread.Execute; begin FServer.ThreadAttach; FServer.Listen; FServer.MessageLoop; FServer.Close; FServer.ThreadDetach; end; procedure TForm1.btnStartClick(Sender: TObject); begin //properties of Server1 are assigned FListenThread := TListenThread.Create(Server1); FListenThread.Resume; end; procedure TForm1.btnStopClick(Sender: TObject); begin PostMessage(Server1.Handle, WM_QUIT, 0, 0); FListenThread.WaitFor; FreeAndNil(FListenThread); = here the Server1.Handle is not 0! Server1.ThreadAttach; // so raises an exception end; Any idea? --- 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 -- 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] THttpCli v6 : FollowRelocation / httpDnsLookup triggers request done
If FollowRelocation is set then on some sites the requestdone event is triggert on a httpDnsLookup. Is this correct? I have a wm_quit on requestdone to end the messageloop but with a httpDnsLookup that is not a good idea :-) -- 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] THttpCli v6 : FollowRelocation / httpDnsLookuptriggersrequest done
From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org If FollowRelocation is set then on some sites the requestdone event is triggert on a httpDnsLookup. Is this correct? At first glance not. Do you have an URL which show this behaviour and another which doesn't ? one with this behaviour is easy, I'm still searching for one that doesn't just use httpasy with the www.zoekhuis.nl url. Add this url twice and hit execute without the Simultaneous setting. In de IDE you will get a http component httpcli1 busy message on the second url because the first one fired req done on a httpdnslookup -- 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] THttpCli v6 : FollowRelocation/httpDnsLookuptriggersrequest done
- Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, May 06, 2006 3:39 PM Subject: Re: [twsocket] THttpCli v6 : FollowRelocation/httpDnsLookuptriggersrequest done just use httpasy with the www.zoekhuis.nl url. Add this url twice and hit execute without the Simultaneous setting. In de IDE you will get a http component httpcli1 busy message on the second url because the first one fired req done on a httpdnslookup OK. And for another url with relocation which doesn't show this behaviour ? mhhhseems I can not find one. -- 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] THttpCli v6:FollowRelocation/httpDnsLookuptriggersrequest done
From: Francois PIETTE [EMAIL PROTECTED] So, this is the normal behaviour :-) You can either ask the component to not follow the relocation, or use a flag in the OnLocationChange and OnRequestDone to handle that particular case. mhhh.just tested it with v5 and you're right. Seems there has always been a bug in my code :( I therefore have to change the requestdone event from PostMessage((Sender as THttpCli).CtrlSocket.Handle, WM_QUIT, 0, 0); to If (Sender as ThttpCli).State httpDnsLookup then PostMessage((Sender as THttpCli).CtrlSocket.Handle, WM_QUIT, 0, 0); Thanks for helping! -- 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] ICS-V6 Beta almost finalized
The latest V6 beta needs designide.bpl. if deployed as package Do you have any idea why ? removing the following two lines from the package removed the dependency // OverByteIcsWSocketE in 'OverByteIcsWSocketE.pas'; // OverbyteIcsNntpCli in 'OverbyteIcsNntpCli.pas'; did not check it in detail, was in a hurry, sorry -- [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] ICS-V6 Beta almost finalized
The latest V6 beta needs designide.bpl. if deployed as package Do you have any idea why ? removing the following two lines from the package removed the dependency // OverByteIcsWSocketE in 'OverByteIcsWSocketE.pas'; That's normal. It is a registration unit for a custom property editor. Should never be included in runtime package. // OverbyteIcsNntpCli in 'OverbyteIcsNntpCli.pas'; Strange. I don't see anything which would need DesignIde.bpl. that might be correct as I only removed line by line until the issue disapeared. As said i was in a hurry :) -- 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] HTTPCli in dynamically-loaded BPL
- Original Message - From: Mike Scott [EMAIL PROTECTED] To: twsocket@elists.org Sent: Monday, April 03, 2006 11:13 AM Subject: [twsocket] HTTPCli in dynamically-loaded BPL I'm wondering how to get an HttpCli to work in a dynamically-loaded BPL. I have made a BPL with forms that open close OK when called dynamically from a test app, but when I tried to use HtppCli I got a crash on closing the test app; if I put the HttpThr1 demo in, it crashes as soon as I click the Do It button.. -- Mike Scott I use httpcli in bpl without any problem, either as a component dropped or dynamicly created by code. Maybe the debug statement in the crash gives some pointers to what is the issue? FYI : madexcept might be very helpfull -- 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] wm_quit in requestdone in thread
I have the following code procedure TConsumerThread.Execute; ...some code while GetMessage(Msg, 0, 0, 0) do begin TranslateMessage(Msg); DispatchMessage(Msg); if Msg.Message = WM_REQUEST then Begin ...some code http.GetASync; http.CtrlSocket.MessageLoop; ...some code end; end; in the requestdone I have PostMessage((Sender as THttpCli).CtrlSocket.Handle, WM_QUIT, 0, 0); This wm_quit will hoverever also stop the thread execute...how can i solve that ? -- 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] wm_quit in requestdone in thread
- Original Message - From: Fastream Technologies [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, April 05, 2006 6:05 PM Subject: Re: [twsocket] wm_quit in requestdone in thread Hello, Why don't you use the Release method of VCL in the requestdone? Regards, SZ Isn't the release the start of a destroy? The http component is re-used until de thread execute recieves no new items to be processed - Original Message - From: Frans van Daalen [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, April 05, 2006 6:44 PM Subject: [twsocket] wm_quit in requestdone in thread I have the following code procedure TConsumerThread.Execute; ...some code while GetMessage(Msg, 0, 0, 0) do begin TranslateMessage(Msg); DispatchMessage(Msg); if Msg.Message = WM_REQUEST then Begin ...some code http.GetASync; http.CtrlSocket.MessageLoop; ...some code end; end; in the requestdone I have PostMessage((Sender as THttpCli).CtrlSocket.Handle, WM_QUIT, 0, 0); This wm_quit will hoverever also stop the thread execute...how can i solve that ? -- 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] wm_quit in requestdone in thread
- Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, April 05, 2006 7:46 PM Subject: Re: [twsocket] wm_quit in requestdone in thread Eh, my OE has no syntax check, why? const WM_MY_MESSAGE_AFTER_RQ_DONE = WM_USER + 1; WM_WHATEVER_MSG = WM_USER + 2; while GetMessage(Msg, 0, 0, 0) do begin if Msg.Message = WM_REQUEST then begin ...some code http.GetASync; end else if Msg.Message = WM_MY_MESSAGE_AFTER_RQ_DONE then ...some code after requestdone else if Msg.Message = WM_WHATEVER_MSG then ...?? else begin TranslateMessage(Msg); DispatchMessage(Msg); end; end; m...I see some light in the tunnel now, will try some new thinks according to this code to see if that is indeed the end of the tunnel or the train :-) Thanks for the 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
Re: [twsocket] wm_quit in requestdone in thread
thanks for the extra info - Original Message - From: Wilfried Mestdagh [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, April 05, 2006 8:20 PM Subject: Re: [twsocket] wm_quit in requestdone in thread Hello, Release post a message to the component's hidden window to destroy it. The destruction is done in the message handler. WM_QUIT will exit the message loop if using GetMessage, and it will also terminate program for example, but it is not the same. It is pure depandant of what the programmer do in his message pump. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Wednesday, April 5, 2006, 18:41, Fastream Technologies wrote: WM_QUIT has the same effect as Release! Regards, SZ - Original Message - From: Frans van Daalen [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, April 05, 2006 7:21 PM Subject: Re: [twsocket] wm_quit in requestdone in thread - Original Message - From: Fastream Technologies [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, April 05, 2006 6:05 PM Subject: Re: [twsocket] wm_quit in requestdone in thread Hello, Why don't you use the Release method of VCL in the requestdone? Regards, SZ Isn't the release the start of a destroy? The http component is re-used until de thread execute recieves no new items to be processed - Original Message - From: Frans van Daalen [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, April 05, 2006 6:44 PM Subject: [twsocket] wm_quit in requestdone in thread I have the following code procedure TConsumerThread.Execute; ...some code while GetMessage(Msg, 0, 0, 0) do begin TranslateMessage(Msg); DispatchMessage(Msg); if Msg.Message = WM_REQUEST then Begin ...some code http.GetASync; http.CtrlSocket.MessageLoop; ...some code end; end; in the requestdone I have PostMessage((Sender as THttpCli).CtrlSocket.Handle, WM_QUIT, 0, 0); This wm_quit will hoverever also stop the thread execute...how can i solve that ? -- 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 -- 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] Port number
- Original Message - From: Wilfried Mestdagh [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Friday, March 31, 2006 11:05 AM Subject: Re: [twsocket] Port number Hello Werner, When the server listen to port 2500, and the socket port start increasing from 2000. Do I get in trouble when it comes finaly to port 2489,2499..2500 the same port where the server is listening, or is this handled automaticaly No the OS will skip port 2500 and will get the first next free port. Probably 2501. command, then close again. And I see the port increasing fast, what about a limit ? can I reset the portnumber? No you cannot reset, but normally no problem. There are 65535 ports. And the TIME_WAIT ports will be released after 2 minutes. So a long time before yoiu have reach the highest port the low ones are free again, so OS will get ports back on the low range. was the default not 240seconds, posible minumum value 30sec ? And the port limited by maxuserport? -- 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] Httpcli not working, need suggestions
- Original Message - From: Jazzy Jeff [EMAIL PROTECTED] To: twsocket@elists.org Sent: Friday, March 31, 2006 8:22 AM Subject: [twsocket] Httpcli not working, need suggestions I just downloaded the ICS ver 5 a few mins ago, I compiled it under BDS2006 using bcb2006 with the updated patch. I compiled the example httptst to see if it could go to a webpage that required a username and password. When i ran the program (get button), this is the error message that i get. RequestDone Error = 11001 GET Failed ! StatusCode = 404 ReasonPhrase = can't resolve hostname to IP address //--- code -// HttpCli1-URL= http://192.168.1.1/main.htm; HttpCli1-Password = pass; HttpCli1-Username = user; //--- code -// even if i try a google address to se if it works, i still get the same error. If I click on the head button, the program seems to go to the internet then to retrieve the details of the webpage. But the get button does nothing but produce an error message. FVD: Seems to go? Or did go and returned with the header info? You're not behind a proxy or firewall with access control on program level? -- 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] ICS V6 Http Post problem
Data := 'FirstName=' + stringofchar('A',600) + '' + 'LastName=' + stringofchar('B',600) + '' + 'NextName=' + stringofchar('C',600) + '' + 'Submit=Submit'; This is wat the sniffer reports Content-Length: 1844 Parameters . NextName= C CFirstName=AA A So counting the chars it seems that a content-length above 1460 will create this problem. It seems some buffer position is not correctly set. Anyone with a idea or can someone confirm that this behaviour is on their machine as well? -- 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] ICS V6 Http Post problem
Hello Frans, I never used HTTP component (only basic WSocket) but may be you could check if you are using HTTP 1.0 or 1.1 content data can be splitted in multiple blocks when using HTTP 1.1. I don't know if it will help you, this is a simple idea. Regards. Dod, as far as i understood the http component has some 1.1 functionality implemented and can there split long sendstreams but somehow the buffer position is not correclty set in this example (I think) -- 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] ICS V6 Http Post problem
- Original Message - From: Francois Piette [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Thursday, March 23, 2006 8:52 AM Subject: Re: [twsocket] ICS V6 Http Post problem In your application, are you calling the message pump somewhere ? Specially from one of the ICS component event handler ? This will cause a lot of trouble with the events. btw: The message pump is typically Application.ProcessMessages, but can also be anythoing calling it indirectly (such as a modal form) or calling GetMessage/PeekMessage and the likes. Is it possible for you to slightly change the Http demo to do your post and if it reproduce the problem, mail it to me ? My dll is using messageloop but not from one of the ics event handlers. I will try to change the http demo such that the problem arises there as well. -- 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] ICS V6 Http Post problem
In your application, are you calling the message pump somewhere ? Specially from one of the ICS component event handler ? This will cause a lot of trouble with the events. btw: The message pump is typically Application.ProcessMessages, but can also be anythoing calling it indirectly (such as a modal form) or calling GetMessage/PeekMessage and the likes. Is it possible for you to slightly change the Http demo to do your post and if it reproduce the problem, mail it to me ? My dll is using messageloop but not from one of the ics event handlers. I will try to change the http demo such that the problem arises there as well. Well that was easy. I took the httppost demo off version 5. D7 IDE will convert it to V6 automaticaly (still need to manual remove the old httprot unit reference) and then chnages the following three lines (at line 172 in the PostButtonClick event) Data := 'FirstName=' + UrlEncode(Trim(FirstNameEdit.Text)) + '' + 'LastName=' + UrlEncode(Trim(LastNameEdit.Text)) + '' + 'Submit=Submit'; into Data := 'FirstName=' + stringofchar('A',600) + '' + 'LastName=' + stringofchar('B',600) + '' + 'NextName=' + stringofchar('C',600) + '' + 'Submit=Submit'; This is wat the sniffer reports Packet Summary Sequence: 1 ID: 1 Time: 9:50:50.312 Process: HttpPost (3948) Server Information IP Address: 213.53.113.70:80 Header Contents POST / HTTP/1.0 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/4.0 (compatible; ICS) Host: www.hedaal.nl Content-Length: 1844 Parameters FirstName=AAA A A A A A LastName= B B B B B BBB NextName= C CFirstName=AA A A A A -- 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] ICS V6 Http Post problem
Already asked this in the borland newsgroup but was advised to asked it here again. I use v6 latest beta and if I do a asyncpost wiht some long parameters like Para1= para2=b para3=..(about 1600 chars) I will see something else with a sniffer Para1= para2=b para3=..( only a part of them) Para1= para2=b para3=..(again a part of them) Anyone with a hint how to solve this.? Frans -- 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