Fossil

Check-in [99053ab1]
Login

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

Overview
Comment:Detect infinite loops in the DELTA table and abort out of content_get() when they are found. Fix an off-by-one error in the version-3 clone protocol. This error might cause an incomplete and corrupt clone if a transfer block fills up just before sending the very last blob. Backport of fixes from 2012-08-23 21:15:36
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-1.19
Files: files | file ages | folders
SHA1: 99053ab14108599b4a89cacb47530e44b779004c
User & Date: drh 2012-11-14 20:28:38
Original Comment: Detect infinite loops in the DELTA table and abort out of content_get() when they are found. Fix an off-by-one error in the version-3 clone protocol. This error might cause an incomplete and corrupt clone if a transfer block fills up just before sending the very last blob. Backport of fixes from 2012-08-23 23:15:36
Context
2012-11-17
19:22
Prevent delta loops on sync operations that might otherwise occur if a sequence of file changes ends with a file back to its original state after a sequence of two or more intermediate states. The is a backport/cherrypick of check-in [141b990722ea81e10e5] Closed-Leaf check-in: 285eeba6 user: drh tags: branch-1.19
2012-11-14
20:28
Detect infinite loops in the DELTA table and abort out of content_get() when they are found. Fix an off-by-one error in the version-3 clone protocol. This error might cause an incomplete and corrupt clone if a transfer block fills up just before sending the very last blob. Backport of fixes from 2012-08-23 21:15:36 check-in: 99053ab1 user: drh tags: branch-1.19
2012-11-06
19:47
Make sure that pending deletes from "fossil rm" operations are preserved across a "fossil update". check-in: 76c6f8fc user: drh tags: branch-1.19
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/content.c.

267
268
269
270
271
272
273



274
275
276
277
278
279
280
    a[0] = rid;
    a[1] = nextRid;
    n = 1;
    while( !bag_find(&contentCache.inCache, nextRid)
        && (nextRid = findSrcid(nextRid))>0 ){
      n++;
      if( n>=nAlloc ){



        nAlloc = nAlloc*2 + 10;
        a = fossil_realloc(a, nAlloc*sizeof(a[0]));
      }
      a[n] = nextRid;
    }
    mx = n;
    rc = content_get(a[n], pBlob);







>
>
>







267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
    a[0] = rid;
    a[1] = nextRid;
    n = 1;
    while( !bag_find(&contentCache.inCache, nextRid)
        && (nextRid = findSrcid(nextRid))>0 ){
      n++;
      if( n>=nAlloc ){
        if( n>db_int(0, "SELECT max(rid) FROM blob") ){
          fossil_panic("infinite loop in DELTA table");
        }
        nAlloc = nAlloc*2 + 10;
        a = fossil_realloc(a, nAlloc*sizeof(a[0]));
      }
      a[n] = nextRid;
    }
    mx = n;
    rc = content_get(a[n], pBlob);

Changes to src/xfer.c.

992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
          if( iVers>=3 ){
            send_compressed_file(&xfer, seqno);
          }else{
            send_file(&xfer, seqno, 0, 1);
          }
          seqno++;
        }
        if( seqno>=max ) seqno = 0;
        @ clone_seqno %d(seqno)
      }else{
        isClone = 1;
        isPull = 1;
        deltaFlag = 1;
      }
      @ push %s(db_get("server-code", "x")) %s(db_get("project-code", "x"))







|







992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
          if( iVers>=3 ){
            send_compressed_file(&xfer, seqno);
          }else{
            send_file(&xfer, seqno, 0, 1);
          }
          seqno++;
        }
        if( seqno>max ) seqno = 0;
        @ clone_seqno %d(seqno)
      }else{
        isClone = 1;
        isPull = 1;
        deltaFlag = 1;
      }
      @ push %s(db_get("server-code", "x")) %s(db_get("project-code", "x"))