Problem with Webdav, dCache (5.32.00)

Dear Rooters,
we are using Webdav as implemented in WebDav dCache production-1.9.12-15
With command “wget” it works as expected.
Using it from root (Version 5.32.00 on Ubuntu 10.04) things go wrong.

TFile * f = TFile::Open("http://lcg-lrz-dc48.grid.lrz-muenchen.de/...

To get it work I made the following mods in TWebFile.cxx: (see att svn diff)

In SetMsgReadBuffer10:

Add the query string (the stuff after ?) again to Url:

      fBasicUrl += fUrl.GetFile();
      TString rdl(redirectLocation);
      if (rdl.Index("?") >= 0) {
      rdl = rdl(rdl.Index("?"), rdl.Length());
         fBasicUrl += rdl;
      }

In GetFromWeb10:

replace the input argument msg (which still has the door node dc48) by
the redirect URL (now with dc14) and add to Range field: 
  Range: bytes= 
    the value 0-3
       if (redirect) {
            ws.ReOpen();
            TString msg_1 = fMsgReadBuffer10;   // now with redirect node
            msg_1 += fOffset;
            msg_1 += "-";
            msg_1 += fOffset+len-1;
            msg_1 += "\r\n\r\n";
            return GetFromWeb10(buf, len, msg_1 );
      }

Treat return code 302 as permanent to avoid switching back to
to door node in SetMsgReadBuffer10

             else if (code == 302 || code == 307)
               // Otto: treat 302 as 303: permanent redirect
               redirect = 1;
               //redirect = 2;   // temp redirect
             else {

No guarantee however that these mods are correct in general.
May be somebody else understands this better than I do.

Cheers
Otto
twebfile.diff (1.46 KB)

Hi Otto,

To better track this patch, I submitted via Savannah at savannah.cern.ch/patch/index.php?5244

Cheers,
Philippe.