commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-commons-sandbox/daemon/src/native/nt/procrun procgui.c procrun.c procrun.h procrun.rc
Date Mon, 05 May 2003 16:05:50 GMT
mturk       2003/05/05 09:05:49

  Modified:    daemon/src/native/nt/procrun procgui.c procrun.c procrun.h
                        procrun.rc
  Log:
  Bug Fixes:
  1. Dont setting WorkingPath
  2. Error setting JavaOptions
  3. Create pool for setting to enable multiple settings from same instance.
  Bump version to 1.0.1
  
  Revision  Changes    Path
  1.17      +22 -3     jakarta-commons-sandbox/daemon/src/native/nt/procrun/procgui.c
  
  Index: procgui.c
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/daemon/src/native/nt/procrun/procgui.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- procgui.c	3 May 2003 08:52:02 -0000	1.16
  +++ procgui.c	5 May 2003 16:05:47 -0000	1.17
  @@ -576,27 +576,35 @@
               switch (lpnmhdr->code) {
                   case PSN_APPLY:   /* sent when OK or Apply button pressed */
                   memcpy(&p, g_env->m, sizeof(process_t));
  +                p.pool = pool_create();
  +                p.service.name = g_env->m->service.name;
  +                argc = 2;
                   if (GetDlgItemText(hdlg, RC_TXT_SD, txt, 4095) > 0) {
                       argv[argc++] = "--" PROCRUN_PARAMS_DESCRIPTION;
                       argv[argc++] = &txt[0];
  +                    argv[argc] = NULL;
                       procrun_update_service(&p, argc, argv);
                   }
                   if (GetDlgItemText(hdlg, RC_TXT_IP, txt, 4095) > 0) {
                       argc = 2;
                       argv[argc++] = "--" PROCRUN_PARAMS_IMAGE;
                       argv[argc++] = &txt[0];
  +                    argv[argc] = NULL;
                       procrun_update_service(&p, argc, argv);
                   }
                   if (GetDlgItemText(hdlg, RC_TXT_WP, txt, 4095) > 0) {
                       argc = 2;
                       argv[argc++] = "--" PROCRUN_PARAMS_WORKPATH;
                       argv[argc++] = &txt[0];
  +                    argv[argc] = NULL;
  +                    OutputDebugString(txt);
                       procrun_update_service(&p, argc, argv);
                   }
                   if (GetDlgItemText(hdlg, RC_TXT_UN, txt, 64) > 0) {
                       argc = 2;
                       argv[argc++] = "--" PROCRUN_PARAMS_ACCOUNT;
                       argv[argc++] = &txt[0];
  +                    argv[argc] = NULL;
                       if (GetDlgItemText(hdlg, RC_TXT_UP, &txt[128], 64) > 0) {
                           argv[argc++] = "--" PROCRUN_PARAMS_PASSWORD;
                           argv[argc++] = &txt[128];
  @@ -609,16 +617,20 @@
                       argv[argc++] = "-";
                       argv[argc++] = "--" PROCRUN_PARAMS_PASSWORD;
                       argv[argc++] = "-";
  +                    argv[argc] = NULL;
                       procrun_update_service(&p, argc, argv);
                   }
                   /* TODO: check if the param is changed */
  +                argc = 2;
                   argv[argc++] = "--" PROCRUN_PARAMS_STARTUP;
                   if (IsDlgButtonChecked(hdlg, RC_CHK_AUTO))
                       argv[argc++] = "auto";
                   else
                       argv[argc++] = "manual";
   
  +                argv[argc] = NULL;
                   procrun_update_service(&p, argc, argv);
  +                pool_destroy(p.pool);
                   break;
                   case PSN_RESET:   /* sent when Cancel button pressed */
                   break;         
  @@ -690,6 +702,8 @@
               switch (lpnmhdr->code) {
                   case PSN_APPLY:   /* sent when OK or Apply button pressed */
                   memcpy(&p, g_env->m, sizeof(process_t));
  +                argc = 2;
  +                p.pool = pool_create();
                   if (IsDlgButtonChecked(hdlg, RC_CHK_JVM)) {
                       argv[argc++] = "--" PROCRUN_PARAMS_JVM;
                       argv[argc++] = "auto";
  @@ -715,19 +729,22 @@
                   }
                   if (GetDlgItemText(hdlg, RC_TXT_JO, txt, 4095) > 0) {
                       char *c = &txt[0];
  -                    char b[4096];
  +                    char b[4096] = {0};
                       int i = 0;
                       argc = 2;
                       while (*c) {
                           if (*c == '\n')
                               b[i++] = '#';
                           else if (*c != '\r')
  -                            b[i++] = *c;
  -                    }
  +                            b[i++] = *c;
  +                        ++c;
  +                    }
  +                    b[i] = '\0';
                       argv[argc++] = "--" PROCRUN_PARAMS_JVM_OPTS;
                       argv[argc++] = &b[0];
                       procrun_update_service(&p, argc, argv);
                   }
  +                pool_destroy(p.pool);
                   break;
                   case PSN_RESET:   /* sent when Cancel button pressed */
                   break;         
  @@ -792,6 +809,7 @@
               switch (lpnmhdr->code) {
                   case PSN_APPLY:   /* sent when OK or Apply button pressed */
                   memcpy(&p, g_env->m, sizeof(process_t));
  +                p.pool = pool_create();
                   if (GetDlgItemText(hdlg, RC_TXT_STDI, txt, 4095) > 0) {
                       argc = 2;
                       argv[argc++] = "--" PROCRUN_PARAMS_STDINFILE;
  @@ -810,6 +828,7 @@
                       argv[argc++] = &txt[0];
                       procrun_update_service(&p, argc, argv);
                   }
  +                pool_destroy(p.pool);
   
                   break;
                   case PSN_RESET:   /* sent when Cancel button pressed */
  
  
  
  1.21      +14 -5     jakarta-commons-sandbox/daemon/src/native/nt/procrun/procrun.c
  
  Index: procrun.c
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/daemon/src/native/nt/procrun/procrun.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- procrun.c	3 May 2003 18:35:11 -0000	1.20
  +++ procrun.c	5 May 2003 16:05:47 -0000	1.21
  @@ -167,7 +167,7 @@
   #define DBPRINTF2(v1, v2, v3)
   #endif
   
  -static pool_t *pool_create()
  +pool_t *pool_create()
   {
       pool_t *pool = malloc(sizeof(pool_t));
       if (pool) {
  @@ -179,7 +179,7 @@
       return pool;
   }
   
  -static int pool_destroy(pool_t *pool)
  +int pool_destroy(pool_t *pool)
   {
       int i = 0;
       for (i = 0; i < pool->size; i++) {
  @@ -775,6 +775,7 @@
           return NULL;
       }
       RegCloseKey(hkjs);
  +    procrun_addenv("JAVA_HOME", jbin, 0, proc);
       strcat(jbin, "\\bin");
       return pool_strdup(proc->pool, jbin);
   } 
  @@ -837,6 +838,15 @@
               simple_decrypt(100, proc->service.password,  kval);
           }
           klen = MAX_PATH;
  +        if ((err = RegQueryValueEx(key, PROCRUN_PARAMS_STARTUP, NULL, NULL, 
  +                                   (unsigned char *)kval,
  +                                   &klen)) == ERROR_SUCCESS) {
  +            if (!strcmp(kval, "auto"))
  +                proc->service.startup = SERVICE_AUTO_START;
  +            else
  +                proc->service.startup = SERVICE_DEMAND_START;
  +        }
  +        klen = MAX_PATH;
           if ((err = RegQueryValueEx(key, PROCRUN_PARAMS_STARTCLASS, NULL, NULL, 
                                      (unsigned char *)kval,
                                      &klen)) == ERROR_SUCCESS) {
  @@ -1567,8 +1577,7 @@
           program = env->m->java.jbin;
       }
       DBPRINTF2("RUN [%s] %s\n", program, env->m->argw);
  -    if (env->m->service.account && env->m->service.password) { // &&
  -//        env->m->service.mode == 1) {
  +    if (env->m->service.account && env->m->service.password) {
           HANDLE user, token;
           DBPRINTF2("RUNASUSER %s@%s\n", env->m->service.account, env->m->service.password);
           if (!LogonUser(env->m->service.account, 
  @@ -1882,7 +1891,7 @@
                                 b, 256, 2);
           }
       }
  -    if (proc->service.startup)
  +    if (proc->service.startup != SERVICE_NO_CHANGE)
           set_service_param(proc, PROCRUN_PARAMS_STARTUP,
               proc->service.startup == SERVICE_AUTO_START ? "auto" : "manual",
               0, 0);
  
  
  
  1.18      +6 -2      jakarta-commons-sandbox/daemon/src/native/nt/procrun/procrun.h
  
  Index: procrun.h
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/daemon/src/native/nt/procrun/procrun.h,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- procrun.h	3 May 2003 08:52:02 -0000	1.17
  +++ procrun.h	5 May 2003 16:05:48 -0000	1.18
  @@ -104,7 +104,7 @@
   
   #define IDM_OPTIONS           125
   #define RC_DLG_SRVOPT         130
  -#define RC_LBL_VER            131
  +#define RC_LBL_VER            131
   
   #define RC_TAB_SRVOPT        1000
   #define RC_GRP_MSP           1001
  @@ -156,7 +156,7 @@
   #define PROC_ARG_COUNT  128
   #define PROC_BUFSIZE    4096 
   #define PROC_POOL_SIZE  128
  -#define PROC_VERSION    "1.0.0\0"
  +#define PROC_VERSION    "1.0.1\0"
   #define SERVICE_DEPENDENCIES        "Tcpip\0Afd\0\0"
   
   #define PROC_ARG_ENVPREFIX          "//EP//"
  @@ -334,6 +334,10 @@
       int procrun_main(int argc, char **argv, char **envp, procrun_t *env);
       int procrun_update_service(process_t *proc, int argc, char **argv);
       void save_service_params(process_t *proc, char *java);
  +    pool_t *pool_create();
  +    int pool_destroy(pool_t *pool);
  +
  +
   
   #ifdef __cplusplus
   }
  
  
  
  1.11      +3 -3      jakarta-commons-sandbox/daemon/src/native/nt/procrun/procrun.rc
  
  Index: procrun.rc
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/daemon/src/native/nt/procrun/procrun.rc,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- procrun.rc	3 May 2003 08:52:02 -0000	1.10
  +++ procrun.rc	5 May 2003 16:05:48 -0000	1.11
  @@ -134,7 +134,7 @@
       DEFPUSHBUTTON   "&OK",IDOK,285,150,50,14
       CONTROL         "",IDC_RICHEDIT21,"RichEdit20A",ES_MULTILINE | 
                       ES_READONLY | WS_BORDER | WS_VSCROLL,0,0,335,145
  -    LTEXT           "Apache Process Runner 1.0.0",IDC_STATIC,8,150,270,12
  +    LTEXT           "Apache Process Runner 1.0.1",IDC_STATIC,8,150,270,12
   END
   #endif
   
  @@ -213,8 +213,8 @@
   
   
   1 VERSIONINFO
  - FILEVERSION 2,1,0,0
  - PRODUCTVERSION 2,1,0,0
  + FILEVERSION 2,1,0,1
  + PRODUCTVERSION 2,1,0,1
    FILEFLAGSMASK 0x3fL
   #if defined(_DEBUG)
    FILEFLAGS 0x03L
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message