Fossil SCM

The server now issues error messages in the synchronization protocol when a database error occurs during sync. Ticket [39f3294e213111a51e93d02fef6faa0062979619]

drh 2008-12-07 18:48 trunk
Commit 2be82dcc2aba6fdcb5fed4ca4eebaf216403eb64
+5
--- src/db.c
+++ src/db.c
@@ -66,10 +66,15 @@
6666
va_list ap;
6767
char *z;
6868
va_start(ap, zFormat);
6969
z = vmprintf(zFormat, ap);
7070
va_end(ap);
71
+ if( g.xferPanic ){
72
+ cgi_reset_content();
73
+ @ error Database\serror:\s%F(z)
74
+ cgi_reply();
75
+ }
7176
if( g.cgiPanic ){
7277
g.cgiPanic = 0;
7378
cgi_printf("<h1>Database Error</h1>\n"
7479
"<pre>%h</pre>", z);
7580
cgi_reply();
7681
--- 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 @@
7272
const char *zContentType; /* The content type of the input HTTP request */
7373
int iErrPriority; /* Priority of current error message */
7474
char *zErrMsg; /* Text of an error message */
7575
Blob cgiIn; /* Input to an xfer www method */
7676
int cgiPanic; /* Write error messages to CGI */
77
+ int xferPanic; /* Write error messages in XFER protocol */
7778
int fullHttpReply; /* True for full HTTP reply. False for CGI reply */
7879
Th_Interp *interp; /* The TH1 interpreter */
7980
FILE *httpIn; /* Accept HTTP input from here */
8081
FILE *httpOut; /* Send HTTP output here */
8182
int xlinkClusterOnly; /* Set when cloning. Only process clusters */
8283
--- 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 @@
539539
cgi_set_content_type(g.zContentType);
540540
blob_zero(&xfer.err);
541541
xfer.pIn = &g.cgiIn;
542542
xfer.pOut = cgi_output_blob();
543543
xfer.mxSend = db_get_int("max-download", 5000000);
544
+ g.xferPanic = 1;
544545
545546
db_begin_transaction();
546547
db_multi_exec(
547548
"CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);"
548549
);
549550
--- 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

Keyboard Shortcuts

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