Skip to content

Commit

Permalink
remove: dirty method to break connection on timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
riderkick committed Jul 4, 2015
1 parent 74ceed1 commit 81aae39
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
20 changes: 0 additions & 20 deletions baseunits/uBaseUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -820,11 +820,8 @@ TParseHTML = class
THTTPSendThread = class(THTTPSend)
protected
FOwner: TFMDThread;
FTimeoutCount: Integer;
procedure CloseConnection(SendTerminateTag: Boolean = True);
procedure SockOnHeartBeat(Sender: TObject);
procedure SockOnStatus(Sender: TObject; Reason: THookSocketReason;
const Value: String);
public
constructor Create(AOwner: TFMDThread);
end;
Expand Down Expand Up @@ -2884,7 +2881,6 @@ function GetPage(const AHTTP: THTTPSend; var output: TObject; URL: String;
Inc(Counter);
HTTPClear;
HTTP.Headers.Text := HTTPHeader.Text;
Sleep(500);
end;

counter := 0;
Expand Down Expand Up @@ -3447,27 +3443,11 @@ procedure THTTPSendThread.SockOnHeartBeat(Sender: TObject);
if Assigned(FOwner) then
if FOwner.IsTerminated then
CloseConnection;
if FTimeout > 0 then
begin
if FTimeoutCount >= FTimeout then
CloseConnection(False)
else
Inc(FTimeoutCount, Sock.HeartbeatRate);
end;
end;

procedure THTTPSendThread.SockOnStatus(Sender: TObject;
Reason: THookSocketReason; const Value: String);
begin
if (FTimeout > 0) and (Reason = HR_SocketClose) then
FTimeoutCount := 0;
end;

constructor THTTPSendThread.Create(AOwner: TFMDThread);
begin
inherited Create;
FTimeoutCount := 0;
Sock.OnStatus := SockOnStatus;
if Assigned(AOwner) then
begin
FOwner := TFMDThread(AOwner);
Expand Down
1 change: 1 addition & 0 deletions mangadownloader/languages/fmd.id_ID.po
Original file line number Diff line number Diff line change
Expand Up @@ -1621,3 +1621,4 @@ msgstr "Sinkronisasi data"
#: uupdatethread.rs_updatinglist
msgid "Updating list"
msgstr "Memperbarui daftar"

0 comments on commit 81aae39

Please sign in to comment.