Changeset 14286 for trunk/FACT++/dim
- Timestamp:
- 07/25/12 17:22:52 (12 years ago)
- Location:
- trunk/FACT++/dim
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/dim/README_v19.txt
r13995 r14286 1 1 2 DIM version 19.3 5Release Notes2 DIM version 19.37 Release Notes 3 3 4 4 Notes 1 and 2 for Unix Users only … … 17 17 Dns </dev/null >& dns.log & 18 18 19 NOTE 3: The Version Number service provided by servers is now set to 1935. 19 NOTE 3: The Version Number service provided by servers is now set to 1937. 20 21 27/06/2012 22 Changes for version 19.37: 23 - DIM DNS crashed for servers with a task name bigger than 80 characters - Fixed. 24 25 26 22/06/2012 27 Changes for version 19.36: 28 - The internal "DIS_DNS/KILL_SERVERS" command can now be used to pass a user defined exit_code to 29 the servers. The servers will get this exit_code in their exit_handler. 30 Although the exit_code passed to the "DIS_DNS/KILL_SERVERS" command is an integer, only the lower 31 16 bits can be used, i.e. only these bits are passed to the servers. 32 20 33 21 34 24/05/2012 -
trunk/FACT++/dim/dim/dim.h
r13995 r14286 14 14 #include "dim_common.h" 15 15 16 #define DIM_VERSION_NUMBER 193 516 #define DIM_VERSION_NUMBER 1937 17 17 18 18 … … 187 187 */ 188 188 typedef enum { DNS_DIS_REGISTER, DNS_DIS_KILL, DNS_DIS_STOP, 189 DNS_DIS_EXIT } DNS_DIS_TYPES;189 DNS_DIS_EXIT, DNS_DIS_SOFT_EXIT } DNS_DIS_TYPES; 190 190 typedef enum { RD_HDR, RD_DATA, RD_DUMMY } CONN_STATE; 191 191 typedef enum { NOSWAP, SWAPS, SWAPL, SWAPD} SWAP_TYPE; … … 442 442 TIMR_ENT *timr_ent; 443 443 int already; 444 char long_task_name[MAX_TASK_NAME* 2];444 char long_task_name[MAX_TASK_NAME*10]; 445 445 } DNS_CONNECTION; 446 446 -
trunk/FACT++/dim/src/did/did.c
r12585 r14286 1844 1844 return; 1845 1845 } 1846 1846 if ((tag == DID_SEL_NODE) || (tag == DID_SEL_SERVICE)) 1847 1847 { 1848 1848 strcpy(Curr_view_opt_par, str); … … 1850 1850 XtFree(str); 1851 1851 } 1852 1852 if(tag == DID_SERVICES) 1853 1853 { 1854 1854 pstr = strchr(str,' '); … … 1908 1908 XtFree(str); 1909 1909 } 1910 1910 if(tag == DID_COMMAND) 1911 1911 { 1912 1912 did_prepare_command(str); -
trunk/FACT++/dim/src/dis.c
r13995 r14286 253 253 strcpy(str,"Service name too long: "); 254 254 strcat(str,name); 255 error_handler(0, DIM_ERROR, DIMSVCTOOLG, str );255 error_handler(0, DIM_ERROR, DIMSVCTOOLG, str, -1); 256 256 ENABLE_AST 257 257 return((unsigned) 0); … … 261 261 strcpy(str,"Duplicate Service: "); 262 262 strcat(str,name); 263 error_handler(0, DIM_ERROR, DIMSVCDUPLC, str );263 error_handler(0, DIM_ERROR, DIMSVCDUPLC, str, -1); 264 264 ENABLE_AST 265 265 return((unsigned) 0); … … 273 273 strcpy(str,"Format String Too Long: "); 274 274 strcat(str,name); 275 error_handler(0, DIM_ERROR, DIMSVCFORMT, str );275 error_handler(0, DIM_ERROR, DIMSVCFORMT, str, -1); 276 276 free(new_serv); 277 277 ENABLE_AST … … 282 282 strcpy(str,"Bad Format String: "); 283 283 strcat(str,name); 284 error_handler(0, DIM_ERROR, DIMSVCFORMT, str );284 error_handler(0, DIM_ERROR, DIMSVCFORMT, str, -1); 285 285 free(new_serv); 286 286 ENABLE_AST … … 431 431 strcpy(str,"Command name too long: "); 432 432 strcat(str,name); 433 error_handler(0, DIM_ERROR, DIMSVCTOOLG, str );433 error_handler(0, DIM_ERROR, DIMSVCTOOLG, str, -1); 434 434 ENABLE_AST 435 435 return((unsigned) 0); … … 648 648 extern void do_dis_stop_serving_dns(DIS_DNS_CONN *); 649 649 DIS_DNS_CONN *dnsp; 650 int type, exit_code; 650 651 651 652 if(size){} … … 672 673 DIS_DNS_TMOUT_MIN, DIS_DNS_TMOUT_MAX, SRC_DIS ); 673 674 if(dnsp->dns_dis_conn_id == -2) 674 error_handler(0, DIM_FATAL, DIMDNSUNDEF, "DIM_DNS_NODE undefined" );675 error_handler(0, DIM_FATAL, DIMDNSUNDEF, "DIM_DNS_NODE undefined", -1); 675 676 } 676 677 break; … … 694 695 if(vtohl(packet->size) != DNS_DIS_HEADER) 695 696 break; 696 switch( vtohl(packet->type) ) 697 type = vtohl(packet->type); 698 exit_code = (type >> 16) & 0xFFFF; 699 type &= 0xFFFF; 700 switch(type) 697 701 { 698 702 case DNS_DIS_REGISTER : … … 700 704 "%s: Watchdog Timeout, DNS requests registration", 701 705 dnsp->task_name); 702 error_handler(0, DIM_WARNING, DIMDNSTMOUT, str );706 error_handler(0, DIM_WARNING, DIMDNSTMOUT, str, -1); 703 707 register_services(dnsp, ALL, 0); 704 708 break; … … 711 715 */ 712 716 Serving = -1; 713 error_handler(0, DIM_FATAL, DIMDNSDUPLC, str );717 error_handler(0, DIM_FATAL, DIMDNSDUPLC, str, -1); 714 718 /* 715 719 do_dis_stop_serving_dns(dnsp); … … 730 734 */ 731 735 Serving = -1; 732 error_handler(0, DIM_FATAL, DIMDNSREFUS, str );736 error_handler(0, DIM_FATAL, DIMDNSREFUS, str, -1); 733 737 /* 734 738 do_dis_stop_serving_dns(dnsp); … … 748 752 Serving = -1; 749 753 */ 750 error_handler(0, DIM_FATAL, DIMDNSEXIT, str); 754 error_handler(0, DIM_FATAL, DIMDNSEXIT, str, -1); 755 break; 756 case DNS_DIS_SOFT_EXIT : 757 sprintf(str, 758 "%s: DNS requests Exit(%d)",dnsp->task_name, exit_code); 759 /* 760 Serving = -1; 761 */ 762 error_handler(0, DIM_FATAL, DIMDNSEXIT, str, exit_code); 751 763 break; 752 764 } … … 1207 1219 DIS_DNS_TMOUT_MIN, DIS_DNS_TMOUT_MAX, SRC_DIS ); 1208 1220 if(dnsp->dns_dis_conn_id == -2) 1209 error_handler(0, DIM_FATAL, DIMDNSUNDEF, "DIM_DNS_NODE undefined" );1221 error_handler(0, DIM_FATAL, DIMDNSUNDEF, "DIM_DNS_NODE undefined", -1); 1210 1222 } 1211 1223 } … … 1720 1732 { 1721 1733 sprintf(str, "Update Service - Invalid service id"); 1722 error_handler(0, DIM_ERROR, DIMSVCINVAL, str );1734 error_handler(0, DIM_ERROR, DIMSVCINVAL, str, -1); 1723 1735 ENABLE_AST 1724 1736 return(found); … … 1861 1873 { 1862 1874 sprintf(str, "Service Has Clients- Invalid service id"); 1863 error_handler(0, DIM_ERROR, DIMSVCINVAL, str );1875 error_handler(0, DIM_ERROR, DIMSVCINVAL, str, -1); 1864 1876 ENABLE_AST 1865 1877 return(found); … … 1895 1907 { 1896 1908 sprintf(str,"Get Timeout - Invalid service id"); 1897 error_handler(0, DIM_ERROR, DIMSVCINVAL, str );1909 error_handler(0, DIM_ERROR, DIMSVCINVAL, str, -1); 1898 1910 return(-1); 1899 1911 } … … 1922 1934 { 1923 1935 sprintf(str,"Set Quality - Invalid service id"); 1924 error_handler(0, DIM_ERROR, DIMSVCINVAL, str );1936 error_handler(0, DIM_ERROR, DIMSVCINVAL, str, -1); 1925 1937 ENABLE_AST 1926 1938 return; … … 1956 1968 { 1957 1969 sprintf(str,"Set Timestamp - Invalid service id"); 1958 error_handler(0, DIM_ERROR, DIMSVCINVAL, str );1970 error_handler(0, DIM_ERROR, DIMSVCINVAL, str, -1); 1959 1971 ENABLE_AST 1960 1972 return(0); … … 2007 2019 { 2008 2020 sprintf(str,"Get Timestamp - Invalid service id"); 2009 error_handler(0, DIM_ERROR, DIMSVCINVAL, str );2021 error_handler(0, DIM_ERROR, DIMSVCINVAL, str, -1); 2010 2022 ENABLE_AST 2011 2023 return(0); … … 2050 2062 if( !service_id ) { 2051 2063 sprintf(str,"Send Service - Invalid service id"); 2052 error_handler(0, DIM_ERROR, DIMSVCINVAL, str );2064 error_handler(0, DIM_ERROR, DIMSVCINVAL, str, -1); 2053 2065 ENABLE_AST 2054 2066 return; … … 2114 2126 { 2115 2127 sprintf(str,"Remove Service - Invalid service id"); 2116 error_handler(0, DIM_ERROR, DIMSVCINVAL, str );2128 error_handler(0, DIM_ERROR, DIMSVCINVAL, str, -1); 2117 2129 ENABLE_AST 2118 2130 return(found); … … 3184 3196 } 3185 3197 3186 static void error_handler(int conn_id, int severity, int errcode, char *reason )3198 static void error_handler(int conn_id, int severity, int errcode, char *reason, int exit) 3187 3199 { 3188 3200 int exit_tag, exit_code, exit_size; … … 3205 3217 { 3206 3218 exit_tag = 0; 3207 exit_code = errcode; 3219 if(exit == -1) 3220 exit_code = errcode; 3221 else 3222 exit_code = exit; 3208 3223 exit_size = sizeof(int); 3209 3224 exit_handler(&exit_tag, &exit_code, &exit_size); -
trunk/FACT++/dim/src/dns.c
r13135 r14286 525 525 { 526 526 strncpy(Dns_conns[conn_id].long_task_name, packet->services[i].service_name, 527 MAX_TASK_NAME* 2);527 MAX_TASK_NAME*10); 528 528 ptrt = strstr(Dns_conns[conn_id].long_task_name,"/CLIENT_LIST"); 529 529 *ptrt = '\0'; … … 1455 1455 dis_add_cmnd( "DIS_DNS/DEBUG_ON", 0, set_debug_on, 0 ); 1456 1456 dis_add_cmnd( "DIS_DNS/DEBUG_OFF", 0, set_debug_off, 0 ); 1457 dis_add_cmnd( "DIS_DNS/KILL_SERVERS", 0, kill_servers, 0 );1457 dis_add_cmnd( "DIS_DNS/KILL_SERVERS", "I", kill_servers, 0 ); 1458 1458 dis_add_cmnd( "DIS_DNS/PRINT_HASH_TABLE", 0, print_hash_table, 0 ); 1459 1459 dis_add_cmnd( "DIS_DNS/SERVICE_INFO/RpcIn", "C", set_rpc_info, 0 ); … … 1563 1563 1564 1564 1565 void kill_servers( )1565 void kill_servers(int *tag, int *code, int *size) 1566 1566 { 1567 1567 int i; 1568 1568 DNS_DIS_PACKET dis_packet; 1569 1569 int soft_code = 0, soft_size = 0; 1570 int type; 1571 1572 if(size) 1573 { 1574 soft_size = *size; 1575 if(code) 1576 { 1577 soft_code = *code; 1578 } 1579 } 1570 1580 for(i = 0; i< Curr_N_Conns; i++) 1571 1581 { … … 1574 1584 if(!strcmp(Dns_conns[i].task_name,"DIS_DNS")) 1575 1585 continue; 1576 dim_print_date_time();1577 printf(" Killing server %s@%s\n",1578 Dns_conns[i].task_name, Dns_conns[i].node_name);1579 1586 fflush(stdout); 1580 dis_packet.type = htovl(DNS_DIS_EXIT); 1587 type = DNS_DIS_EXIT; 1588 if(soft_size) 1589 { 1590 type = DNS_DIS_SOFT_EXIT; 1591 type |= (soft_code << 16) & 0xFFFF0000; 1592 dim_print_date_time(); 1593 printf(" Killing server %s@%s with exit code %d\n", 1594 Dns_conns[i].task_name, Dns_conns[i].node_name, soft_code); 1595 } 1596 else 1597 { 1598 dim_print_date_time(); 1599 printf(" Killing server %s@%s\n", 1600 Dns_conns[i].task_name, Dns_conns[i].node_name); 1601 } 1602 dis_packet.type = htovl(type); 1581 1603 dis_packet.size = htovl(DNS_DIS_HEADER); 1582 1604 if( !dna_write_nowait(i, &dis_packet, DNS_DIS_HEADER) )
Note:
See TracChangeset
for help on using the changeset viewer.