chunkd: add ForceHost
PATCH 1/1 chunkd: add ForceHost
Add the same crutch that tabled has, to help with misconfigured build machines.
Signed-off-by Pete Zaitcev <[email protected]>
server/config.c +6 -0
@@ -256,6 +256,12 @@ static void cfg_elm_end (GMarkupParseCon cc->text =NULL ; } +else if (!strcmp (element_name,"ForceHost" ) && cc->text) { +free (chunkd_srv.ourhost); + chunkd_srv.ourhost = cc->text; + cc->text =NULL ; + } +else if (!strcmp (element_name,"Path" ) && cc->text) {if (stat (cc->text, &st) <0 ) { applog(LOG_ERR, "stat(2) cfgfile Path '%s' failed: %s",
server/server.c +5 -1
@@ -1284,7 +1284,11 @@ int main (int argc, char *argv[])* early as possible, so that tunables are available. */ read_config (); - chunkd_srv.ourhost =get_hostname (); +if (!chunkd_srv.ourhost) + chunkd_srv.ourhost =get_hostname (); +else if (debugging) +applog (LOG_INFO ,"Forcing local hostname to %s" , + chunkd_srv.ourhost);/* * For example, backgrounding and PID file should be done early
test/server-test.cfg +1 -0
@@ -1,4 +1,5 @@ +<ForceHost>localhost.localdomain</ForceHost> <SSL> <PrivateKey>ssl-key.pem</PrivateKey> <Cert>ssl-cert.pem</Cert>
Jeff Garzik
AppliedQuoted 4 lines · Pete Zaitcev
Add the same crutch that tabled has, to help with misconfigured build machines.
Signed-off-by Pete Zaitcev<[email protected]>
applied