Fossil

Diff
Login

Differences From Artifact [dac0efd367]:

To Artifact [21d0c0bc63]:


581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
**
** - uuid=the version to tar (may be a tag/branch name).
** Defaults to trunk.
**
*/
void tarball_page(void){
  int rid;
  char *zName, *zRid;
  int nName, nRid;
  Blob tarball;

  login_check_credentials();
  if( !g.perm.Zip ){ login_needed(); return; }
  load_control();
  zName = mprintf("%s", PD("name",""));







|







581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
**
** - uuid=the version to tar (may be a tag/branch name).
** Defaults to trunk.
**
*/
void tarball_page(void){
  int rid;
  char *zName, *zRid, *zKey;
  int nName, nRid;
  Blob tarball;

  login_check_credentials();
  if( !g.perm.Zip ){ login_needed(); return; }
  load_control();
  zName = mprintf("%s", PD("name",""));
612
613
614
615
616
617
618



619


620
621

622
623
624
  }
  rid = name_to_typed_rid(nRid?zRid:zName, "ci");
  if( rid==0 ){
    @ Not found
    return;
  }
  if( nRid==0 && nName>10 ) zName[10] = 0;



  tarball_of_checkin(rid, &tarball, zName);


  free( zName );
  free( zRid );

  cgi_set_content(&tarball);
  cgi_set_content_type("application/x-compressed");
}







>
>
>
|
>
>


>



612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
  }
  rid = name_to_typed_rid(nRid?zRid:zName, "ci");
  if( rid==0 ){
    @ Not found
    return;
  }
  if( nRid==0 && nName>10 ) zName[10] = 0;
  zKey = db_text(0, "SELECT '/tarball/'||uuid||'/%q' FROM blob WHERE rid=%d",zName,rid);
  blob_zero(&tarball);
  if( cache_read(&tarball, zKey)==0 ){
    tarball_of_checkin(rid, &tarball, zName);
    cache_write(&tarball, zKey);
  }
  free( zName );
  free( zRid );
  free( zKey );
  cgi_set_content(&tarball);
  cgi_set_content_type("application/x-compressed");
}