Fossil

Check-in [a921be7b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the sync logic so that it is able to clone against the canonical fossil repository with its implied redirect.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:a921be7b51aed1926c22a0562c57763be86857cb
User & Date: drh 2010-11-06 14:04:28
Context
2010-11-06
19:04
Add the -R option to the ticket command. check-in: 6dd81a54 user: wolfgang tags: trunk
16:57
merge from trunk check-in: 3ea66260 user: wolfgang tags: StvPrivateHook2
14:04
Fix the sync logic so that it is able to clone against the canonical fossil repository with its implied redirect. check-in: a921be7b user: drh tags: trunk
13:52
Change the anonymous login cookie name to include a hash of the base URL. Ticket [3edef69bf3e995ed2] check-in: 9dd6c431 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/http.c.

   101    101     blob_zero(pHdr);
   102    102     i = strlen(g.urlPath);
   103    103     if( i>0 && g.urlPath[i-1]=='/' ){
   104    104       zSep = "";
   105    105     }else{
   106    106       zSep = "/";
   107    107     }
   108         -  blob_appendf(pHdr, "POST %s%sxfer HTTP/1.0\r\n", g.urlPath, zSep);
          108  +  blob_appendf(pHdr, "POST %s%sxfer/xfer HTTP/1.0\r\n", g.urlPath, zSep);
   109    109     if( g.urlProxyAuth ){
   110    110       blob_appendf(pHdr, "Proxy-Authorization: %s\n", g.urlProxyAuth);
   111    111     }
   112    112     blob_appendf(pHdr, "Host: %s\r\n", g.urlHostname);
   113    113     blob_appendf(pHdr, "User-Agent: Fossil/" MANIFEST_VERSION "\r\n");
   114    114     if( g.fHttpTrace ){
   115    115       blob_appendf(pHdr, "Content-Type: application/x-fossil-debug\r\n");
................................................................................
   224    224           closeConnection = 0;
   225    225         }
   226    226       }else if( rc==302 && strncasecmp(zLine, "location:", 9)==0 ){
   227    227         int i, j;
   228    228         for(i=9; zLine[i] && zLine[i]==' '; i++){}
   229    229         if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine);
   230    230         j = strlen(zLine) - 1; 
   231         -      if( j>4 && strcmp(&zLine[j-4],"/xfer")==0 ) zLine[j-4] = 0;
          231  +      while( j>4 && strcmp(&zLine[j-4],"/xfer")==0 ){
          232  +         j -= 4;
          233  +         zLine[j] = 0;
          234  +      }
   232    235         fossil_print("redirect to %s\n", &zLine[i]);
   233    236         url_parse(&zLine[i]);
   234    237         transport_close();
   235    238         http_exchange(pSend, pReply, useLogin);
   236    239         return;
   237    240       }else if( strncasecmp(zLine, "content-type: text/html", 23)==0 ){
   238    241         isError = 1;