indy

When does background threads prevent the process of being terminated?

99封情书 提交于 2020-01-01 09:46:09
问题 Our program creates a background thread at the beginning of the program. The background thread does some database integrity checks and checks for stuff in the Internet using Indy. After 10 seconds, the background thread should be finished and since FreeOnTerminate is true, it will also clean itself up. We have noticed that in some cases, if the user closes the program too quickly, the process will still be alive until the background thread is finished. Since we couldn't exactly reproduce the

How do I send e-mail using Gmail's SMTP and Indy 10?

本秂侑毒 提交于 2020-01-01 05:40:14
问题 I'm using Delphi 2009 and the lastest Indy 10 from svn to send e-mails using SMTP, but it doesn't work with Gmail (Google Apps hosted domain). When I try to send an e-mail I get "Must issue a STARTTLS command first". I tried Googling about it and I found several forums and several solutions, but they all just bashed some code or just said I needed an OpenSLL DLL, which so far isn't very clear to me exactly what I need. Can someone please tell exactly which DLL I need and what do I have to

Getting Cookie from TWebBrowser

左心房为你撑大大i 提交于 2019-12-31 05:09:58
问题 Trying to download a file using indy,(post to asp save the excel response) but running into errors, using wireshark the request is missing cookies. Trying to grab the cookie out of a Twebbrowser window and save it. procedure TForm1.WebBrowser1DownloadComplete(Sender: TObject); var document: IHTMLDocument2; cookies:tstringlist; begin cookies:=tstringlist.Create; document := WebBrowser1.Document as IHTMLDocument2; cookies.Add(document.cookie); //do stuff with them end; returns nothing, whats

Create video streaming server in indy

风格不统一 提交于 2019-12-31 03:58:10
问题 I am trying to create video streaming server using Indy Http server. I am using ranged requests to send large files. One chunk of data is 10 Mb long. If video file which requests client is smaller than 10 Mb then it is all ok and vido is played. But if file size is longer than 10 Mb I return first chunk of data. Then client asks me for another chunk of data from the end of file and then my client says that it is unrecognizable video format. Can someone tell me where is problem in my code. my

TCPserver without OnExecute event

情到浓时终转凉″ 提交于 2019-12-30 07:00:09
问题 I want to make a TCPserver and send/receive message to clients as needed , not OnExecute event of the TCPserver. Send/receive message is not a problem; I do like that: procedure TFormMain.SendMessage(IP, Msg: string); var I: Integer; begin with TCPServer.Contexts.LockList do try for I := 0 to Count-1 do if TIdContext(Items[I]).Connection.Socket.Binding.PeerIP = IP then begin TIdContext(Items[I]).Connection.IOHandler.WriteBuffer(Msg[1], Length(Msg)); // and/or Read Break; end; finally

How stop (cancel) a download using TIdHTTP

血红的双手。 提交于 2019-12-30 05:13:47
问题 I'm using the TIdHTTP.Get procedure in a thread to download a file . My question is how I can stop (cancel) the download of the file? 回答1: You could use the default procedure idhttp1.Disconnect... 回答2: I would try to cancel it by throwing an silent exception using Abort method in the TIdHTTP.OnWork event. This event is fired for read/write operations, so it's fired also in your downloading progress. type TDownloadThread = class(TThread) private FIdHTTP: TIdHTTP; FCancel: boolean; procedure

Delphi 7: Handling events in console application (TidIRC)

喜你入骨 提交于 2019-12-29 08:16:09
问题 I'm trying to make a console application based on Indy's IRC Component (TIdIRC) but I'm having trouble with events. Here's my code: program Project1; {$APPTYPE CONSOLE} uses SysUtils, Classes, Math, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdIRC; type TEvents = class public procedure Raw(Sender: TObject; AUser: TIdIRCUser; ACommand, AContent: String; var Suppress: Boolean); end; const IrcServ = 'gr.irc.gr'; IrcPort = 6667; IrcChan = '#lalala'; var Irc: TidIRC; Event:

Random Indy ResponseCode = -1 / EIdSocketError Socket Error # 0 exceptions

守給你的承諾、 提交于 2019-12-29 07:52:12
问题 I have a delphi code that basically upload files to remote secure server using Indy 10.4.704 : IdHTTP := TIdHTTP.Create(nil); try TheCompressor := TIdCompressorZLib.Create(nil); TheSSL := TIdSSLIOHandlerSocketOpenSSL.Create(nil); with IdHTTP do begin HTTPOptions := [hoForceEncodeParams]; AllowCookies := True; HandleRedirects := True; ProtocolVersion := pv1_1; IOHandler := TheSSL; Compressor := TheCompressor; end; // with // Get upload resume offset try IdHttp.Head('https://www.domain.com/my

How to use a dll outside of the system path

僤鯓⒐⒋嵵緔 提交于 2019-12-28 05:33:07
问题 I made an application that uses the openssl dlls ( libeay32.dll and ssleay32.dll ). It is indy using them, I don't call the dlls directly. The simplest workaround i found to avoid an installer (i just delpoy an exe and i am ok with this approach) is to: put the dlls as resources of the exe on program start I extract them in the exe folder the exe uses them This is perfect but I would like to improve the approach by extracting the dlls in a temp folder and not on the exe folder (that in many

WWW server reports error after POST Request by Internet Direct components in Delphi

老子叫甜甜 提交于 2019-12-28 02:16:08
问题 I'm using Delphi XE4 and i usually use Indy with IdHttp.POST to POST request to websites, This time, whenever i try to POST the request i get Error: Your browser is not sending the correct data. I'm very sure that I'm POSTing the right data, and i'm using the IOHandler and CookieManager. Been dealing with this for days(literally) Here is the code(the site in the code): procedure TForm1.Button1Click(Sender: TObject); var s, lge, Kf1, Kf2, Kf3, Kf4 : String; lParam : TStringList; begin S :=