1
0
Fork 0

allow binding of httpd to an address, not just a port

support --httpd=127.0.0.1:8080
This commit is contained in:
Torsten Dreyer 2014-03-29 22:07:12 +01:00
parent 390f6dd32d
commit 44ba076720

View file

@ -953,10 +953,12 @@ fgOptStartDateGmt( const char *arg )
static int static int
fgOptHttpd( const char * arg ) fgOptHttpd( const char * arg )
{ {
int port = atoi(arg); // port may be any valid address:port notation
if( port > 0 ) { // like 127.0.0.1:8080
fgSetInt( string(flightgear::http::PROPERTY_ROOT).append("/options/listening-port").c_str(), port ); // or just the port 8080
} string port = simgear::strutils::strip(string(arg));
if( port.empty() ) return FG_OPTIONS_ERROR;
fgSetString( string(flightgear::http::PROPERTY_ROOT).append("/options/listening-port").c_str(), port );
return FG_OPTIONS_OK; return FG_OPTIONS_OK;
} }