Fossil SCM

According to RFC 1952, MTIME=0 means no time stamp is available

jan.nijtmans 2013-12-22 10:21 trunk
Commit 518896951a500e3e819c1dee76cdc168376f5a70
3 files changed +1 -4 +2 -2 +1 -1
+1 -4
--- src/cgi.c
+++ src/cgi.c
@@ -360,14 +360,11 @@
360360
}
361361
362362
if( iReplyStatus != 304 ) {
363363
if( is_gzippable() ){
364364
int i;
365
- /* Using an arbitrary constant argument for gzip_begin() so the same
366
- ** input always results in the same gzipped output.
367
- **/
368
- gzip_begin(1);
365
+ gzip_begin(0);
369366
for( i=0; i<2; i++ ){
370367
int size = blob_size(&cgiContent[i]);
371368
if( size>0 ) gzip_step(blob_buffer(&cgiContent[i]), size);
372369
blob_reset(&cgiContent[i]);
373370
}
374371
--- src/cgi.c
+++ src/cgi.c
@@ -360,14 +360,11 @@
360 }
361
362 if( iReplyStatus != 304 ) {
363 if( is_gzippable() ){
364 int i;
365 /* Using an arbitrary constant argument for gzip_begin() so the same
366 ** input always results in the same gzipped output.
367 **/
368 gzip_begin(1);
369 for( i=0; i<2; i++ ){
370 int size = blob_size(&cgiContent[i]);
371 if( size>0 ) gzip_step(blob_buffer(&cgiContent[i]), size);
372 blob_reset(&cgiContent[i]);
373 }
374
--- src/cgi.c
+++ src/cgi.c
@@ -360,14 +360,11 @@
360 }
361
362 if( iReplyStatus != 304 ) {
363 if( is_gzippable() ){
364 int i;
365 gzip_begin(0);
 
 
 
366 for( i=0; i<2; i++ ){
367 int size = blob_size(&cgiContent[i]);
368 if( size>0 ) gzip_step(blob_buffer(&cgiContent[i]), size);
369 blob_reset(&cgiContent[i]);
370 }
371
+2 -2
--- src/gzip.c
+++ src/gzip.c
@@ -55,11 +55,11 @@
5555
blob_zero(&gzip.out);
5656
aHdr[0] = 0x1f;
5757
aHdr[1] = 0x8b;
5858
aHdr[2] = 8;
5959
aHdr[3] = 0;
60
- if( now==0 ){
60
+ if( now==-1 ){
6161
now = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0");
6262
}
6363
put32(&aHdr[4], now&0xffffffff);
6464
aHdr[8] = 2;
6565
aHdr[9] = 255;
@@ -126,15 +126,15 @@
126126
void test_gzip_cmd(void){
127127
Blob b;
128128
char *zOut;
129129
if( g.argc!=3 ) usage("FILENAME");
130130
sqlite3_open(":memory:", &g.db);
131
- gzip_begin(0);
131
+ gzip_begin(-1);
132132
blob_read_from_file(&b, g.argv[2]);
133133
zOut = mprintf("%s.gz", g.argv[2]);
134134
gzip_step(blob_buffer(&b), blob_size(&b));
135135
blob_reset(&b);
136136
gzip_finish(&b);
137137
blob_write_to_file(&b, zOut);
138138
blob_reset(&b);
139139
fossil_free(zOut);
140140
}
141141
--- src/gzip.c
+++ src/gzip.c
@@ -55,11 +55,11 @@
55 blob_zero(&gzip.out);
56 aHdr[0] = 0x1f;
57 aHdr[1] = 0x8b;
58 aHdr[2] = 8;
59 aHdr[3] = 0;
60 if( now==0 ){
61 now = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0");
62 }
63 put32(&aHdr[4], now&0xffffffff);
64 aHdr[8] = 2;
65 aHdr[9] = 255;
@@ -126,15 +126,15 @@
126 void test_gzip_cmd(void){
127 Blob b;
128 char *zOut;
129 if( g.argc!=3 ) usage("FILENAME");
130 sqlite3_open(":memory:", &g.db);
131 gzip_begin(0);
132 blob_read_from_file(&b, g.argv[2]);
133 zOut = mprintf("%s.gz", g.argv[2]);
134 gzip_step(blob_buffer(&b), blob_size(&b));
135 blob_reset(&b);
136 gzip_finish(&b);
137 blob_write_to_file(&b, zOut);
138 blob_reset(&b);
139 fossil_free(zOut);
140 }
141
--- src/gzip.c
+++ src/gzip.c
@@ -55,11 +55,11 @@
55 blob_zero(&gzip.out);
56 aHdr[0] = 0x1f;
57 aHdr[1] = 0x8b;
58 aHdr[2] = 8;
59 aHdr[3] = 0;
60 if( now==-1 ){
61 now = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0");
62 }
63 put32(&aHdr[4], now&0xffffffff);
64 aHdr[8] = 2;
65 aHdr[9] = 255;
@@ -126,15 +126,15 @@
126 void test_gzip_cmd(void){
127 Blob b;
128 char *zOut;
129 if( g.argc!=3 ) usage("FILENAME");
130 sqlite3_open(":memory:", &g.db);
131 gzip_begin(-1);
132 blob_read_from_file(&b, g.argv[2]);
133 zOut = mprintf("%s.gz", g.argv[2]);
134 gzip_step(blob_buffer(&b), blob_size(&b));
135 blob_reset(&b);
136 gzip_finish(&b);
137 blob_write_to_file(&b, zOut);
138 blob_reset(&b);
139 fossil_free(zOut);
140 }
141
+1 -1
--- src/tar.c
+++ src/tar.c
@@ -427,11 +427,11 @@
427427
Blob file;
428428
if( g.argc<3 ){
429429
usage("ARCHIVE FILE....");
430430
}
431431
sqlite3_open(":memory:", &g.db);
432
- tar_begin(0);
432
+ tar_begin(-1);
433433
for(i=3; i<g.argc; i++){
434434
blob_zero(&file);
435435
blob_read_from_file(&file, g.argv[i]);
436436
tar_add_file(g.argv[i], &file,
437437
file_wd_perm(g.argv[i]), file_wd_mtime(g.argv[i]));
438438
--- src/tar.c
+++ src/tar.c
@@ -427,11 +427,11 @@
427 Blob file;
428 if( g.argc<3 ){
429 usage("ARCHIVE FILE....");
430 }
431 sqlite3_open(":memory:", &g.db);
432 tar_begin(0);
433 for(i=3; i<g.argc; i++){
434 blob_zero(&file);
435 blob_read_from_file(&file, g.argv[i]);
436 tar_add_file(g.argv[i], &file,
437 file_wd_perm(g.argv[i]), file_wd_mtime(g.argv[i]));
438
--- src/tar.c
+++ src/tar.c
@@ -427,11 +427,11 @@
427 Blob file;
428 if( g.argc<3 ){
429 usage("ARCHIVE FILE....");
430 }
431 sqlite3_open(":memory:", &g.db);
432 tar_begin(-1);
433 for(i=3; i<g.argc; i++){
434 blob_zero(&file);
435 blob_read_from_file(&file, g.argv[i]);
436 tar_add_file(g.argv[i], &file,
437 file_wd_perm(g.argv[i]), file_wd_mtime(g.argv[i]));
438

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button