| 53 |
function ParseCgiStatus(Content: string): TCgiStatus; |
function ParseCgiStatus(Content: string): TCgiStatus; |
| 54 |
function CgiDownload(ItemType: TGikoDownloadType; URL: string; Modified: TDateTime): Boolean; |
function CgiDownload(ItemType: TGikoDownloadType; URL: string; Modified: TDateTime): Boolean; |
| 55 |
function DatDownload(ItemType: TGikoDownloadType; URL: string; Modified: TDateTime; RangeStart: Integer; AdjustLen: Integer): Boolean; |
function DatDownload(ItemType: TGikoDownloadType; URL: string; Modified: TDateTime; RangeStart: Integer; AdjustLen: Integer): Boolean; |
| 56 |
function DeleteStatusLine(Content: string): string; |
procedure DeleteStatusLine(Item: TDownloadItem); |
| 57 |
procedure InitHttpClient(client: TIdHttp); |
procedure InitHttpClient(client: TIdHttp); |
| 58 |
procedure ClearHttpClient(client: TIdHttp); |
procedure ClearHttpClient(client: TIdHttp); |
| 59 |
protected |
protected |
| 532 |
Writeln('CGIStatus: OK'); |
Writeln('CGIStatus: OK'); |
| 533 |
{$ENDIF} |
{$ENDIF} |
| 534 |
Item.ResponseCode := 200; |
Item.ResponseCode := 200; |
| 535 |
Item.Content := DeleteStatusLine(Item.Content); |
DeleteStatusLine(Item); |
|
Item.ContentLength := CgiStatus.FSize; |
|
| 536 |
end; |
end; |
| 537 |
gcsINCR: begin |
gcsINCR: begin |
| 538 |
//今はありえない |
//今はありえない |
| 540 |
Writeln('CGIStatus: 206'); |
Writeln('CGIStatus: 206'); |
| 541 |
{$ENDIF} |
{$ENDIF} |
| 542 |
Item.ResponseCode := 206; |
Item.ResponseCode := 206; |
| 543 |
Item.Content := DeleteStatusLine(Item.Content); |
DeleteStatusLine(Item); |
|
Item.ContentLength := CgiStatus.FSize; |
|
| 544 |
end; |
end; |
| 545 |
gcsERR: begin |
gcsERR: begin |
| 546 |
{$IFDEF DEBUG} |
{$IFDEF DEBUG} |
| 889 |
end; |
end; |
| 890 |
end; |
end; |
| 891 |
|
|
| 892 |
//手抜きな処理で1行目を消す |
//1行目を消して、コンテンツサイズを設定する |
| 893 |
function TDownloadThread.DeleteStatusLine(Content: string): string; |
procedure TDownloadThread.DeleteStatusLine(Item: TDownloadItem); |
| 894 |
var |
var |
| 895 |
SList: TStringList; |
SList: TStringList; |
| 896 |
begin |
begin |
| 897 |
SList := TStringList.Create; |
SList := TStringList.Create; |
| 898 |
try |
try |
| 899 |
SList.Text := Content; |
SList.Text := Item.Content; |
| 900 |
|
//1行目を削除 |
| 901 |
if SList.Count > 1 then |
if SList.Count > 1 then |
| 902 |
SList.Delete(0); |
SList.Delete(0); |
| 903 |
Result := SList.Text; |
//改行コードをCRLF -> LFと考えて、行数分だけマイナス |
| 904 |
|
Item.ContentLength := Length(SList.Text) - SList.Count; |
| 905 |
finally |
finally |
| 906 |
SList.Free; |
SList.Free; |
| 907 |
end; |
end; |