Fossil SCM

Merge from trunk.

dg 2013-02-05 23:40 dg-misc merge
Commit 21da639fee8f1c13644a20eced98e25d6e997d89
+1 -1
--- Makefile.in
+++ Makefile.in
@@ -37,11 +37,11 @@
3737
# care about testing the end result, this can be blank.
3838
#
3939
TCLSH = tclsh
4040
4141
LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
42
-TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -Dstrcmp=fossil_strcmp
42
+TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H
4343
INSTALLDIR = $(DESTDIR)@prefix@/bin
4444
USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
4545
FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@
4646
FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@
4747
4848
--- Makefile.in
+++ Makefile.in
@@ -37,11 +37,11 @@
37 # care about testing the end result, this can be blank.
38 #
39 TCLSH = tclsh
40
41 LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
42 TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -Dstrcmp=fossil_strcmp
43 INSTALLDIR = $(DESTDIR)@prefix@/bin
44 USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
45 FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@
46 FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@
47
48
--- Makefile.in
+++ Makefile.in
@@ -37,11 +37,11 @@
37 # care about testing the end result, this can be blank.
38 #
39 TCLSH = tclsh
40
41 LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
42 TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H
43 INSTALLDIR = $(DESTDIR)@prefix@/bin
44 USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
45 FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@
46 FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@
47
48
+1
--- auto.def
+++ auto.def
@@ -233,8 +233,9 @@
233233
# Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
234234
if {![cc-check-functions getpassphrase]} {
235235
# Haiku needs this
236236
cc-check-function-in-lib getpass bsd
237237
}
238
+cc-check-function-in-lib dlopen dl
238239
239240
make-template Makefile.in
240241
make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
241242
--- auto.def
+++ auto.def
@@ -233,8 +233,9 @@
233 # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
234 if {![cc-check-functions getpassphrase]} {
235 # Haiku needs this
236 cc-check-function-in-lib getpass bsd
237 }
 
238
239 make-template Makefile.in
240 make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
241
--- auto.def
+++ auto.def
@@ -233,8 +233,9 @@
233 # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
234 if {![cc-check-functions getpassphrase]} {
235 # Haiku needs this
236 cc-check-function-in-lib getpass bsd
237 }
238 cc-check-function-in-lib dlopen dl
239
240 make-template Makefile.in
241 make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
242
+6 -2
--- src/http.c
+++ src/http.c
@@ -130,11 +130,11 @@
130130
**
131131
** The server address is contain in the "g" global structure. The
132132
** url_parse() routine should have been called prior to this routine
133133
** in order to fill this structure appropriately.
134134
*/
135
-int http_exchange(Blob *pSend, Blob *pReply, int useLogin){
135
+int http_exchange(Blob *pSend, Blob *pReply, int useLogin, int maxRedirect){
136136
Blob login; /* The login card */
137137
Blob payload; /* The complete payload including login card */
138138
Blob hdr; /* The HTTP request header */
139139
int closeConnection; /* True to close the connection when done */
140140
int iLength; /* Length of the reply payload */
@@ -231,10 +231,14 @@
231231
}else if( c=='k' || c=='K' ){
232232
closeConnection = 0;
233233
}
234234
}else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){
235235
int i, j;
236
+
237
+ if ( --maxRedirect == 0){
238
+ fossil_fatal("redirect limit exceeded");
239
+ }
236240
for(i=9; zLine[i] && zLine[i]==' '; i++){}
237241
if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine);
238242
j = strlen(zLine) - 1;
239243
while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
240244
j -= 4;
@@ -241,11 +245,11 @@
241245
zLine[j] = 0;
242246
}
243247
fossil_print("redirect to %s\n", &zLine[i]);
244248
url_parse(&zLine[i]);
245249
transport_close();
246
- return http_exchange(pSend, pReply, useLogin);
250
+ return http_exchange(pSend, pReply, useLogin, maxRedirect);
247251
}else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
248252
if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
249253
isCompressed = 0;
250254
}else if( fossil_strnicmp(&zLine[14],
251255
"application/x-fossil-uncompressed", -1)==0 ){
252256
--- src/http.c
+++ src/http.c
@@ -130,11 +130,11 @@
130 **
131 ** The server address is contain in the "g" global structure. The
132 ** url_parse() routine should have been called prior to this routine
133 ** in order to fill this structure appropriately.
134 */
135 int http_exchange(Blob *pSend, Blob *pReply, int useLogin){
136 Blob login; /* The login card */
137 Blob payload; /* The complete payload including login card */
138 Blob hdr; /* The HTTP request header */
139 int closeConnection; /* True to close the connection when done */
140 int iLength; /* Length of the reply payload */
@@ -231,10 +231,14 @@
231 }else if( c=='k' || c=='K' ){
232 closeConnection = 0;
233 }
234 }else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){
235 int i, j;
 
 
 
 
236 for(i=9; zLine[i] && zLine[i]==' '; i++){}
237 if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine);
238 j = strlen(zLine) - 1;
239 while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
240 j -= 4;
@@ -241,11 +245,11 @@
241 zLine[j] = 0;
242 }
243 fossil_print("redirect to %s\n", &zLine[i]);
244 url_parse(&zLine[i]);
245 transport_close();
246 return http_exchange(pSend, pReply, useLogin);
247 }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
248 if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
249 isCompressed = 0;
250 }else if( fossil_strnicmp(&zLine[14],
251 "application/x-fossil-uncompressed", -1)==0 ){
252
--- src/http.c
+++ src/http.c
@@ -130,11 +130,11 @@
130 **
131 ** The server address is contain in the "g" global structure. The
132 ** url_parse() routine should have been called prior to this routine
133 ** in order to fill this structure appropriately.
134 */
135 int http_exchange(Blob *pSend, Blob *pReply, int useLogin, int maxRedirect){
136 Blob login; /* The login card */
137 Blob payload; /* The complete payload including login card */
138 Blob hdr; /* The HTTP request header */
139 int closeConnection; /* True to close the connection when done */
140 int iLength; /* Length of the reply payload */
@@ -231,10 +231,14 @@
231 }else if( c=='k' || c=='K' ){
232 closeConnection = 0;
233 }
234 }else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){
235 int i, j;
236
237 if ( --maxRedirect == 0){
238 fossil_fatal("redirect limit exceeded");
239 }
240 for(i=9; zLine[i] && zLine[i]==' '; i++){}
241 if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine);
242 j = strlen(zLine) - 1;
243 while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
244 j -= 4;
@@ -241,11 +245,11 @@
245 zLine[j] = 0;
246 }
247 fossil_print("redirect to %s\n", &zLine[i]);
248 url_parse(&zLine[i]);
249 transport_close();
250 return http_exchange(pSend, pReply, useLogin, maxRedirect);
251 }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
252 if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
253 isCompressed = 0;
254 }else if( fossil_strnicmp(&zLine[14],
255 "application/x-fossil-uncompressed", -1)==0 ){
256
--- src/json_detail.h
+++ src/json_detail.h
@@ -199,11 +199,11 @@
199199
char const * requestId;
200200
char const * resultCode;
201201
char const * resultText;
202202
char const * timestamp;
203203
} FossilJsonKeys_;
204
-const FossilJsonKeys_ FossilJsonKeys;
204
+extern const FossilJsonKeys_ FossilJsonKeys;
205205
206206
/*
207207
** A page/command dispatch helper for fossil_json_f() implementations.
208208
** pages must be an array of JsonPageDef commands which we can
209209
** dispatch. The final item in the array MUST have a NULL name
210210
--- src/json_detail.h
+++ src/json_detail.h
@@ -199,11 +199,11 @@
199 char const * requestId;
200 char const * resultCode;
201 char const * resultText;
202 char const * timestamp;
203 } FossilJsonKeys_;
204 const FossilJsonKeys_ FossilJsonKeys;
205
206 /*
207 ** A page/command dispatch helper for fossil_json_f() implementations.
208 ** pages must be an array of JsonPageDef commands which we can
209 ** dispatch. The final item in the array MUST have a NULL name
210
--- src/json_detail.h
+++ src/json_detail.h
@@ -199,11 +199,11 @@
199 char const * requestId;
200 char const * resultCode;
201 char const * resultText;
202 char const * timestamp;
203 } FossilJsonKeys_;
204 extern const FossilJsonKeys_ FossilJsonKeys;
205
206 /*
207 ** A page/command dispatch helper for fossil_json_f() implementations.
208 ** pages must be an array of JsonPageDef commands which we can
209 ** dispatch. The final item in the array MUST have a NULL name
210
+8 -1
--- src/xfer.c
+++ src/xfer.c
@@ -20,10 +20,16 @@
2020
#include "config.h"
2121
#include "xfer.h"
2222
2323
#include <time.h>
2424
25
+/*
26
+** Maximum number of HTTP redirects that any http_exchange() call will
27
+** follow before throwing a fatal error. Most browsers use a limit of 20.
28
+*/
29
+#define MAX_REDIRECTS 20
30
+
2531
/*
2632
** This structure holds information about the current state of either
2733
** a client or a server that is participating in xfer.
2834
*/
2935
typedef struct Xfer Xfer;
@@ -1480,11 +1486,12 @@
14801486
xfer.nIGotSent = 0;
14811487
if( syncFlags & SYNC_VERBOSE ){
14821488
fossil_print("waiting for server...");
14831489
}
14841490
fflush(stdout);
1485
- if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0) ){
1491
+ if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0,
1492
+ MAX_REDIRECTS) ){
14861493
nErr++;
14871494
break;
14881495
}
14891496
lastPctDone = -1;
14901497
blob_reset(&send);
14911498
--- src/xfer.c
+++ src/xfer.c
@@ -20,10 +20,16 @@
20 #include "config.h"
21 #include "xfer.h"
22
23 #include <time.h>
24
 
 
 
 
 
 
25 /*
26 ** This structure holds information about the current state of either
27 ** a client or a server that is participating in xfer.
28 */
29 typedef struct Xfer Xfer;
@@ -1480,11 +1486,12 @@
1480 xfer.nIGotSent = 0;
1481 if( syncFlags & SYNC_VERBOSE ){
1482 fossil_print("waiting for server...");
1483 }
1484 fflush(stdout);
1485 if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0) ){
 
1486 nErr++;
1487 break;
1488 }
1489 lastPctDone = -1;
1490 blob_reset(&send);
1491
--- src/xfer.c
+++ src/xfer.c
@@ -20,10 +20,16 @@
20 #include "config.h"
21 #include "xfer.h"
22
23 #include <time.h>
24
25 /*
26 ** Maximum number of HTTP redirects that any http_exchange() call will
27 ** follow before throwing a fatal error. Most browsers use a limit of 20.
28 */
29 #define MAX_REDIRECTS 20
30
31 /*
32 ** This structure holds information about the current state of either
33 ** a client or a server that is participating in xfer.
34 */
35 typedef struct Xfer Xfer;
@@ -1480,11 +1486,12 @@
1486 xfer.nIGotSent = 0;
1487 if( syncFlags & SYNC_VERBOSE ){
1488 fossil_print("waiting for server...");
1489 }
1490 fflush(stdout);
1491 if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0,
1492 MAX_REDIRECTS) ){
1493 nErr++;
1494 break;
1495 }
1496 lastPctDone = -1;
1497 blob_reset(&send);
1498
+2 -2
--- www/build.wiki
+++ www/build.wiki
@@ -54,11 +54,11 @@
5454
</ol>
5555
5656
<h2>2.0 Compiling</h2>
5757
5858
<ol>
59
-<li value="6">
59
+<li value="5">
6060
<p>Unpack the ZIP or tarball you downloaded then
6161
<b>cd</b> into the directory created.</p></li>
6262
6363
<li><i>(Optional, unix only)</i>
6464
Run <b>./configure</b> to construct a makefile.
@@ -101,11 +101,11 @@
101101
</ol>
102102
103103
<h2>3.0 Installing</h2>
104104
105105
<ol>
106
-<li value="9">
106
+<li value="8">
107107
<p>The finished binary is named "fossil" (or "fossil.exe" on windows).
108108
Put this binary in a
109109
directory that is somewhere on your PATH environment variable.
110110
It does not matter where.</p>
111111
112112
--- www/build.wiki
+++ www/build.wiki
@@ -54,11 +54,11 @@
54 </ol>
55
56 <h2>2.0 Compiling</h2>
57
58 <ol>
59 <li value="6">
60 <p>Unpack the ZIP or tarball you downloaded then
61 <b>cd</b> into the directory created.</p></li>
62
63 <li><i>(Optional, unix only)</i>
64 Run <b>./configure</b> to construct a makefile.
@@ -101,11 +101,11 @@
101 </ol>
102
103 <h2>3.0 Installing</h2>
104
105 <ol>
106 <li value="9">
107 <p>The finished binary is named "fossil" (or "fossil.exe" on windows).
108 Put this binary in a
109 directory that is somewhere on your PATH environment variable.
110 It does not matter where.</p>
111
112
--- www/build.wiki
+++ www/build.wiki
@@ -54,11 +54,11 @@
54 </ol>
55
56 <h2>2.0 Compiling</h2>
57
58 <ol>
59 <li value="5">
60 <p>Unpack the ZIP or tarball you downloaded then
61 <b>cd</b> into the directory created.</p></li>
62
63 <li><i>(Optional, unix only)</i>
64 Run <b>./configure</b> to construct a makefile.
@@ -101,11 +101,11 @@
101 </ol>
102
103 <h2>3.0 Installing</h2>
104
105 <ol>
106 <li value="8">
107 <p>The finished binary is named "fossil" (or "fossil.exe" on windows).
108 Put this binary in a
109 directory that is somewhere on your PATH environment variable.
110 It does not matter where.</p>
111
112

Keyboard Shortcuts

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