Fossil SCM
Do not report errors to the error log on a 304 reply.
Commit
60c8eca305b1ea95bd479eed8cad24a3e4cfe1c81ec67e77ab214d7c05b05abc
Parent
29cb8260c0d62ec…
2 files changed
+1
-1
+2
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1776,11 +1776,11 @@ | ||
| 1776 | 1776 | fprintf(stderr, "-- prepared statements %10d\n", db.nPrepare); |
| 1777 | 1777 | } |
| 1778 | 1778 | while( db.pAllStmt ){ |
| 1779 | 1779 | db_finalize(db.pAllStmt); |
| 1780 | 1780 | } |
| 1781 | - if( db.nBegin ){ | |
| 1781 | + if( db.nBegin && reportErrors ){ | |
| 1782 | 1782 | fossil_warning("Missed call to db_end_transaction(). Rolling back."); |
| 1783 | 1783 | db_end_transaction(1); |
| 1784 | 1784 | } |
| 1785 | 1785 | pStmt = 0; |
| 1786 | 1786 | g.dbIgnoreErrors++; /* Stop "database locked" warnings from PRAGMA optimize */ |
| 1787 | 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 ){ |
| 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 @@ | ||
| 126 | 126 | /* If we get this far, it means that the content has |
| 127 | 127 | ** not changed and we can do a 304 reply */ |
| 128 | 128 | cgi_reset_content(); |
| 129 | 129 | cgi_set_status(304, "Not Modified"); |
| 130 | 130 | cgi_reply(); |
| 131 | + db_close(0); | |
| 131 | 132 | fossil_exit(0); |
| 132 | 133 | } |
| 133 | 134 | |
| 134 | 135 | /* |
| 135 | 136 | ** Accept a new Last-Modified time. This routine should be called by |
| @@ -160,10 +161,11 @@ | ||
| 160 | 161 | /* If we reach this point, it means that the resource has not changed |
| 161 | 162 | ** and that we should generate a 304 Not Modified reply */ |
| 162 | 163 | cgi_reset_content(); |
| 163 | 164 | cgi_set_status(304, "Not Modified"); |
| 164 | 165 | cgi_reply(); |
| 166 | + db_close(0); | |
| 165 | 167 | fossil_exit(0); |
| 166 | 168 | } |
| 167 | 169 | |
| 168 | 170 | /* Return the ETag, if there is one. |
| 169 | 171 | */ |
| 170 | 172 |
| --- 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 |