Fossil SCM
The server now issues error messages in the synchronization protocol when a database error occurs during sync. Ticket [39f3294e213111a51e93d02fef6faa0062979619]
Commit
2be82dcc2aba6fdcb5fed4ca4eebaf216403eb64
Parent
8c4e72e22320d3d…
3 files changed
+5
+1
+1
M
src/db.c
+5
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -66,10 +66,15 @@ | ||
| 66 | 66 | va_list ap; |
| 67 | 67 | char *z; |
| 68 | 68 | va_start(ap, zFormat); |
| 69 | 69 | z = vmprintf(zFormat, ap); |
| 70 | 70 | va_end(ap); |
| 71 | + if( g.xferPanic ){ | |
| 72 | + cgi_reset_content(); | |
| 73 | + @ error Database\serror:\s%F(z) | |
| 74 | + cgi_reply(); | |
| 75 | + } | |
| 71 | 76 | if( g.cgiPanic ){ |
| 72 | 77 | g.cgiPanic = 0; |
| 73 | 78 | cgi_printf("<h1>Database Error</h1>\n" |
| 74 | 79 | "<pre>%h</pre>", z); |
| 75 | 80 | cgi_reply(); |
| 76 | 81 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -66,10 +66,15 @@ | |
| 66 | va_list ap; |
| 67 | char *z; |
| 68 | va_start(ap, zFormat); |
| 69 | z = vmprintf(zFormat, ap); |
| 70 | va_end(ap); |
| 71 | if( g.cgiPanic ){ |
| 72 | g.cgiPanic = 0; |
| 73 | cgi_printf("<h1>Database Error</h1>\n" |
| 74 | "<pre>%h</pre>", z); |
| 75 | cgi_reply(); |
| 76 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -66,10 +66,15 @@ | |
| 66 | va_list ap; |
| 67 | char *z; |
| 68 | va_start(ap, zFormat); |
| 69 | z = vmprintf(zFormat, ap); |
| 70 | va_end(ap); |
| 71 | if( g.xferPanic ){ |
| 72 | cgi_reset_content(); |
| 73 | @ error Database\serror:\s%F(z) |
| 74 | cgi_reply(); |
| 75 | } |
| 76 | if( g.cgiPanic ){ |
| 77 | g.cgiPanic = 0; |
| 78 | cgi_printf("<h1>Database Error</h1>\n" |
| 79 | "<pre>%h</pre>", z); |
| 80 | cgi_reply(); |
| 81 |
+1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -72,10 +72,11 @@ | ||
| 72 | 72 | const char *zContentType; /* The content type of the input HTTP request */ |
| 73 | 73 | int iErrPriority; /* Priority of current error message */ |
| 74 | 74 | char *zErrMsg; /* Text of an error message */ |
| 75 | 75 | Blob cgiIn; /* Input to an xfer www method */ |
| 76 | 76 | int cgiPanic; /* Write error messages to CGI */ |
| 77 | + int xferPanic; /* Write error messages in XFER protocol */ | |
| 77 | 78 | int fullHttpReply; /* True for full HTTP reply. False for CGI reply */ |
| 78 | 79 | Th_Interp *interp; /* The TH1 interpreter */ |
| 79 | 80 | FILE *httpIn; /* Accept HTTP input from here */ |
| 80 | 81 | FILE *httpOut; /* Send HTTP output here */ |
| 81 | 82 | int xlinkClusterOnly; /* Set when cloning. Only process clusters */ |
| 82 | 83 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -72,10 +72,11 @@ | |
| 72 | const char *zContentType; /* The content type of the input HTTP request */ |
| 73 | int iErrPriority; /* Priority of current error message */ |
| 74 | char *zErrMsg; /* Text of an error message */ |
| 75 | Blob cgiIn; /* Input to an xfer www method */ |
| 76 | int cgiPanic; /* Write error messages to CGI */ |
| 77 | int fullHttpReply; /* True for full HTTP reply. False for CGI reply */ |
| 78 | Th_Interp *interp; /* The TH1 interpreter */ |
| 79 | FILE *httpIn; /* Accept HTTP input from here */ |
| 80 | FILE *httpOut; /* Send HTTP output here */ |
| 81 | int xlinkClusterOnly; /* Set when cloning. Only process clusters */ |
| 82 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -72,10 +72,11 @@ | |
| 72 | const char *zContentType; /* The content type of the input HTTP request */ |
| 73 | int iErrPriority; /* Priority of current error message */ |
| 74 | char *zErrMsg; /* Text of an error message */ |
| 75 | Blob cgiIn; /* Input to an xfer www method */ |
| 76 | int cgiPanic; /* Write error messages to CGI */ |
| 77 | int xferPanic; /* Write error messages in XFER protocol */ |
| 78 | int fullHttpReply; /* True for full HTTP reply. False for CGI reply */ |
| 79 | Th_Interp *interp; /* The TH1 interpreter */ |
| 80 | FILE *httpIn; /* Accept HTTP input from here */ |
| 81 | FILE *httpOut; /* Send HTTP output here */ |
| 82 | int xlinkClusterOnly; /* Set when cloning. Only process clusters */ |
| 83 |
+1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -539,10 +539,11 @@ | ||
| 539 | 539 | cgi_set_content_type(g.zContentType); |
| 540 | 540 | blob_zero(&xfer.err); |
| 541 | 541 | xfer.pIn = &g.cgiIn; |
| 542 | 542 | xfer.pOut = cgi_output_blob(); |
| 543 | 543 | xfer.mxSend = db_get_int("max-download", 5000000); |
| 544 | + g.xferPanic = 1; | |
| 544 | 545 | |
| 545 | 546 | db_begin_transaction(); |
| 546 | 547 | db_multi_exec( |
| 547 | 548 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 548 | 549 | ); |
| 549 | 550 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -539,10 +539,11 @@ | |
| 539 | cgi_set_content_type(g.zContentType); |
| 540 | blob_zero(&xfer.err); |
| 541 | xfer.pIn = &g.cgiIn; |
| 542 | xfer.pOut = cgi_output_blob(); |
| 543 | xfer.mxSend = db_get_int("max-download", 5000000); |
| 544 | |
| 545 | db_begin_transaction(); |
| 546 | db_multi_exec( |
| 547 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 548 | ); |
| 549 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -539,10 +539,11 @@ | |
| 539 | cgi_set_content_type(g.zContentType); |
| 540 | blob_zero(&xfer.err); |
| 541 | xfer.pIn = &g.cgiIn; |
| 542 | xfer.pOut = cgi_output_blob(); |
| 543 | xfer.mxSend = db_get_int("max-download", 5000000); |
| 544 | g.xferPanic = 1; |
| 545 | |
| 546 | db_begin_transaction(); |
| 547 | db_multi_exec( |
| 548 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 549 | ); |
| 550 |