summaryrefslogtreecommitdiff
path: root/plugins/HTTPServer
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2013-02-02 15:35:23 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2013-02-02 15:35:23 +0000
commitf2ed2a1f6db7eea018e07eeaef5747eb4e9f0a35 (patch)
treedf136df38ee97a9dd9796dc57b7dcf5433bc86c5 /plugins/HTTPServer
parentb9e6d6ada8c8cee53991783832a902eecc0e6dce (diff)
- Do not load plugin when a fatal error occures
- fixed error on CreateDirTree (fixes #208) git-svn-id: http://svn.miranda-ng.org/main/trunk@3394 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/HTTPServer')
-rw-r--r--plugins/HTTPServer/src/main.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp
index 68eca1ea7a..561218666a 100644
--- a/plugins/HTTPServer/src/main.cpp
+++ b/plugins/HTTPServer/src/main.cpp
@@ -879,50 +879,51 @@ int nSystemShutdown(WPARAM /*wparam*/, LPARAM /*lparam*/) {
hHttpAcceptConnectionsService = CreateServiceFunction(MS_HTTP_ACCEPT_CONNECTIONS, nToggelAcceptConnections);
if (! hHttpAcceptConnectionsService) {
MessageBox(NULL, _T("Failed to CreateServiceFunction MS_HTTP_ACCEPT_CONNECTIONS"), MSG_BOX_TITEL, MB_OK);
- return 0;
+ return 1;
}
hHttpAddChangeRemoveService = CreateServiceFunction(MS_HTTP_ADD_CHANGE_REMOVE, nAddChangeRemoveShare);
if (! hHttpAddChangeRemoveService) {
MessageBox(NULL, _T("Failed to CreateServiceFunction MS_HTTP_ADD_CHANGE_REMOVE"), MSG_BOX_TITEL, MB_OK);
- return 0;
+ return 1;
}
hHttpGetShareService = CreateServiceFunction(MS_HTTP_GET_SHARE, nGetShare);
if (! hHttpGetShareService) {
MessageBox(NULL, _T("Failed to CreateServiceFunction MS_HTTP_GET_SHARE"), MSG_BOX_TITEL, MB_OK);
- return 0;
+ return 1;
}
hHttpGetAllShares = CreateServiceFunction(MS_HTTP_GET_ALL_SHARES, nHttpGetAllShares);
if (! hHttpGetAllShares) {
MessageBox(NULL, _T("Failed to CreateServiceFunction MS_HTTP_GET_ALL_SHARES"), MSG_BOX_TITEL, MB_OK);
- return 0;
+ return 1;
}
hEventSystemInit = HookEvent(ME_SYSTEM_MODULESLOADED, MainInit);
if (!hEventSystemInit) {
MessageBox(NULL, _T("Failed to HookEvent ME_SYSTEM_MODULESLOADED"), MSG_BOX_TITEL, MB_OK);
- return 0;
+ return 1;
}
hPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
if (!hPreShutdown) {
MessageBox(NULL, _T("Failed to HookEvent ME_SYSTEM_PRESHUTDOWN"), MSG_BOX_TITEL, MB_OK);
- return 0;
+ return 1;
}
if(CallService(MS_DB_GETPROFILEPATH,MAX_PATH,(LPARAM)szPluginPath))
{
MessageBox(NULL, _T("Failed to retrieve plugin path."), MSG_BOX_TITEL, MB_OK);
- return 0;
+ return 1;
}
- _tcscat(szPluginPath,_T("\\HTTPServer\\"));
- if(CreateDirectoryTree(szPluginPath))
+ _tcsncat(szPluginPath,_T("\\HTTPServer\\"), MAX_PATH);
+ int err = CreateDirectoryTree(szPluginPath)
+ if((err != 0) && (err != ERROR_ALREADY_EXISTS))
{
MessageBox(NULL, _T("Failed to create HTTPServer directory."), MSG_BOX_TITEL, MB_OK);
- return 0;
+ return 1;
}
nPluginPathLen = strlen(szPluginPath);