Changeset 3538 for trunk/module-monitor.c
- Timestamp:
- 10/15/10 14:03:33 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-monitor.c
r3535 r3538 334 334 } 335 335 } 336 if (cl->next == NULL)337 return;338 336 } 339 337 monitor_send_info(NULL, 1); … … 358 356 } 359 357 360 static void monitor_process_details_master(char *buf, intpid){358 static void monitor_process_details_master(char *buf, unsigned long pid){ 361 359 sprintf(buf, "Version=%s#%s", CS_VERSION_X, CS_SVN_VERSION); 362 360 monitor_send_details(buf, pid); … … 439 437 char sbuf[256]; 440 438 441 if (!arg) {439 if (!arg) 442 440 cl = first_client; // no arg - show master 443 } else { 444 tid = atoi(arg); 445 if (tid == first_client->thread) 446 cl = first_client; // idx_from_tid doesn't find master 441 else 442 if (sscanf(arg,"%lX",&tid) == 1) 443 cl = idx_from_tid(tid); 447 444 else 448 cl = idx_from_tid(tid); 449 } 445 cl = NULL; 450 446 451 447 if (!cl) 452 monitor_send_details("Invalid TID", tid); //thread is always valid, so no need for testing448 monitor_send_details("Invalid TID", tid); 453 449 else 454 450 { … … 551 547 int argidx, i, found; 552 548 char *argarray[3]; 553 char *token[]={"au", "sleep", "uniq", "monlevel", "group", "services", "betatunnel", "ident", "caid", "chid", "class", "hostname", "expdate", "keepalive", "disabled"};549 static const char *token[]={"au", "sleep", "uniq", "monlevel", "group", "services", "betatunnel", "ident", "caid", "chid", "class", "hostname", "expdate", "keepalive", "disabled"}; 554 550 int tokencnt = sizeof(token)/sizeof(char *); 555 551 char buf[256], tmp[64]; … … 635 631 int argidx, i, found; 636 632 char *argarray[3]; 637 char *token[]={"clienttimeout", "fallbacktimeout", "clientmaxidle", "cachedelay", "bindwait", "netprio", "resolvedelay", "sleep", "unlockparental", "serialreadertimeout", "maxlogsize", "showecmdw", "waitforcards", "preferlocalcards"};633 static const char *token[]={"clienttimeout", "fallbacktimeout", "clientmaxidle", "cachedelay", "bindwait", "netprio", "resolvedelay", "sleep", "unlockparental", "serialreadertimeout", "maxlogsize", "showecmdw", "waitforcards", "preferlocalcards"}; 638 634 char buf[256]; 639 635 … … 689 685 } 690 686 691 static void monitor_list_commands(c har *args[], int cmdcnt){687 static void monitor_list_commands(const char *args[], int cmdcnt){ 692 688 int i; 693 689 for (i = 0; i < cmdcnt; i++) { … … 704 700 { 705 701 int i, rc; 706 char *cmd[] = {"login", "exit", "log", "status", "shutdown", "reload", "details", "version", "debug", "getuser", "setuser", "setserver", "commands", "keepalive", "reread"};702 static const char *cmd[] = {"login", "exit", "log", "status", "shutdown", "reload", "details", "version", "debug", "getuser", "setuser", "setserver", "commands", "keepalive", "reread"}; 707 703 int cmdcnt = sizeof(cmd)/sizeof(char *); // Calculate the amount of items in array 708 704 char *arg;
Note:
See TracChangeset
for help on using the changeset viewer.