fixed server crash; fixed timeout on file download; minor refactoring
authorVictor Kirhenshtein <victor@netxms.org>
Wed, 20 May 2015 15:44:50 +0000 (18:44 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Wed, 20 May 2015 15:44:50 +0000 (18:44 +0300)
include/nxmbapi.h
src/java/client/netxms-client/src/main/java/org/netxms/client/NXCSession.java
src/libnxmb/dispatcher.cpp
src/libnxsl/library.cpp

index 65be0d5..807bc0f 100644 (file)
@@ -128,12 +128,12 @@ public:
  */
 class LIBNXMB_EXPORTABLE NXMBDispatcher
 {
-       friend THREAD_RESULT THREAD_CALL WorkerThreadStarter(void *);
-
 private:
    static MUTEX m_instanceAccess;
        static NXMBDispatcher *m_instance;
 
+       static THREAD_RESULT THREAD_CALL workerThreadStarter(void *);
+
 protected:
        Queue *m_queue;
        int m_numSubscribers;
index aca2986..4077b2a 100644 (file)
@@ -6952,8 +6952,8 @@ public class NXCSession
       final NXCPMessage response = waitForRCC(msg.getMessageId()); // first confirmation - server job started
       final String id = response.getFieldAsString(NXCPCodes.VID_NAME);
       
-      waitForRCC(msg.getMessageId()); // second confirmation - file transfered from agent to console
       AgentFile file =  new AgentFile(id, waitForFile(msg.getMessageId(), 36000000));
+      waitForRCC(msg.getMessageId()); // second confirmation - file transfered from agent to console
       return file;
    }
    
index 7439a4e..7472ec9 100644 (file)
@@ -26,7 +26,7 @@
 /**
  * Worker thread starter
  */
-THREAD_RESULT THREAD_CALL WorkerThreadStarter(void *arg)
+THREAD_RESULT THREAD_CALL NXMBDispatcher::workerThreadStarter(void *arg)
 {
        ((NXMBDispatcher *)arg)->workerThread();
        return THREAD_OK;
@@ -42,7 +42,7 @@ NXMBDispatcher::NXMBDispatcher()
        m_subscribers = NULL;
        m_filters = NULL;
        m_subscriberListAccess = MutexCreate();
-       m_workerThreadHandle = ThreadCreateEx(WorkerThreadStarter, 0, this);
+       m_workerThreadHandle = ThreadCreateEx(NXMBDispatcher::workerThreadStarter, 0, this);
    m_callHandlers = new CallHandlerMap();
    m_callHandlerAccess = MutexCreate();
 }
index 0f9d2a7..c70e17a 100644 (file)
@@ -142,7 +142,6 @@ NXSL_VM *NXSL_Library::createVM(const TCHAR *name, NXSL_Environment *env)
       if (!vm->load(p))
       {
          delete vm;
-         delete env;
          vm = NULL;
       }
    }