Patch level :4.0 872
Files correlati : Ricompilazione Demo : [ ] Commento :correzioni al server git-svn-id: svn://10.65.10.50/trunk@16094 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5b3f043a53
commit
5889a1d616
@ -608,7 +608,7 @@ wxString TBaseServerApp::GetLogFileName() const
|
||||
|
||||
wxString TBaseServerApp::GetDocumentRoot() const
|
||||
{
|
||||
return GetConfigString("DocumentRoot", ".");
|
||||
return GetConfigString("DocumentRoot", m_strPath);
|
||||
}
|
||||
|
||||
bool TBaseServerApp::OnInit()
|
||||
@ -624,10 +624,13 @@ bool TBaseServerApp::OnInit()
|
||||
return false;
|
||||
}
|
||||
|
||||
wxString path;
|
||||
wxFileName::SplitPath(argv[0], &path, NULL, NULL);
|
||||
if (!path.IsEmpty())
|
||||
wxSetWorkingDirectory(path);
|
||||
wxFileName::SplitPath(argv[0], &m_strPath, NULL, NULL);
|
||||
if (!m_strPath.IsEmpty())
|
||||
{
|
||||
wxSetWorkingDirectory(m_strPath);
|
||||
if (!wxEndsWithPathSeparator(m_strPath))
|
||||
m_strPath += wxFILE_SEP_PATH;
|
||||
}
|
||||
|
||||
// Create the address - defaults to localhost:0 initially
|
||||
wxIPV4address addr;
|
||||
|
@ -82,7 +82,7 @@ class TBaseServerApp : public wxApp
|
||||
private:
|
||||
wxSocketServer* m_server;
|
||||
wxFileOutputStream* m_log;
|
||||
wxString m_strTempDir, m_strIni;
|
||||
wxString m_strPath, m_strTempDir, m_strIni;
|
||||
bool m_bRunning;
|
||||
int m_nTmpCounter;
|
||||
|
||||
@ -96,6 +96,7 @@ protected:
|
||||
virtual void ProcessCommand(wxString cmd, wxSocketBase& outs);
|
||||
virtual bool CanProcessCommand(wxString& cmd, wxSocketBase& outs);
|
||||
|
||||
virtual const wxString& GetServerPath() const { return m_strPath; }
|
||||
virtual wxString GetDocumentRoot() const;
|
||||
|
||||
virtual TXmlItem& AddLogo(TXmlItem& td) const;
|
||||
|
@ -423,15 +423,9 @@ bool TLurchServer::Initialization()
|
||||
const wxSingleInstanceChecker sic(strApp);
|
||||
if (!sic.IsAnotherRunning())
|
||||
{
|
||||
wxString strRun = GetConfigString("Run", "", strApp);
|
||||
wxString strRun = GetServerPath() + GetConfigString("Run", "", strApp);
|
||||
if (wxFileExists(strRun))
|
||||
{
|
||||
#ifdef LINUX
|
||||
if (strRun[ 0u] != '/' && strRun[ 0u] != '.')
|
||||
strRun = "./" + strRun;
|
||||
#endif
|
||||
wxExecute(strRun);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user