Fossil SCM

Make sure the 'server' command checks for and processes the --files-urlenc option

jan.nijtmans 2014-08-04 04:40 branch-1.29 merge
Commit eed3946bd92a499ed81c790e161d9e7c20ecd037
+8 -1
--- src/main.c
+++ src/main.c
@@ -1951,11 +1951,18 @@
19511951
#if defined(_WIN32)
19521952
const char *zStopperFile; /* Name of file used to terminate server */
19531953
zStopperFile = find_option("stopper", 0, 1);
19541954
#endif
19551955
1956
- zFileGlob = find_option("files", 0, 1);
1956
+ zFileGlob = find_option("files-urlenc",0,1);
1957
+ if( zFileGlob ){
1958
+ char *z = mprintf("%s", zFileGlob);
1959
+ dehttpize(z);
1960
+ zFileGlob = z;
1961
+ }else{
1962
+ zFileGlob = find_option("files",0,1);
1963
+ }
19571964
g.useLocalauth = find_option("localauth", 0, 0)!=0;
19581965
Th_InitTraceLog();
19591966
zPort = find_option("port", "P", 1);
19601967
zNotFound = find_option("notfound", 0, 1);
19611968
zAltBase = find_option("baseurl", 0, 1);
19621969
--- src/main.c
+++ src/main.c
@@ -1951,11 +1951,18 @@
1951 #if defined(_WIN32)
1952 const char *zStopperFile; /* Name of file used to terminate server */
1953 zStopperFile = find_option("stopper", 0, 1);
1954 #endif
1955
1956 zFileGlob = find_option("files", 0, 1);
 
 
 
 
 
 
 
1957 g.useLocalauth = find_option("localauth", 0, 0)!=0;
1958 Th_InitTraceLog();
1959 zPort = find_option("port", "P", 1);
1960 zNotFound = find_option("notfound", 0, 1);
1961 zAltBase = find_option("baseurl", 0, 1);
1962
--- src/main.c
+++ src/main.c
@@ -1951,11 +1951,18 @@
1951 #if defined(_WIN32)
1952 const char *zStopperFile; /* Name of file used to terminate server */
1953 zStopperFile = find_option("stopper", 0, 1);
1954 #endif
1955
1956 zFileGlob = find_option("files-urlenc",0,1);
1957 if( zFileGlob ){
1958 char *z = mprintf("%s", zFileGlob);
1959 dehttpize(z);
1960 zFileGlob = z;
1961 }else{
1962 zFileGlob = find_option("files",0,1);
1963 }
1964 g.useLocalauth = find_option("localauth", 0, 0)!=0;
1965 Th_InitTraceLog();
1966 zPort = find_option("port", "P", 1);
1967 zNotFound = find_option("notfound", 0, 1);
1968 zAltBase = find_option("baseurl", 0, 1);
1969
+8 -1
--- src/main.c
+++ src/main.c
@@ -1951,11 +1951,18 @@
19511951
#if defined(_WIN32)
19521952
const char *zStopperFile; /* Name of file used to terminate server */
19531953
zStopperFile = find_option("stopper", 0, 1);
19541954
#endif
19551955
1956
- zFileGlob = find_option("files", 0, 1);
1956
+ zFileGlob = find_option("files-urlenc",0,1);
1957
+ if( zFileGlob ){
1958
+ char *z = mprintf("%s", zFileGlob);
1959
+ dehttpize(z);
1960
+ zFileGlob = z;
1961
+ }else{
1962
+ zFileGlob = find_option("files",0,1);
1963
+ }
19571964
g.useLocalauth = find_option("localauth", 0, 0)!=0;
19581965
Th_InitTraceLog();
19591966
zPort = find_option("port", "P", 1);
19601967
zNotFound = find_option("notfound", 0, 1);
19611968
zAltBase = find_option("baseurl", 0, 1);
19621969
--- src/main.c
+++ src/main.c
@@ -1951,11 +1951,18 @@
1951 #if defined(_WIN32)
1952 const char *zStopperFile; /* Name of file used to terminate server */
1953 zStopperFile = find_option("stopper", 0, 1);
1954 #endif
1955
1956 zFileGlob = find_option("files", 0, 1);
 
 
 
 
 
 
 
1957 g.useLocalauth = find_option("localauth", 0, 0)!=0;
1958 Th_InitTraceLog();
1959 zPort = find_option("port", "P", 1);
1960 zNotFound = find_option("notfound", 0, 1);
1961 zAltBase = find_option("baseurl", 0, 1);
1962
--- src/main.c
+++ src/main.c
@@ -1951,11 +1951,18 @@
1951 #if defined(_WIN32)
1952 const char *zStopperFile; /* Name of file used to terminate server */
1953 zStopperFile = find_option("stopper", 0, 1);
1954 #endif
1955
1956 zFileGlob = find_option("files-urlenc",0,1);
1957 if( zFileGlob ){
1958 char *z = mprintf("%s", zFileGlob);
1959 dehttpize(z);
1960 zFileGlob = z;
1961 }else{
1962 zFileGlob = find_option("files",0,1);
1963 }
1964 g.useLocalauth = find_option("localauth", 0, 0)!=0;
1965 Th_InitTraceLog();
1966 zPort = find_option("port", "P", 1);
1967 zNotFound = find_option("notfound", 0, 1);
1968 zAltBase = find_option("baseurl", 0, 1);
1969
+8 -1
--- src/main.c
+++ src/main.c
@@ -1951,11 +1951,18 @@
19511951
#if defined(_WIN32)
19521952
const char *zStopperFile; /* Name of file used to terminate server */
19531953
zStopperFile = find_option("stopper", 0, 1);
19541954
#endif
19551955
1956
- zFileGlob = find_option("files", 0, 1);
1956
+ zFileGlob = find_option("files-urlenc",0,1);
1957
+ if( zFileGlob ){
1958
+ char *z = mprintf("%s", zFileGlob);
1959
+ dehttpize(z);
1960
+ zFileGlob = z;
1961
+ }else{
1962
+ zFileGlob = find_option("files",0,1);
1963
+ }
19571964
g.useLocalauth = find_option("localauth", 0, 0)!=0;
19581965
Th_InitTraceLog();
19591966
zPort = find_option("port", "P", 1);
19601967
zNotFound = find_option("notfound", 0, 1);
19611968
zAltBase = find_option("baseurl", 0, 1);
19621969
--- src/main.c
+++ src/main.c
@@ -1951,11 +1951,18 @@
1951 #if defined(_WIN32)
1952 const char *zStopperFile; /* Name of file used to terminate server */
1953 zStopperFile = find_option("stopper", 0, 1);
1954 #endif
1955
1956 zFileGlob = find_option("files", 0, 1);
 
 
 
 
 
 
 
1957 g.useLocalauth = find_option("localauth", 0, 0)!=0;
1958 Th_InitTraceLog();
1959 zPort = find_option("port", "P", 1);
1960 zNotFound = find_option("notfound", 0, 1);
1961 zAltBase = find_option("baseurl", 0, 1);
1962
--- src/main.c
+++ src/main.c
@@ -1951,11 +1951,18 @@
1951 #if defined(_WIN32)
1952 const char *zStopperFile; /* Name of file used to terminate server */
1953 zStopperFile = find_option("stopper", 0, 1);
1954 #endif
1955
1956 zFileGlob = find_option("files-urlenc",0,1);
1957 if( zFileGlob ){
1958 char *z = mprintf("%s", zFileGlob);
1959 dehttpize(z);
1960 zFileGlob = z;
1961 }else{
1962 zFileGlob = find_option("files",0,1);
1963 }
1964 g.useLocalauth = find_option("localauth", 0, 0)!=0;
1965 Th_InitTraceLog();
1966 zPort = find_option("port", "P", 1);
1967 zNotFound = find_option("notfound", 0, 1);
1968 zAltBase = find_option("baseurl", 0, 1);
1969
+6 -1
--- src/winhttp.c
+++ src/winhttp.c
@@ -688,10 +688,15 @@
688688
}
689689
/* Process service creation specific options. */
690690
if( !zDisplay ){
691691
zDisplay = zSvcName;
692692
}
693
+ /* Per MSDN, the password parameter cannot be NULL. Must use empty
694
+ ** string instead (i.e. in the call to CreateServiceW). */
695
+ if( !zPassword ){
696
+ zPassword = "";
697
+ }
693698
if( zStart ){
694699
if( strncmp(zStart, "auto", strlen(zStart))==0 ){
695700
dwStartType = SERVICE_AUTO_START;
696701
}else if( strncmp(zStart, "manual", strlen(zStart))==0 ){
697702
dwStartType = SERVICE_DEMAND_START;
@@ -736,11 +741,11 @@
736741
SERVICE_ERROR_NORMAL, /* Error control */
737742
fossil_utf8_to_unicode(blob_str(&binPath)), /* Binary path */
738743
NULL, /* Load ordering group */
739744
NULL, /* Tag value */
740745
NULL, /* Service dependencies */
741
- fossil_utf8_to_unicode(zUsername), /* Service account */
746
+ zUsername ? fossil_utf8_to_unicode(zUsername) : 0, /* Account */
742747
fossil_utf8_to_unicode(zPassword) /* Account password */
743748
);
744749
if( !hSvc ) fossil_fatal(zErrFmt, zSvcName, win32_get_last_errmsg());
745750
/* Set the service description. */
746751
ChangeServiceConfig2W(hSvc, SERVICE_CONFIG_DESCRIPTION, &svcDescr);
747752
--- src/winhttp.c
+++ src/winhttp.c
@@ -688,10 +688,15 @@
688 }
689 /* Process service creation specific options. */
690 if( !zDisplay ){
691 zDisplay = zSvcName;
692 }
 
 
 
 
 
693 if( zStart ){
694 if( strncmp(zStart, "auto", strlen(zStart))==0 ){
695 dwStartType = SERVICE_AUTO_START;
696 }else if( strncmp(zStart, "manual", strlen(zStart))==0 ){
697 dwStartType = SERVICE_DEMAND_START;
@@ -736,11 +741,11 @@
736 SERVICE_ERROR_NORMAL, /* Error control */
737 fossil_utf8_to_unicode(blob_str(&binPath)), /* Binary path */
738 NULL, /* Load ordering group */
739 NULL, /* Tag value */
740 NULL, /* Service dependencies */
741 fossil_utf8_to_unicode(zUsername), /* Service account */
742 fossil_utf8_to_unicode(zPassword) /* Account password */
743 );
744 if( !hSvc ) fossil_fatal(zErrFmt, zSvcName, win32_get_last_errmsg());
745 /* Set the service description. */
746 ChangeServiceConfig2W(hSvc, SERVICE_CONFIG_DESCRIPTION, &svcDescr);
747
--- src/winhttp.c
+++ src/winhttp.c
@@ -688,10 +688,15 @@
688 }
689 /* Process service creation specific options. */
690 if( !zDisplay ){
691 zDisplay = zSvcName;
692 }
693 /* Per MSDN, the password parameter cannot be NULL. Must use empty
694 ** string instead (i.e. in the call to CreateServiceW). */
695 if( !zPassword ){
696 zPassword = "";
697 }
698 if( zStart ){
699 if( strncmp(zStart, "auto", strlen(zStart))==0 ){
700 dwStartType = SERVICE_AUTO_START;
701 }else if( strncmp(zStart, "manual", strlen(zStart))==0 ){
702 dwStartType = SERVICE_DEMAND_START;
@@ -736,11 +741,11 @@
741 SERVICE_ERROR_NORMAL, /* Error control */
742 fossil_utf8_to_unicode(blob_str(&binPath)), /* Binary path */
743 NULL, /* Load ordering group */
744 NULL, /* Tag value */
745 NULL, /* Service dependencies */
746 zUsername ? fossil_utf8_to_unicode(zUsername) : 0, /* Account */
747 fossil_utf8_to_unicode(zPassword) /* Account password */
748 );
749 if( !hSvc ) fossil_fatal(zErrFmt, zSvcName, win32_get_last_errmsg());
750 /* Set the service description. */
751 ChangeServiceConfig2W(hSvc, SERVICE_CONFIG_DESCRIPTION, &svcDescr);
752
+6 -1
--- src/winhttp.c
+++ src/winhttp.c
@@ -688,10 +688,15 @@
688688
}
689689
/* Process service creation specific options. */
690690
if( !zDisplay ){
691691
zDisplay = zSvcName;
692692
}
693
+ /* Per MSDN, the password parameter cannot be NULL. Must use empty
694
+ ** string instead (i.e. in the call to CreateServiceW). */
695
+ if( !zPassword ){
696
+ zPassword = "";
697
+ }
693698
if( zStart ){
694699
if( strncmp(zStart, "auto", strlen(zStart))==0 ){
695700
dwStartType = SERVICE_AUTO_START;
696701
}else if( strncmp(zStart, "manual", strlen(zStart))==0 ){
697702
dwStartType = SERVICE_DEMAND_START;
@@ -736,11 +741,11 @@
736741
SERVICE_ERROR_NORMAL, /* Error control */
737742
fossil_utf8_to_unicode(blob_str(&binPath)), /* Binary path */
738743
NULL, /* Load ordering group */
739744
NULL, /* Tag value */
740745
NULL, /* Service dependencies */
741
- fossil_utf8_to_unicode(zUsername), /* Service account */
746
+ zUsername ? fossil_utf8_to_unicode(zUsername) : 0, /* Account */
742747
fossil_utf8_to_unicode(zPassword) /* Account password */
743748
);
744749
if( !hSvc ) fossil_fatal(zErrFmt, zSvcName, win32_get_last_errmsg());
745750
/* Set the service description. */
746751
ChangeServiceConfig2W(hSvc, SERVICE_CONFIG_DESCRIPTION, &svcDescr);
747752
--- src/winhttp.c
+++ src/winhttp.c
@@ -688,10 +688,15 @@
688 }
689 /* Process service creation specific options. */
690 if( !zDisplay ){
691 zDisplay = zSvcName;
692 }
 
 
 
 
 
693 if( zStart ){
694 if( strncmp(zStart, "auto", strlen(zStart))==0 ){
695 dwStartType = SERVICE_AUTO_START;
696 }else if( strncmp(zStart, "manual", strlen(zStart))==0 ){
697 dwStartType = SERVICE_DEMAND_START;
@@ -736,11 +741,11 @@
736 SERVICE_ERROR_NORMAL, /* Error control */
737 fossil_utf8_to_unicode(blob_str(&binPath)), /* Binary path */
738 NULL, /* Load ordering group */
739 NULL, /* Tag value */
740 NULL, /* Service dependencies */
741 fossil_utf8_to_unicode(zUsername), /* Service account */
742 fossil_utf8_to_unicode(zPassword) /* Account password */
743 );
744 if( !hSvc ) fossil_fatal(zErrFmt, zSvcName, win32_get_last_errmsg());
745 /* Set the service description. */
746 ChangeServiceConfig2W(hSvc, SERVICE_CONFIG_DESCRIPTION, &svcDescr);
747
--- src/winhttp.c
+++ src/winhttp.c
@@ -688,10 +688,15 @@
688 }
689 /* Process service creation specific options. */
690 if( !zDisplay ){
691 zDisplay = zSvcName;
692 }
693 /* Per MSDN, the password parameter cannot be NULL. Must use empty
694 ** string instead (i.e. in the call to CreateServiceW). */
695 if( !zPassword ){
696 zPassword = "";
697 }
698 if( zStart ){
699 if( strncmp(zStart, "auto", strlen(zStart))==0 ){
700 dwStartType = SERVICE_AUTO_START;
701 }else if( strncmp(zStart, "manual", strlen(zStart))==0 ){
702 dwStartType = SERVICE_DEMAND_START;
@@ -736,11 +741,11 @@
741 SERVICE_ERROR_NORMAL, /* Error control */
742 fossil_utf8_to_unicode(blob_str(&binPath)), /* Binary path */
743 NULL, /* Load ordering group */
744 NULL, /* Tag value */
745 NULL, /* Service dependencies */
746 zUsername ? fossil_utf8_to_unicode(zUsername) : 0, /* Account */
747 fossil_utf8_to_unicode(zPassword) /* Account password */
748 );
749 if( !hSvc ) fossil_fatal(zErrFmt, zSvcName, win32_get_last_errmsg());
750 /* Set the service description. */
751 ChangeServiceConfig2W(hSvc, SERVICE_CONFIG_DESCRIPTION, &svcDescr);
752
+6 -1
--- src/winhttp.c
+++ src/winhttp.c
@@ -688,10 +688,15 @@
688688
}
689689
/* Process service creation specific options. */
690690
if( !zDisplay ){
691691
zDisplay = zSvcName;
692692
}
693
+ /* Per MSDN, the password parameter cannot be NULL. Must use empty
694
+ ** string instead (i.e. in the call to CreateServiceW). */
695
+ if( !zPassword ){
696
+ zPassword = "";
697
+ }
693698
if( zStart ){
694699
if( strncmp(zStart, "auto", strlen(zStart))==0 ){
695700
dwStartType = SERVICE_AUTO_START;
696701
}else if( strncmp(zStart, "manual", strlen(zStart))==0 ){
697702
dwStartType = SERVICE_DEMAND_START;
@@ -736,11 +741,11 @@
736741
SERVICE_ERROR_NORMAL, /* Error control */
737742
fossil_utf8_to_unicode(blob_str(&binPath)), /* Binary path */
738743
NULL, /* Load ordering group */
739744
NULL, /* Tag value */
740745
NULL, /* Service dependencies */
741
- fossil_utf8_to_unicode(zUsername), /* Service account */
746
+ zUsername ? fossil_utf8_to_unicode(zUsername) : 0, /* Account */
742747
fossil_utf8_to_unicode(zPassword) /* Account password */
743748
);
744749
if( !hSvc ) fossil_fatal(zErrFmt, zSvcName, win32_get_last_errmsg());
745750
/* Set the service description. */
746751
ChangeServiceConfig2W(hSvc, SERVICE_CONFIG_DESCRIPTION, &svcDescr);
747752
--- src/winhttp.c
+++ src/winhttp.c
@@ -688,10 +688,15 @@
688 }
689 /* Process service creation specific options. */
690 if( !zDisplay ){
691 zDisplay = zSvcName;
692 }
 
 
 
 
 
693 if( zStart ){
694 if( strncmp(zStart, "auto", strlen(zStart))==0 ){
695 dwStartType = SERVICE_AUTO_START;
696 }else if( strncmp(zStart, "manual", strlen(zStart))==0 ){
697 dwStartType = SERVICE_DEMAND_START;
@@ -736,11 +741,11 @@
736 SERVICE_ERROR_NORMAL, /* Error control */
737 fossil_utf8_to_unicode(blob_str(&binPath)), /* Binary path */
738 NULL, /* Load ordering group */
739 NULL, /* Tag value */
740 NULL, /* Service dependencies */
741 fossil_utf8_to_unicode(zUsername), /* Service account */
742 fossil_utf8_to_unicode(zPassword) /* Account password */
743 );
744 if( !hSvc ) fossil_fatal(zErrFmt, zSvcName, win32_get_last_errmsg());
745 /* Set the service description. */
746 ChangeServiceConfig2W(hSvc, SERVICE_CONFIG_DESCRIPTION, &svcDescr);
747
--- src/winhttp.c
+++ src/winhttp.c
@@ -688,10 +688,15 @@
688 }
689 /* Process service creation specific options. */
690 if( !zDisplay ){
691 zDisplay = zSvcName;
692 }
693 /* Per MSDN, the password parameter cannot be NULL. Must use empty
694 ** string instead (i.e. in the call to CreateServiceW). */
695 if( !zPassword ){
696 zPassword = "";
697 }
698 if( zStart ){
699 if( strncmp(zStart, "auto", strlen(zStart))==0 ){
700 dwStartType = SERVICE_AUTO_START;
701 }else if( strncmp(zStart, "manual", strlen(zStart))==0 ){
702 dwStartType = SERVICE_DEMAND_START;
@@ -736,11 +741,11 @@
741 SERVICE_ERROR_NORMAL, /* Error control */
742 fossil_utf8_to_unicode(blob_str(&binPath)), /* Binary path */
743 NULL, /* Load ordering group */
744 NULL, /* Tag value */
745 NULL, /* Service dependencies */
746 zUsername ? fossil_utf8_to_unicode(zUsername) : 0, /* Account */
747 fossil_utf8_to_unicode(zPassword) /* Account password */
748 );
749 if( !hSvc ) fossil_fatal(zErrFmt, zSvcName, win32_get_last_errmsg());
750 /* Set the service description. */
751 ChangeServiceConfig2W(hSvc, SERVICE_CONFIG_DESCRIPTION, &svcDescr);
752

Keyboard Shortcuts

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