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:
luca 2008-02-05 10:52:12 +00:00
parent 5b3f043a53
commit 5889a1d616
3 changed files with 11 additions and 13 deletions

View File

@ -608,7 +608,7 @@ wxString TBaseServerApp::GetLogFileName() const
wxString TBaseServerApp::GetDocumentRoot() const wxString TBaseServerApp::GetDocumentRoot() const
{ {
return GetConfigString("DocumentRoot", "."); return GetConfigString("DocumentRoot", m_strPath);
} }
bool TBaseServerApp::OnInit() bool TBaseServerApp::OnInit()
@ -624,10 +624,13 @@ bool TBaseServerApp::OnInit()
return false; return false;
} }
wxString path; wxFileName::SplitPath(argv[0], &m_strPath, NULL, NULL);
wxFileName::SplitPath(argv[0], &path, NULL, NULL); if (!m_strPath.IsEmpty())
if (!path.IsEmpty()) {
wxSetWorkingDirectory(path); wxSetWorkingDirectory(m_strPath);
if (!wxEndsWithPathSeparator(m_strPath))
m_strPath += wxFILE_SEP_PATH;
}
// Create the address - defaults to localhost:0 initially // Create the address - defaults to localhost:0 initially
wxIPV4address addr; wxIPV4address addr;

View File

@ -82,7 +82,7 @@ class TBaseServerApp : public wxApp
private: private:
wxSocketServer* m_server; wxSocketServer* m_server;
wxFileOutputStream* m_log; wxFileOutputStream* m_log;
wxString m_strTempDir, m_strIni; wxString m_strPath, m_strTempDir, m_strIni;
bool m_bRunning; bool m_bRunning;
int m_nTmpCounter; int m_nTmpCounter;
@ -96,6 +96,7 @@ protected:
virtual void ProcessCommand(wxString cmd, wxSocketBase& outs); virtual void ProcessCommand(wxString cmd, wxSocketBase& outs);
virtual bool CanProcessCommand(wxString& cmd, wxSocketBase& outs); virtual bool CanProcessCommand(wxString& cmd, wxSocketBase& outs);
virtual const wxString& GetServerPath() const { return m_strPath; }
virtual wxString GetDocumentRoot() const; virtual wxString GetDocumentRoot() const;
virtual TXmlItem& AddLogo(TXmlItem& td) const; virtual TXmlItem& AddLogo(TXmlItem& td) const;

View File

@ -423,15 +423,9 @@ bool TLurchServer::Initialization()
const wxSingleInstanceChecker sic(strApp); const wxSingleInstanceChecker sic(strApp);
if (!sic.IsAnotherRunning()) if (!sic.IsAnotherRunning())
{ {
wxString strRun = GetConfigString("Run", "", strApp); wxString strRun = GetServerPath() + GetConfigString("Run", "", strApp);
if (wxFileExists(strRun)) if (wxFileExists(strRun))
{
#ifdef LINUX
if (strRun[ 0u] != '/' && strRun[ 0u] != '.')
strRun = "./" + strRun;
#endif
wxExecute(strRun); wxExecute(strRun);
}
} }
} }
} }