Changes between Initial Version and Version 5 of Ticket #4365


Ignore:
Timestamp:
Dec 4, 2011, 6:56:52 AM (11 years ago)
Author:
etourigny
Comment:

I get the response code 225 (Data connection open, no transfer in progress.), in function VSICurlHandle::DownloadRegion, line 659: curl_easy_getinfo(hCurlHandle, CURLINFO_HTTP_CODE, &response_code);

Adding test for that response code seems to work, although the transfer is longer than http (more latency I guess).

in ftp mode: VSICURL: Got reponse_code=225 content_type=[(null)]

in http mode: VSICURL: Got reponse_code=206 content_type=[image/tiff]

Even, can you test this in your system, and see what response code you get?

code:

    long response_code = 0;
    curl_easy_getinfo(hCurlHandle, CURLINFO_HTTP_CODE, &response_code);

    char *content_type = 0;
    curl_easy_getinfo(hCurlHandle, CURLINFO_CONTENT_TYPE, &content_type);

+    if (ENABLE_DEBUG)
+        CPLDebug("VSICURL", "Got reponse_code=%ld content_type=[%s]", response_code, content_type);

+    if ((response_code != 200 && response_code != 206 &&
+        response_code != 226 && response_code != 426 && response_code != 225) || sWriteFuncHeaderData.bError)
-    if ((response_code != 200 && response_code != 206 &&
-        response_code != 226 && response_code != 426) || sWriteFuncHeaderData.bError)
    {

output after fix:

$ gdalinfo --debug on /vsicurl/ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif
VSICURL: GetFileList(/vsicurl/ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif)
VSICURL: File[0] = MCR2010_01.tif, is_dir = 0, size = 82943228, time = 2009/10/01 00:00:00
VSICURL: File[1] = MCR2010_tif.zip, is_dir = 0, size = 80196041, time = 2009/10/08 00:00:00
VSICURL: Downloading 0-16383 (ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif)...
VSICURL: Got reponse_code=225 content_type=[(null)]
VSICURL: Downloading 16384-32767 (ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif)...
VSICURL: Got reponse_code=225 content_type=[(null)]
VSICURL: Downloading 32768-65535 (ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif)...
VSICURL: Got reponse_code=225 content_type=[(null)]
GDAL: GDALOpen(/vsicurl/ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif, this=0x18dfc80) succeeds as GTiff.
Driver: GTiff/GeoTIFF
GDAL: GDALDefaultOverviews::OverviewScan()
Files: /vsicurl/ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif
Size is 12178, 13435
Coordinate System is `'
Metadata:
  TIFFTAG_DATETIME=2009:10:01 08:12:22
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  TIFFTAG_SOFTWARE=Adobe Photoshop CS2 Windows
  TIFFTAG_XRESOLUTION=300
  TIFFTAG_YRESOLUTION=300
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,13435.0)
Upper Right (12178.0,    0.0)
Lower Right (12178.0,13435.0)
Center      ( 6089.0, 6717.5)
Band 1 Block=12178x7 Type=Byte, ColorInterp=Red
Band 2 Block=12178x7 Type=Byte, ColorInterp=Green
Band 3 Block=12178x7 Type=Byte, ColorInterp=Blue
GDAL: GDALClose(/vsicurl/ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif, this=0x18dfc80)

 $ gdalinfo --debug on /vsicurl/http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif
VSICURL: GetFileList(/vsicurl/http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif)
VSICURL: File[0] = MCR2010_01.tif, is_dir = 0, size = 0, time = 2009/10/01 13:21:00
VSICURL: File[1] = MCR2010_tif.zip, is_dir = 0, size = 0, time = 2009/10/08 16:10:00
VSICURL: Downloading 0-16383 (http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif)...
VSICURL: Got reponse_code=206 content_type=[image/tiff]
VSICURL: GetFileSize(http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif)=82943228  response_code=206
VSICURL: Downloading 16384-32767 (http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif)...
VSICURL: Got reponse_code=206 content_type=[image/tiff]
VSICURL: Downloading 32768-65535 (http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif)...
VSICURL: Got reponse_code=206 content_type=[image/tiff]
GDAL: GDALOpen(/vsicurl/http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif, this=0x198e450) succeeds as GTiff.
Driver: GTiff/GeoTIFF
GDAL: GDALDefaultOverviews::OverviewScan()
Files: /vsicurl/http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif
Size is 12178, 13435
Coordinate System is `'
Metadata:
  TIFFTAG_DATETIME=2009:10:01 08:12:22
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  TIFFTAG_SOFTWARE=Adobe Photoshop CS2 Windows
  TIFFTAG_XRESOLUTION=300
  TIFFTAG_YRESOLUTION=300
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,13435.0)
Upper Right (12178.0,    0.0)
Lower Right (12178.0,13435.0)
Center      ( 6089.0, 6717.5)
Band 1 Block=12178x7 Type=Byte, ColorInterp=Red
Band 2 Block=12178x7 Type=Byte, ColorInterp=Green
Band 3 Block=12178x7 Type=Byte, ColorInterp=Blue
GDAL: GDALClose(/vsicurl/http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif, this=0x198e450)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4365

    • Property Status newreopened
    • Property Cc Even Rouault added
  • Ticket #4365 – Description

    initial v5  
    2525GDAL: GDALOpen(/vsicurl/http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif, this=0xf3b450) succeeds as GTiff.
    2626Driver: GTiff/GeoTIFF
     27 gdalinfo --debug on /vsicurl/ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif
     28VSICURL: GetFileList(/vsicurl/ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif)
     29VSICURL: File[0] = MCR2010_01.tif, is_dir = 0, size = 82943228, time = 2009/10/01 00:00:00
     30VSICURL: File[1] = MCR2010_tif.zip, is_dir = 0, size = 80196041, time = 2009/10/08 00:00:00
     31VSICURL: Downloading 0-16383 (ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif)...
     32VSICURL: Got reponse_code=225 content_type=[(null)]
     33VSICURL: Downloading 16384-32767 (ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif)...
     34VSICURL: Got reponse_code=225 content_type=[(null)]
     35VSICURL: Downloading 32768-65535 (ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif)...
     36VSICURL: Got reponse_code=225 content_type=[(null)]
     37GDAL: GDALOpen(/vsicurl/ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif, this=0x18dfc80) succeeds as GTiff.
     38Driver: GTiff/GeoTIFF
     39GDAL: GDALDefaultOverviews::OverviewScan()
     40Files: /vsicurl/ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif
     41Size is 12178, 13435
     42Coordinate System is `'
     43Metadata:
     44  TIFFTAG_DATETIME=2009:10:01 08:12:22
     45  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
     46  TIFFTAG_SOFTWARE=Adobe Photoshop CS2 Windows
     47  TIFFTAG_XRESOLUTION=300
     48  TIFFTAG_YRESOLUTION=300
     49Image Structure Metadata:
     50  COMPRESSION=LZW
     51  INTERLEAVE=PIXEL
     52Corner Coordinates:
     53Upper Left  (    0.0,    0.0)
     54Lower Left  (    0.0,13435.0)
     55Upper Right (12178.0,    0.0)
     56Lower Right (12178.0,13435.0)
     57Center      ( 6089.0, 6717.5)
     58Band 1 Block=12178x7 Type=Byte, ColorInterp=Red
     59Band 2 Block=12178x7 Type=Byte, ColorInterp=Green
     60Band 3 Block=12178x7 Type=Byte, ColorInterp=Blue
     61GDAL: GDALClose(/vsicurl/ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif, this=0x18dfc80)
     62
     63$ gdalinfo --debug on /vsicurl/http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif
     64VSICURL: GetFileList(/vsicurl/http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif)
     65VSICURL: File[0] = MCR2010_01.tif, is_dir = 0, size = 0, time = 2009/10/01 13:21:00
     66VSICURL: File[1] = MCR2010_tif.zip, is_dir = 0, size = 0, time = 2009/10/08 16:10:00
     67VSICURL: Downloading 0-16383 (http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif)...
     68VSICURL: Got reponse_code=206 content_type=[image/tiff]
     69VSICURL: GetFileSize(http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif)=82943228  response_code=206
     70VSICURL: Downloading 16384-32767 (http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif)...
     71VSICURL: Got reponse_code=206 content_type=[image/tiff]
     72VSICURL: Downloading 32768-65535 (http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif)...
     73VSICURL: Got reponse_code=206 content_type=[image/tiff]
     74GDAL: GDALOpen(/vsicurl/http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif, this=0x198e450) succeeds as GTiff.
     75Driver: GTiff/GeoTIFF
     76GDAL: GDALDefaultOverviews::OverviewScan()
     77Files: /vsicurl/http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif
     78Size is 12178, 13435
     79Coordinate System is `'
     80Metadata:
     81  TIFFTAG_DATETIME=2009:10:01 08:12:22
     82  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
     83  TIFFTAG_SOFTWARE=Adobe Photoshop CS2 Windows
     84  TIFFTAG_XRESOLUTION=300
     85  TIFFTAG_YRESOLUTION=300
     86Image Structure Metadata:
     87  COMPRESSION=LZW
     88  INTERLEAVE=PIXEL
     89Corner Coordinates:
     90Upper Left  (    0.0,    0.0)
     91Lower Left  (    0.0,13435.0)
     92Upper Right (12178.0,    0.0)
     93Lower Right (12178.0,13435.0)
     94Center      ( 6089.0, 6717.5)
     95Band 1 Block=12178x7 Type=Byte, ColorInterp=Red
     96Band 2 Block=12178x7 Type=Byte, ColorInterp=Green
     97Band 3 Block=12178x7 Type=Byte, ColorInterp=Blue
     98GDAL: GDALClose(/vsicurl/http://ftp2.cits.rncan.gc.ca/pub/cantopo/250k_tif/MCR2010_01.tif, this=0x198e450)
    2799
    28100}}}