Develop and Download Open Source Software

Browse CVS Repository

Diff of /gikonavigoeson/gikonavi/ItemDownload.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.50 by h677, Sat Dec 10 11:01:53 2005 UTC revision 1.51 by h677, Fri Dec 16 17:10:38 2005 UTC
# Line 53  type Line 53  type
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
# Line 532  begin Line 532  begin
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                                                                  //今はありえない                                                                  //今はありえない
# Line 541  begin Line 540  begin
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}
# Line 891  begin Line 889  begin
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;

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26