Fossil SCM

Do not report errors to the error log on a 304 reply.

drh 2018-06-24 19:27 UTC trunk
Commit 60c8eca305b1ea95bd479eed8cad24a3e4cfe1c81ec67e77ab214d7c05b05abc
2 files changed +1 -1 +2
+1 -1
--- src/db.c
+++ src/db.c
@@ -1776,11 +1776,11 @@
17761776
fprintf(stderr, "-- prepared statements %10d\n", db.nPrepare);
17771777
}
17781778
while( db.pAllStmt ){
17791779
db_finalize(db.pAllStmt);
17801780
}
1781
- if( db.nBegin ){
1781
+ if( db.nBegin && reportErrors ){
17821782
fossil_warning("Missed call to db_end_transaction(). Rolling back.");
17831783
db_end_transaction(1);
17841784
}
17851785
pStmt = 0;
17861786
g.dbIgnoreErrors++; /* Stop "database locked" warnings from PRAGMA optimize */
17871787
--- src/db.c
+++ src/db.c
@@ -1776,11 +1776,11 @@
1776 fprintf(stderr, "-- prepared statements %10d\n", db.nPrepare);
1777 }
1778 while( db.pAllStmt ){
1779 db_finalize(db.pAllStmt);
1780 }
1781 if( db.nBegin ){
1782 fossil_warning("Missed call to db_end_transaction(). Rolling back.");
1783 db_end_transaction(1);
1784 }
1785 pStmt = 0;
1786 g.dbIgnoreErrors++; /* Stop "database locked" warnings from PRAGMA optimize */
1787
--- src/db.c
+++ src/db.c
@@ -1776,11 +1776,11 @@
1776 fprintf(stderr, "-- prepared statements %10d\n", db.nPrepare);
1777 }
1778 while( db.pAllStmt ){
1779 db_finalize(db.pAllStmt);
1780 }
1781 if( db.nBegin && reportErrors ){
1782 fossil_warning("Missed call to db_end_transaction(). Rolling back.");
1783 db_end_transaction(1);
1784 }
1785 pStmt = 0;
1786 g.dbIgnoreErrors++; /* Stop "database locked" warnings from PRAGMA optimize */
1787
+2
--- src/etag.c
+++ src/etag.c
@@ -126,10 +126,11 @@
126126
/* If we get this far, it means that the content has
127127
** not changed and we can do a 304 reply */
128128
cgi_reset_content();
129129
cgi_set_status(304, "Not Modified");
130130
cgi_reply();
131
+ db_close(0);
131132
fossil_exit(0);
132133
}
133134
134135
/*
135136
** Accept a new Last-Modified time. This routine should be called by
@@ -160,10 +161,11 @@
160161
/* If we reach this point, it means that the resource has not changed
161162
** and that we should generate a 304 Not Modified reply */
162163
cgi_reset_content();
163164
cgi_set_status(304, "Not Modified");
164165
cgi_reply();
166
+ db_close(0);
165167
fossil_exit(0);
166168
}
167169
168170
/* Return the ETag, if there is one.
169171
*/
170172
--- src/etag.c
+++ src/etag.c
@@ -126,10 +126,11 @@
126 /* If we get this far, it means that the content has
127 ** not changed and we can do a 304 reply */
128 cgi_reset_content();
129 cgi_set_status(304, "Not Modified");
130 cgi_reply();
 
131 fossil_exit(0);
132 }
133
134 /*
135 ** Accept a new Last-Modified time. This routine should be called by
@@ -160,10 +161,11 @@
160 /* If we reach this point, it means that the resource has not changed
161 ** and that we should generate a 304 Not Modified reply */
162 cgi_reset_content();
163 cgi_set_status(304, "Not Modified");
164 cgi_reply();
 
165 fossil_exit(0);
166 }
167
168 /* Return the ETag, if there is one.
169 */
170
--- src/etag.c
+++ src/etag.c
@@ -126,10 +126,11 @@
126 /* If we get this far, it means that the content has
127 ** not changed and we can do a 304 reply */
128 cgi_reset_content();
129 cgi_set_status(304, "Not Modified");
130 cgi_reply();
131 db_close(0);
132 fossil_exit(0);
133 }
134
135 /*
136 ** Accept a new Last-Modified time. This routine should be called by
@@ -160,10 +161,11 @@
161 /* If we reach this point, it means that the resource has not changed
162 ** and that we should generate a 304 Not Modified reply */
163 cgi_reset_content();
164 cgi_set_status(304, "Not Modified");
165 cgi_reply();
166 db_close(0);
167 fossil_exit(0);
168 }
169
170 /* Return the ETag, if there is one.
171 */
172

Keyboard Shortcuts

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