Fossil

Check-in [53a2824e]
Login

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

Overview
Comment:Improvements to the way that hash name aliases are detected in the content_put_ex() routine.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fossil-2.0
Files: files | file ages | folders
SHA1:53a2824ec031547afe8e43174762f0d25b6ee67d
User & Date: drh 2017-03-01 14:55:35
Context
2017-03-01
15:09
Do not create the ALIAS table as it turns out not to be needed. check-in: 3259aa54 user: drh tags: fossil-2.0
14:55
Improvements to the way that hash name aliases are detected in the content_put_ex() routine. check-in: 53a2824e user: drh tags: fossil-2.0
14:10
Check for name aliases when committing. Use SHA3 hashes if the version number is 2.1 or higher. check-in: 104c8d34 user: drh tags: fossil-2.0
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/content.c.

514
515
516
517
518
519
520


521
522



523
524
525
526
527
528

529
530
531
532
533
534
535

  assert( g.repositoryOpen );
  assert( pBlob!=0 );
  assert( srcId==0 || zUuid!=0 );
  db_begin_transaction();
  if( zUuid==0 ){
    assert( nBlob==0 );


    hname_hash(pBlob, 1, &hash);
    rid = fast_uuid_to_rid(blob_str(&hash));



    blob_reset(&hash);
    if( rid ){
      db_end_transaction(0);
      return rid;
    }
    hname_hash(pBlob, 0, &hash);

  }else{
    blob_init(&hash, zUuid, -1);
  }
  if( nBlob ){
    size = nBlob;
  }else{
    size = blob_size(pBlob);







>
>


>
>
>
|
<
<
<
<
|
>







514
515
516
517
518
519
520
521
522
523
524
525
526
527
528




529
530
531
532
533
534
535
536
537

  assert( g.repositoryOpen );
  assert( pBlob!=0 );
  assert( srcId==0 || zUuid!=0 );
  db_begin_transaction();
  if( zUuid==0 ){
    assert( nBlob==0 );
    /* First check the auxiliary hash to see if there is already an artifact
    ** that uses the auxiliary hash name */
    hname_hash(pBlob, 1, &hash);
    rid = fast_uuid_to_rid(blob_str(&hash));
    if( rid==0 ){
      /* No existing artifact with the auxiliary hash name.  Therefore, use
      ** the primary hash name. */
      blob_reset(&hash);




      hname_hash(pBlob, 0, &hash);
    }
  }else{
    blob_init(&hash, zUuid, -1);
  }
  if( nBlob ){
    size = nBlob;
  }else{
    size = blob_size(pBlob);