Fossil SCM
Merge from trunk.
Commit
21da639fee8f1c13644a20eced98e25d6e997d89
Parent
fb80037e2652626…
6 files changed
+1
-1
+1
+6
-2
+1
-1
+8
-1
+2
-2
+1
-1
| --- Makefile.in | ||
| +++ Makefile.in | ||
| @@ -37,11 +37,11 @@ | ||
| 37 | 37 | # care about testing the end result, this can be blank. |
| 38 | 38 | # |
| 39 | 39 | TCLSH = tclsh |
| 40 | 40 | |
| 41 | 41 | 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 | |
| 43 | 43 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 44 | 44 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 45 | 45 | FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@ |
| 46 | 46 | FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@ |
| 47 | 47 | |
| 48 | 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 -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 |
M
auto.def
+1
| --- auto.def | ||
| +++ auto.def | ||
| @@ -233,8 +233,9 @@ | ||
| 233 | 233 | # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars |
| 234 | 234 | if {![cc-check-functions getpassphrase]} { |
| 235 | 235 | # Haiku needs this |
| 236 | 236 | cc-check-function-in-lib getpass bsd |
| 237 | 237 | } |
| 238 | +cc-check-function-in-lib dlopen dl | |
| 238 | 239 | |
| 239 | 240 | make-template Makefile.in |
| 240 | 241 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 241 | 242 |
| --- 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 @@ | ||
| 130 | 130 | ** |
| 131 | 131 | ** The server address is contain in the "g" global structure. The |
| 132 | 132 | ** url_parse() routine should have been called prior to this routine |
| 133 | 133 | ** in order to fill this structure appropriately. |
| 134 | 134 | */ |
| 135 | -int http_exchange(Blob *pSend, Blob *pReply, int useLogin){ | |
| 135 | +int http_exchange(Blob *pSend, Blob *pReply, int useLogin, int maxRedirect){ | |
| 136 | 136 | Blob login; /* The login card */ |
| 137 | 137 | Blob payload; /* The complete payload including login card */ |
| 138 | 138 | Blob hdr; /* The HTTP request header */ |
| 139 | 139 | int closeConnection; /* True to close the connection when done */ |
| 140 | 140 | int iLength; /* Length of the reply payload */ |
| @@ -231,10 +231,14 @@ | ||
| 231 | 231 | }else if( c=='k' || c=='K' ){ |
| 232 | 232 | closeConnection = 0; |
| 233 | 233 | } |
| 234 | 234 | }else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){ |
| 235 | 235 | int i, j; |
| 236 | + | |
| 237 | + if ( --maxRedirect == 0){ | |
| 238 | + fossil_fatal("redirect limit exceeded"); | |
| 239 | + } | |
| 236 | 240 | for(i=9; zLine[i] && zLine[i]==' '; i++){} |
| 237 | 241 | if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine); |
| 238 | 242 | j = strlen(zLine) - 1; |
| 239 | 243 | while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){ |
| 240 | 244 | j -= 4; |
| @@ -241,11 +245,11 @@ | ||
| 241 | 245 | zLine[j] = 0; |
| 242 | 246 | } |
| 243 | 247 | fossil_print("redirect to %s\n", &zLine[i]); |
| 244 | 248 | url_parse(&zLine[i]); |
| 245 | 249 | transport_close(); |
| 246 | - return http_exchange(pSend, pReply, useLogin); | |
| 250 | + return http_exchange(pSend, pReply, useLogin, maxRedirect); | |
| 247 | 251 | }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){ |
| 248 | 252 | if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){ |
| 249 | 253 | isCompressed = 0; |
| 250 | 254 | }else if( fossil_strnicmp(&zLine[14], |
| 251 | 255 | "application/x-fossil-uncompressed", -1)==0 ){ |
| 252 | 256 |
| --- 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 |
+1
-1
| --- src/json_detail.h | ||
| +++ src/json_detail.h | ||
| @@ -199,11 +199,11 @@ | ||
| 199 | 199 | char const * requestId; |
| 200 | 200 | char const * resultCode; |
| 201 | 201 | char const * resultText; |
| 202 | 202 | char const * timestamp; |
| 203 | 203 | } FossilJsonKeys_; |
| 204 | -const FossilJsonKeys_ FossilJsonKeys; | |
| 204 | +extern const FossilJsonKeys_ FossilJsonKeys; | |
| 205 | 205 | |
| 206 | 206 | /* |
| 207 | 207 | ** A page/command dispatch helper for fossil_json_f() implementations. |
| 208 | 208 | ** pages must be an array of JsonPageDef commands which we can |
| 209 | 209 | ** dispatch. The final item in the array MUST have a NULL name |
| 210 | 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 | 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 @@ | ||
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include "xfer.h" |
| 22 | 22 | |
| 23 | 23 | #include <time.h> |
| 24 | 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 | + | |
| 25 | 31 | /* |
| 26 | 32 | ** This structure holds information about the current state of either |
| 27 | 33 | ** a client or a server that is participating in xfer. |
| 28 | 34 | */ |
| 29 | 35 | typedef struct Xfer Xfer; |
| @@ -1480,11 +1486,12 @@ | ||
| 1480 | 1486 | xfer.nIGotSent = 0; |
| 1481 | 1487 | if( syncFlags & SYNC_VERBOSE ){ |
| 1482 | 1488 | fossil_print("waiting for server..."); |
| 1483 | 1489 | } |
| 1484 | 1490 | 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) ){ | |
| 1486 | 1493 | nErr++; |
| 1487 | 1494 | break; |
| 1488 | 1495 | } |
| 1489 | 1496 | lastPctDone = -1; |
| 1490 | 1497 | blob_reset(&send); |
| 1491 | 1498 |
| --- 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 @@ | ||
| 54 | 54 | </ol> |
| 55 | 55 | |
| 56 | 56 | <h2>2.0 Compiling</h2> |
| 57 | 57 | |
| 58 | 58 | <ol> |
| 59 | -<li value="6"> | |
| 59 | +<li value="5"> | |
| 60 | 60 | <p>Unpack the ZIP or tarball you downloaded then |
| 61 | 61 | <b>cd</b> into the directory created.</p></li> |
| 62 | 62 | |
| 63 | 63 | <li><i>(Optional, unix only)</i> |
| 64 | 64 | Run <b>./configure</b> to construct a makefile. |
| @@ -101,11 +101,11 @@ | ||
| 101 | 101 | </ol> |
| 102 | 102 | |
| 103 | 103 | <h2>3.0 Installing</h2> |
| 104 | 104 | |
| 105 | 105 | <ol> |
| 106 | -<li value="9"> | |
| 106 | +<li value="8"> | |
| 107 | 107 | <p>The finished binary is named "fossil" (or "fossil.exe" on windows). |
| 108 | 108 | Put this binary in a |
| 109 | 109 | directory that is somewhere on your PATH environment variable. |
| 110 | 110 | It does not matter where.</p> |
| 111 | 111 | |
| 112 | 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="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 |