Merge branch 'next' of http://git.gitorious.org/fg/flightgear into next
This commit is contained in:
commit
41e69a0795
1 changed files with 12 additions and 1 deletions
|
@ -46,6 +46,7 @@
|
||||||
#include <simgear/misc/sg_path.hxx>
|
#include <simgear/misc/sg_path.hxx>
|
||||||
#include <simgear/scene/material/mat.hxx>
|
#include <simgear/scene/material/mat.hxx>
|
||||||
#include <simgear/sound/soundmgr_openal.hxx>
|
#include <simgear/sound/soundmgr_openal.hxx>
|
||||||
|
#include <simgear/misc/strutils.hxx>
|
||||||
#include <Autopilot/route_mgr.hxx>
|
#include <Autopilot/route_mgr.hxx>
|
||||||
#include <GUI/gui.h>
|
#include <GUI/gui.h>
|
||||||
|
|
||||||
|
@ -98,6 +99,8 @@ atoi( const string& str )
|
||||||
return ::atoi( str.c_str() );
|
return ::atoi( str.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int fgSetupProxy( const char *arg );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a few fail-safe default property values.
|
* Set a few fail-safe default property values.
|
||||||
*
|
*
|
||||||
|
@ -245,6 +248,8 @@ fgSetDefaults ()
|
||||||
fgSetString("/sim/version/revision", REVISION);
|
fgSetString("/sim/version/revision", REVISION);
|
||||||
fgSetInt("/sim/version/build-number", HUDSON_BUILD_NUMBER);
|
fgSetInt("/sim/version/build-number", HUDSON_BUILD_NUMBER);
|
||||||
fgSetString("/sim/version/build-id", HUDSON_BUILD_ID);
|
fgSetString("/sim/version/build-id", HUDSON_BUILD_ID);
|
||||||
|
if( (envp = ::getenv( "http_proxy" )) != NULL )
|
||||||
|
fgSetupProxy( envp );
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
@ -896,10 +901,16 @@ fgOptStartDateGmt( const char *arg )
|
||||||
static int
|
static int
|
||||||
fgSetupProxy( const char *arg )
|
fgSetupProxy( const char *arg )
|
||||||
{
|
{
|
||||||
string options = arg;
|
string options = simgear::strutils::strip( arg );
|
||||||
string host, port, auth;
|
string host, port, auth;
|
||||||
string::size_type pos;
|
string::size_type pos;
|
||||||
|
|
||||||
|
// this is NURLP - NURLP is not an url parser
|
||||||
|
if( simgear::strutils::starts_with( options, "http://" ) )
|
||||||
|
options = options.substr( 7 );
|
||||||
|
if( simgear::strutils::ends_with( options, "/" ) )
|
||||||
|
options = options.substr( 0, options.length() - 1 );
|
||||||
|
|
||||||
host = port = auth = "";
|
host = port = auth = "";
|
||||||
if ((pos = options.find("@")) != string::npos)
|
if ((pos = options.find("@")) != string::npos)
|
||||||
auth = options.substr(0, pos++);
|
auth = options.substr(0, pos++);
|
||||||
|
|
Loading…
Add table
Reference in a new issue