[twsocket] Need help with THttpCli
Hello, We want to reuse THttpCli after a request ends (either aborted or normal) in a MR HTTP reverse proxy. We also want to reuse non-aborted sockets so as to keep the socket open in another repository thread. Here is my logic: I first override, void __fastcall httpClient::StateChange(THttpState NewState) { if(!httpServerClient || httpServerClient-skipHTTPClientEvents) int tester = 10; else THttpCli::StateChange(NewState); } //--- void __fastcall httpClient::SetReady() { if(!httpServerClient || httpServerClient-beganDetach || httpServerClient-responseEnded) StateChange(httpReady); else THttpCli::SetReady(); } //--- void __fastcall httpClient::TriggerRequestDone() { if(!httpServerClient || httpServerClient-beganDetach || httpServerClient-responseEnded) { if(FOnRequestDone) THttpCli::FOnRequestDone(this, FRequestType, FRequestDoneError); } else THttpCli::TriggerRequestDone(); } //--- so that no more messages post after ThreadDetach();. Then I check for whether THttpCli is aborted. If it is aborted, I check if it is still connected (HTTPClient-Connected). If so, I simply delay ThreadDetach until OnSessionClosed. If not I simply abort(); and then ThreadDetach(). Now the problem is THttpCli is so much unstable in closing, it acts very unpredictably! When I reattach in another client, I mostly see it is not really threaddetach'ed! (That is after threaddetach, GetHandle is called somewhere) or sometimes the delayed threaddetach does not work. Francois, we would be happy to pay you the 70Euros/hr for 2 hours if you could write a stable reuse routine for THttpCli (and we will be donating the code). Best Regards, SZ -- 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 Bjørnar! I've not been experiencing any problem with character replacement (å-e, ä-d and ö-v) with ICS components, only Indy 9 and only when passing through ms exchange it seems, but I tried Your suggestion and it works like a charm with Indy 9! (Do You mean that You use that approach also with ICS smtp components?) Quoted printable sounds interesting as well because one of our customers report character replacing problems also with the body when sending (Indy) automated emails to a customer of theirs in Norway... Apparently all Swedish characters å, ä and ö are substituted with ?. Perhaps it is possible to use Quoted printable on the whole body? If You want you can send me the code to my private address. I must say I really like the help I've received in this forum and I would really like to be able to switch to ICS. It is sad that we couldn't solve the dll loading error that appears on some machines... Thank You very much! Best Regards Henrik -Ursprungligt meddelande- Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Bjørnar Nielsen Skickat: den 19 december 2006 17:39 Till: 'ICS support mailing' Ämne: Re: [twsocket] Freeze when using smtp after recreating itsparentform I use the same component and send norwegian, swedish and even chinese chars in the subject (but Outlook can't show chinese in the subject on my computer). Use Quoted printable or Base64 to encode special chars. Example for Base64 could be like this (C++): HtmlSmtpCli1-HdrSubject = =?utf-8?B? + Base64Encode(UTF8Encode(SubjectInputFromUserEdit-Text)) + ?=; If you have a GUI-component that can handle WideStrings, then you can have any language in the subject using the above form. First the unicode-string is UTF8-encoded, then it is Base64-encoded and I think this form can hold any possible char. If you use Quoted printable instead you would save a little space because only the char's above 126 or so is encoded, I have code for this too if you ar interested. Regards Bjørnar imagine) so I'm planning to return to Indy as long as I can solve their issue with Swedish characters in the subject. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Freeze when using smtp after recreating itsparentform
Hi Arno! ProcessExplorer: I only find two dll's that I'm not certain what they do: - detoured.dll - wxvault.dll (Embassy Trust Suite by Wave Systems. Apparently installed by default by Dell) Ethereal: I only get packages sent the first time. The second time the application hangs before anything has been sent... Best Regards Henrik -Ursprungligt meddelande- Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Arno Garrels Skickat: den 19 december 2006 16:24 Till: ICS support mailing Ämne: Re: [twsocket] Freeze when using smtp after recreating itsparentform Henrik wrote: Arno, Can you rule out that an application that has set a global hook is actually working correctly? i.e. RealVNC server injects a wm_hook.dll into each process space, if such interception was buggy one can imagine that it would hurt, ICS may be hit especially since TWSocket is being notified about socket events by window messages. View the DLLs linked to a process with ProcessExplorer: http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/Proc essExp lorer.mspx I've downloaded the application above but I don't know how too proceed. What am I looking for and how do I do to get that information in ProcessExplorer? At first, my above question has a typo, it should read Can you rule out that an application that has set a global hook is not working correctly? Ok, start Wilfried's test app., in ProcessExplorer click on the ICS test application, the listview at the bottom will either list linked DLLs or handles, toggle the view to display DLLs. Take a closer look at any DLL that's not from Microsoft, for instance if Sygate personal firewall was running you would find a SSSensor.dll from Sygate Technologies, this is an injected DLL. Try to find it's parent application or service and stop it unless you think that test program's process space is clean (you need to restart the test application to make changes visible). It also may help to see a packet dump logged with Ethereal. It's a packet logger/analizer, it shows you exactly any byte that passes your nic. I would set a capture filter like port 25 or port 53 to only get traffic on ports 25 and 53 logged. Start the capture and run the ICS test app. unless the error happens, close the test app., the stop the capture and save the log as Ethereal/tcpdump(*.cap,*.pcap), file format libpcap to a file, upload the log somewhere and post the link here. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Freeze when using smtp after recreating itsparentform
We have now discovered that: Yes, the error do not arise when using WSocketForceLoadWinsock or having the smtp component on the main form (or creating a dummy smtp component at runtime and let it exist while the application is running). WSocketForceLoadWinsock immediately load the DLL. If you down't want that, call WSocketForceLoadWinsock the first time you send a mail. Note that loading winsock has almost no impact on a system with TCP/IP network since the DLL is already loaded into the system. Loading it for another application (yours) only map it into the application virtual memory space without really loading anything. Only the data segment is private to each application and this doesn't load anything from disk. Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Freeze when using smtp after recreating itsparentform
I'm not sure, but I think the body of the email is automaticly encoded to quoted printable (the plain text part), I think others in this list knows better than me, long time ago I coded with the mail-components. If you use html-mail, then you can encode all chars like this (C++, allthough I have not tested this encoding on the body of the mail, only the header. Remember that you need to set the content-type according to the encoding of the body of the mail): String Misc::MiscEncodeQuotedPrintable(WideString text) { wchar_t tmp; for (int i = 1; i = text.Length(); i++) { tmp = text[i]; if (tmp 126||tmp==95||tmp==61||tmp==63) { text.Delete(i,1); WideString qpID = = + AnsiString::IntToHex(tmp,2).UpperCase() ; text.Insert(qpID, i); i += qpID.Length() - 1; } } String returnString=text; return returnString; } It might be that you need to change all spaces to underscore between the for-loop and returning the text, at least if the text is in the subject you must do that. If you use this form in the subject, the use the following form String Subject = =?iso-8859-1?Q? + Misc::MiscEncodeQuotedPrintable(OP_UTF8Decode(source)) + ?=; To change the html-part of the mail, you can use this: String Misc::WideStringToHTMLEncoding(WideString html) { wchar_t tmp; for (int i = 1; i = html.Length(); i++) { tmp = html[i]; if (tmp 126) { html.Delete(i,1); WideString htmlID = # + String(tmp) + ;; html.Insert(htmlID, i); i += htmlID.Length() - 1; } } String ret = html; return ret; } This form can hold any possible char in html. Regards Bjørnar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Henrik Sent: 21. desember 2006 15:55 To: 'ICS support mailing' Subject: Re: [twsocket] Freeze when using smtp after recreating itsparentform Hi Bjørnar! I've not been experiencing any problem with character replacement (å-e, ä-d and ö-v) with ICS components, only Indy 9 and only when passing through ms exchange it seems, but I tried Your suggestion and it works like a charm with Indy 9! (Do You mean that You use that approach also with ICS smtp components?) Quoted printable sounds interesting as well because one of our customers report character replacing problems also with the body when sending (Indy) automated emails to a customer of theirs in Norway... Apparently all Swedish characters å, ä and ö are substituted with ?. Perhaps it is possible to use Quoted printable on the whole body? If You want you can send me the code to my private address. I must say I really like the help I've received in this forum and I would really like to be able to switch to ICS. It is sad that we couldn't solve the dll loading error that appears on some machines... Thank You very much! Best Regards Henrik -Ursprungligt meddelande- Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Bjørnar Nielsen Skickat: den 19 december 2006 17:39 Till: 'ICS support mailing' Ämne: Re: [twsocket] Freeze when using smtp after recreating itsparentform I use the same component and send norwegian, swedish and even chinese chars in the subject (but Outlook can't show chinese in the subject on my computer). Use Quoted printable or Base64 to encode special chars. Example for Base64 could be like this (C++): HtmlSmtpCli1-HdrSubject = =?utf-8?B? + Base64Encode(UTF8Encode(SubjectInputFromUserEdit-Text)) + ?=; If you have a GUI-component that can handle WideStrings, then you can have any language in the subject using the above form. First the unicode-string is UTF8-encoded, then it is Base64-encoded and I think this form can hold any possible char. If you use Quoted printable instead you would save a little space because only the char's above 126 or so is encoded, I have code for this too if you ar interested. Regards Bjørnar imagine) so I'm planning to return to Indy as long as I can solve their issue with Swedish characters in the subject. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Freeze when using smtp after recreating itsparentform
Here some more hits on WXVAULT.DLL and Embassy software. We found that the crash during the splash screen loading in AC10 on a Dell Precision 390 was caused the presence of wxvault.dll. The solution is to remove the EMBASSY software that McAfee depends on. I don't think it will disturb your AV or firewall, but it seems to disrupt the spamkiller. Well, I solved the problem. I ran the Dependency Walker utility and | profiled the WKSDB.EXE application, and it started right up. The DW | log indicated that there were failures/conflicts/whatever with a | module called WXVAULT.DLL, which is a part of the Embassy Security | Center that came installed on my new laptop, courtesy of the good | people at Dell. The Embassy software is 139 MB of security overkill | that I can't understand, much less use; so I uninstalled it and | re-started my computer. And VOILA! The Works database program fired | right up! Henrik wrote: Hi Arno! ProcessExplorer: I only find two dll's that I'm not certain what they do: - detoured.dll - wxvault.dll (Embassy Trust Suite by Wave Systems. Apparently installed by default by Dell) Ethereal: I only get packages sent the first time. The second time the application hangs before anything has been sent... Best Regards Henrik -Ursprungligt meddelande- Från: [EMAIL PROTECTED] [mailto:twsocket- [EMAIL PROTECTED] För Arno Garrels Skickat: den 19 december 2006 16:24 Till: ICS support mailing Ämne: Re: [twsocket] Freeze when using smtp after recreating itsparentform Henrik wrote: Arno, Can you rule out that an application that has set a global hook is actually working correctly? i.e. RealVNC server injects a wm_hook.dll into each process space, if such interception was buggy one can imagine that it would hurt, ICS may be hit especially since TWSocket is being notified about socket events by window messages. View the DLLs linked to a process with ProcessExplorer: http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/Proc essExp lorer.mspx I've downloaded the application above but I don't know how too proceed. What am I looking for and how do I do to get that information in ProcessExplorer? At first, my above question has a typo, it should read Can you rule out that an application that has set a global hook is not working correctly? Ok, start Wilfried's test app., in ProcessExplorer click on the ICS test application, the listview at the bottom will either list linked DLLs or handles, toggle the view to display DLLs. Take a closer look at any DLL that's not from Microsoft, for instance if Sygate personal firewall was running you would find a SSSensor.dll from Sygate Technologies, this is an injected DLL. Try to find it's parent application or service and stop it unless you think that test program's process space is clean (you need to restart the test application to make changes visible). It also may help to see a packet dump logged with Ethereal. It's a packet logger/analizer, it shows you exactly any byte that passes your nic. I would set a capture filter like port 25 or port 53 to only get traffic on ports 25 and 53 logged. Start the capture and run the ICS test app. unless the error happens, close the test app., the stop the capture and save the log as Ethereal/tcpdump(*.cap,*.pcap), file format libpcap to a file, upload the log somewhere and post the link here. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] Fw: TFtpCli
- Original Message - From: Äèìà Èãàåâ [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 21, 2006 4:33 PM Subject: TFtpCli Dear, Arno Garrels. I need to install a component TFtpCli to handle with FTP via C++ Builder 6. While installing ICSBCB60.bpk package some errors occurs. Here they are: [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::~TCustomOutline()' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::TCustomOutline(Classes::TComponent *)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::SetOutlineStyle(Outline::TOutlineStyle)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::SetOutlineOptions(System::SetOutline::TOutlineOption, 0, 2)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::GetPicture(int)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::SetPicture(int, Graphics::TBitmap *)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TOutlineNode::GetFullPath()' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TOutlineNode::HasChildren()' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TOutlineNode::getFirstChild()' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TOutlineNode::GetNextChild(int)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::Insert(int, const System::AnsiString)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TOutlineNode::GetLastChild()' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::Add(int, const System::AnsiString)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::AddChild(int, const System::AnsiString)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::Get(int)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::Clear()' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TOutlineNode::SetExpandedState(bool)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::SetSelectedItem(int)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::Click()' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::GetSelectedItem()' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::Expand(int)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::Loaded()' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external 'Outline::TCustomOutline::' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::DefineProperties(Classes::TFiler *)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::DrawCell(int, int, const Types::TRect, System::SetGrids::Grids__3, 0, 2)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__tpdsc__ Outline::TCustomOutline' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::SetItemHeight(int)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::StoreBitmap(int)' referenced from C:\CB6\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp [Linker Error] Unresolved external '__fastcall
[twsocket] q1) Doing udp communications through firewalls... q2) relaying
Hi List, I've been using ICS for a number of years and I've found it to be quite good. I like the model and the stability. But I have to questions Q1) Has anybody on the list experience with going machine-machine over the internet directly with UDP? as in STUN (i believe) Q2) I have a custom Jabber like server which we want to adapt for mass notifications to a set of connected clients. Are there any existing like implentations perhaps open-source? Regards David Lyon PreisShare -- 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