| 5 |
uses |
uses |
| 6 |
Windows, Classes, SysUtils, Menus, |
Windows, Classes, SysUtils, Menus, |
| 7 |
IdHTTP, IdComponent, IdGlobal, IdException, |
IdHTTP, IdComponent, IdGlobal, IdException, |
| 8 |
AbonUnit; |
AbonUnit, IdAntiFreezeBase; |
| 9 |
|
|
| 10 |
type |
type |
| 11 |
|
|
| 242 |
LIVEDOOR_URL = 'http://jbbs.livedoor.jp/'; |
LIVEDOOR_URL = 'http://jbbs.livedoor.jp/'; |
| 243 |
begin |
begin |
| 244 |
|
|
| 245 |
|
|
| 246 |
{$IFDEF DEBUG} |
{$IFDEF DEBUG} |
| 247 |
Writeln('ExternalBoardManager.InternalDownload'); |
Writeln('ExternalBoardManager.InternalDownload'); |
| 248 |
{$ENDIF} |
{$ENDIF} |
| 268 |
{$IFDEF DEBUG} |
{$IFDEF DEBUG} |
| 269 |
Writeln('URL: ' + inURL); |
Writeln('URL: ' + inURL); |
| 270 |
{$ENDIF} |
{$ENDIF} |
| 271 |
socket.Get( inURL, resStream ); |
//板更新が、フックしている間は、Getしようとすると |
| 272 |
|
//無限ループする |
| 273 |
|
if GAntiFreeze = nil then begin |
| 274 |
|
socket.Get( inURL, resStream ); |
| 275 |
|
end else begin |
| 276 |
|
Result := 503; |
| 277 |
|
end; |
| 278 |
{$IFDEF DEBUG} |
{$IFDEF DEBUG} |
| 279 |
Writeln('取得で例外なし'); |
Writeln('取得で例外なし'); |
| 280 |
{$ENDIF} |
{$ENDIF} |
| 286 |
Result := socket.ResponseCode; |
Result := socket.ResponseCode; |
| 287 |
if (Length( content ) = 0) and (Result = 206) then |
if (Length( content ) = 0) and (Result = 206) then |
| 288 |
Result := 304; |
Result := 304; |
| 289 |
//したらばJBBSはヘッダにエラー情報が載るらしいので、ここでチェック |
//したらばJBBSはヘッダにエラー情報が載るらしいので、ここでチェック |
| 290 |
if ( AnsiPos(LIVEDOOR_URL, inURL) > 0 ) and (Result = 200) then begin |
if ( AnsiPos(LIVEDOOR_URL, inURL) > 0 ) and (Result = 200) then begin |
| 291 |
if( AnsiPos('STORAGE IN', socket.Response.RawHeaders.Text) > 0 ) then begin |
if( AnsiPos('STORAGE IN', socket.Response.RawHeaders.Text) > 0 ) then begin |
| 292 |
Result := 302; |
Result := 302; |