Fossil SCM

Add the --ipv4 option to force the use of IPv4 on "fossil clone" and "fossil sync" and so forth.

drh 2015-01-24 21:46 trunk
Commit 317bd3cb3dbc5c1d4a3f75939fec5ede6f6a1655
--- src/http_socket.c
+++ src/http_socket.c
@@ -144,11 +144,11 @@
144144
char zRemote[NI_MAXHOST];
145145
146146
socket_global_init();
147147
memset(&hints, 0, sizeof(struct addrinfo));
148148
assert( iSocket<0 );
149
- hints.ai_family = AF_UNSPEC;
149
+ hints.ai_family = g.fIPv4 ? AF_INET : AF_UNSPEC;
150150
hints.ai_socktype = SOCK_STREAM;
151151
hints.ai_protocol = IPPROTO_TCP;
152152
sqlite3_snprintf(sizeof(zPort),zPort,"%d", pUrlData->port);
153153
rc = getaddrinfo(pUrlData->name, zPort, &hints, &ai);
154154
if( rc ){
155155
--- src/http_socket.c
+++ src/http_socket.c
@@ -144,11 +144,11 @@
144 char zRemote[NI_MAXHOST];
145
146 socket_global_init();
147 memset(&hints, 0, sizeof(struct addrinfo));
148 assert( iSocket<0 );
149 hints.ai_family = AF_UNSPEC;
150 hints.ai_socktype = SOCK_STREAM;
151 hints.ai_protocol = IPPROTO_TCP;
152 sqlite3_snprintf(sizeof(zPort),zPort,"%d", pUrlData->port);
153 rc = getaddrinfo(pUrlData->name, zPort, &hints, &ai);
154 if( rc ){
155
--- src/http_socket.c
+++ src/http_socket.c
@@ -144,11 +144,11 @@
144 char zRemote[NI_MAXHOST];
145
146 socket_global_init();
147 memset(&hints, 0, sizeof(struct addrinfo));
148 assert( iSocket<0 );
149 hints.ai_family = g.fIPv4 ? AF_INET : AF_UNSPEC;
150 hints.ai_socktype = SOCK_STREAM;
151 hints.ai_protocol = IPPROTO_TCP;
152 sqlite3_snprintf(sizeof(zPort),zPort,"%d", pUrlData->port);
153 rc = getaddrinfo(pUrlData->name, zPort, &hints, &ai);
154 if( rc ){
155
+1
--- src/main.c
+++ src/main.c
@@ -149,10 +149,11 @@
149149
int fSystemTrace; /* Trace calls to fossil_system(), --systemtrace */
150150
int fSshTrace; /* Trace the SSH setup traffic */
151151
int fSshClient; /* HTTP client flags for SSH client */
152152
char *zSshCmd; /* SSH command string */
153153
int fNoSync; /* Do not do an autosync ever. --nosync */
154
+ int fIPv4; /* Use only IPv4, not IPv6. --ipv4 */
154155
char *zPath; /* Name of webpage being served */
155156
char *zExtra; /* Extra path information past the webpage name */
156157
char *zBaseURL; /* Full text of the URL being served */
157158
char *zHttpsURL; /* zBaseURL translated to https: */
158159
char *zTop; /* Parent directory of zPath */
159160
--- src/main.c
+++ src/main.c
@@ -149,10 +149,11 @@
149 int fSystemTrace; /* Trace calls to fossil_system(), --systemtrace */
150 int fSshTrace; /* Trace the SSH setup traffic */
151 int fSshClient; /* HTTP client flags for SSH client */
152 char *zSshCmd; /* SSH command string */
153 int fNoSync; /* Do not do an autosync ever. --nosync */
 
154 char *zPath; /* Name of webpage being served */
155 char *zExtra; /* Extra path information past the webpage name */
156 char *zBaseURL; /* Full text of the URL being served */
157 char *zHttpsURL; /* zBaseURL translated to https: */
158 char *zTop; /* Parent directory of zPath */
159
--- src/main.c
+++ src/main.c
@@ -149,10 +149,11 @@
149 int fSystemTrace; /* Trace calls to fossil_system(), --systemtrace */
150 int fSshTrace; /* Trace the SSH setup traffic */
151 int fSshClient; /* HTTP client flags for SSH client */
152 char *zSshCmd; /* SSH command string */
153 int fNoSync; /* Do not do an autosync ever. --nosync */
154 int fIPv4; /* Use only IPv4, not IPv6. --ipv4 */
155 char *zPath; /* Name of webpage being served */
156 char *zExtra; /* Extra path information past the webpage name */
157 char *zBaseURL; /* Full text of the URL being served */
158 char *zHttpsURL; /* zBaseURL translated to https: */
159 char *zTop; /* Parent directory of zPath */
160
+1
--- src/url.c
+++ src/url.c
@@ -362,10 +362,11 @@
362362
** feature.
363363
*/
364364
void url_proxy_options(void){
365365
zProxyOpt = find_option("proxy", 0, 1);
366366
if( find_option("nosync",0,0) ) g.fNoSync = 1;
367
+ if( find_option("ipv4",0,0) ) g.fIPv4 = 1;
367368
}
368369
369370
/*
370371
** If the "proxy" setting is defined, then change the URL settings
371372
** (initialized by a prior call to url_parse()) so that the HTTP
372373
--- src/url.c
+++ src/url.c
@@ -362,10 +362,11 @@
362 ** feature.
363 */
364 void url_proxy_options(void){
365 zProxyOpt = find_option("proxy", 0, 1);
366 if( find_option("nosync",0,0) ) g.fNoSync = 1;
 
367 }
368
369 /*
370 ** If the "proxy" setting is defined, then change the URL settings
371 ** (initialized by a prior call to url_parse()) so that the HTTP
372
--- src/url.c
+++ src/url.c
@@ -362,10 +362,11 @@
362 ** feature.
363 */
364 void url_proxy_options(void){
365 zProxyOpt = find_option("proxy", 0, 1);
366 if( find_option("nosync",0,0) ) g.fNoSync = 1;
367 if( find_option("ipv4",0,0) ) g.fIPv4 = 1;
368 }
369
370 /*
371 ** If the "proxy" setting is defined, then change the URL settings
372 ** (initialized by a prior call to url_parse()) so that the HTTP
373

Keyboard Shortcuts

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