Changeset 11121 for trunk/FACT++/dim
- Timestamp:
- 06/22/11 22:18:02 (13 years ago)
- Location:
- trunk/FACT++/dim
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/dim/README_v19.txt
r11071 r11121 1 1 2 DIM version 19.2 1Release Notes2 DIM version 19.22 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 1921. 19 NOTE 3: The Version Number service provided by servers is now set to 1922. 20 21 21/06/2011 22 Changes for version 19.22: 23 - DIM servers would hang when tring to exit due to "Services already declared", if the user 24 exitHandler() didn't directly call exit (instead tried to exit later in the main program). 25 Fixed. 26 - Servers accept now also 'B' or 'V' as format, they are both equivalent to 'C'. 27 - In Linux when a server printed "Write timeout, disconecting from XXX", it didn't always 28 disconnect properly, so the client would not always reconnect afterwards. Fixed. 29 20 30 21 31 31/05/2011 -
trunk/FACT++/dim/dim/dim.h
r11071 r11121 14 14 #include "dim_common.h" 15 15 16 #define DIM_VERSION_NUMBER 192 116 #define DIM_VERSION_NUMBER 1922 17 17 18 18 #define MY_LITTLE_ENDIAN 0x1 … … 399 399 char *buffer; 400 400 int size; 401 /* 401 402 unsigned short *iosb_r; 402 403 unsigned short *iosb_w; 404 */ 403 405 char node[MAX_NODE_NAME]; 404 406 char task[MAX_TASK_NAME]; … … 406 408 int reading; 407 409 int timeout; 410 int write_timedout; 408 411 TIMR_ENT *timr_ent; 409 412 time_t last_used; -
trunk/FACT++/dim/src/dic.c
r11071 r11121 517 517 register DIC_SERVICE *servp; 518 518 519 /* 520 dim_print_date_time(); 521 printf("In service tmout\n"); 522 */ 519 523 servp=(DIC_SERVICE *)id_get_ptr(serv_id, SRC_DIC); 520 524 if(!servp) … … 522 526 if(servp->tmout_done) 523 527 return; 528 /* 529 dim_print_date_time(); 530 printf("In service tmout %s\n", servp->serv_name); 531 */ 524 532 servp->tmout_done = 1; 525 533 Curr_conn_id = servp->conn_id; … … 1689 1697 case 'c': 1690 1698 case 'C': 1699 case 'b': 1700 case 'B': 1701 case 'v': 1702 case 'V': 1691 1703 formatp->par_bytes = SIZEOF_CHAR; 1692 1704 formatp->flags |= NOSWAP; -
trunk/FACT++/dim/src/dis.c
r11071 r11121 242 242 { 243 243 DISABLE_AST 244 if(Serving == -1) 245 { 246 ENABLE_AST 247 return((unsigned) 0); 248 } 244 249 if(!check_service_name(name)) 245 250 { … … 415 420 { 416 421 DISABLE_AST 422 if(Serving == -1) 423 { 424 ENABLE_AST 425 return((unsigned) 0); 426 } 417 427 if(!check_service_name(name)) 418 428 { … … 582 592 case 'c': 583 593 case 'C': 594 case 'b': 595 case 'B': 596 case 'v': 597 case 'V': 584 598 format_data->par_bytes = SIZEOF_CHAR; 585 599 format_data->flags |= NOSWAP; … … 649 663 if(dnsp->dns_dis_conn_id > 0) 650 664 dna_close(dnsp->dns_dis_conn_id); 665 if(Serving == -1) 666 return; 651 667 if(dnsp->serving) 652 668 { … … 692 708 exit(2); 693 709 */ 710 Serving = -1; 694 711 error_handler(0, DIM_FATAL, DIMDNSDUPLC, str); 712 /* 695 713 do_dis_stop_serving_dns(dnsp); 696 714 dis_stop_serving(); 715 */ 697 716 /* 698 717 exit_tag = 0; … … 708 727 exit(2); 709 728 */ 729 Serving = -1; 710 730 error_handler(0, DIM_FATAL, DIMDNSREFUS, str); 731 /* 711 732 do_dis_stop_serving_dns(dnsp); 712 733 dis_stop_serving(); 734 */ 713 735 /* 714 736 exit_tag = 0; … … 721 743 sprintf(str, 722 744 "%s: DNS requests Exit",dnsp->task_name); 745 /* 746 Serving = -1; 747 */ 723 748 error_handler(0, DIM_FATAL, DIMDNSEXIT, str); 724 749 break; … … 1063 1088 { 1064 1089 DISABLE_AST 1090 if(Serving == -1) 1091 { 1092 ENABLE_AST 1093 return(0); 1094 } 1065 1095 /* 1066 1096 #ifdef VxWorks … … 1460 1490 if( !dna_write_nowait(reqp->conn_id, Dis_packet, header_size + size) ) 1461 1491 { 1462 reqp->to_delete = 1; 1492 if(reqp->delay_delete > 1) 1493 { 1494 reqp->to_delete = 1; 1495 } 1496 else 1497 { 1498 reqp->delay_delete = 0; 1499 release_conn(reqp->conn_id, 1, 0); 1500 } 1463 1501 } 1464 1502 /* … … 1639 1677 1640 1678 DISABLE_AST 1679 if(Serving == -1) 1680 { 1681 ENABLE_AST 1682 return(found); 1683 } 1641 1684 if(!service_id) 1642 1685 { … … 2233 2276 int hash_index; 2234 2277 2278 /* 2279 if(Serving != -1) 2280 */ 2235 2281 Serving = 0; 2236 2282 dis_init(); … … 2279 2325 dtq_delete(Dis_timer_q); 2280 2326 Dis_timer_q = 0; 2327 /* 2328 if(Serving != -1) 2329 */ 2281 2330 dim_stop_threads(); 2282 2331 } … … 2517 2566 /* Would do it too early, the client will disconnect anyway 2518 2567 */ 2519 if((remove) && ( !Serving))2568 if((remove) && (Serving == 0)) 2520 2569 { 2521 2570 clip = find_client(conn_id); -
trunk/FACT++/dim/src/dns.c
r11071 r11121 74 74 static int Last_conn_id; 75 75 /* 76 static int Debug = TRUE;77 */ 78 static int Debug = FALSE;76 static int Debug = 2; 77 */ 78 static int Debug = 0; 79 79 80 80 static int Timer_q; … … 93 93 _DIM_PROTO( void send_dns_server_info, (int conn_id, int **bufp, int *size) ); 94 94 _DIM_PROTO( void print_stats, (void) ); 95 _DIM_PROTO( void set_debug_on, ( void) );95 _DIM_PROTO( void set_debug_on, (int level) ); 96 96 _DIM_PROTO( void set_debug_off, (void) ); 97 97 _DIM_PROTO( void kill_servers, (void) ); … … 207 207 rem_only = 1; 208 208 } 209 /* 209 210 if( Debug ) 210 211 { … … 217 218 fflush(stdout); 218 219 } 220 */ 219 221 if(rem_only) 220 222 return 0; -
trunk/FACT++/dim/src/examples/test_client.c
r11071 r11121 54 54 } 55 55 */ 56 57 void version_rout( int *tag, int *buf, int *size) 58 { 59 printf("Received VERSION %x, %d\n", buf, *size); 60 } 56 61 57 62 void rout( tag, buf, size ) … … 124 129 &no_link, 4 ); 125 130 131 sprintf(str,"%s/VERSION_NUMBER",argv[2]); 132 dic_info_service( str, MONITORED, 0, 0, 0, version_rout, 0, 133 NULL, 0 ); 126 134 /* 127 135 sprintf(aux,"%s/TestMem",argv[2]); -
trunk/FACT++/dim/src/examples/test_server.c
r11071 r11121 145 145 printf("client %s\n",name); 146 146 } 147 /* 148 for(i = 0; i < 5; i++) 149 { 150 sleep(10); 151 152 } 153 dis_stop_serving(); 154 sleep(59); 155 */ 147 156 while(1) 148 157 { … … 183 192 } 184 193 */ 194 /* 185 195 if(new_dns) 186 196 { … … 195 205 } 196 206 NewIds[10] = 0; 197 dis_start_serving_dns(dnsid, "xx_new" /*, NewIds*/);207 dis_start_serving_dns(dnsid, "xx_new"); 198 208 on = 1; 199 209 } … … 208 218 } 209 219 } 220 */ 210 221 } 211 222 return 1; -
trunk/FACT++/dim/src/tcpip.c
r11071 r11121 34 34 #else 35 35 /* 36 #define closesock(s) shutdown(s,2) ;37 */ 38 #define closesock close36 #define closesock(s) shutdown(s,2) 37 */ 38 #define closesock(s) close(s) 39 39 #define readsock(a,b,c,d) read(a,b,c) 40 40 … … 990 990 Net_conns[conn_id].reading = -1; 991 991 Net_conns[conn_id].timr_ent = NULL; 992 Net_conns[conn_id].write_timedout = 0; 992 993 return(1); 993 994 } … … 1114 1115 Net_conns[conn_id].reading = -1; 1115 1116 Net_conns[conn_id].timr_ent = NULL; 1117 Net_conns[conn_id].write_timedout = 0; 1116 1118 return(1); 1117 1119 } … … 1188 1190 Net_conns[conn_id].reading = -1; 1189 1191 Net_conns[conn_id].timr_ent = NULL; 1192 Net_conns[conn_id].write_timedout = 0; 1190 1193 return(1); 1191 1194 } … … 1279 1282 } 1280 1283 else 1284 { 1281 1285 return(0); 1286 } 1287 } 1288 if(wrote == -1) 1289 { 1290 Net_conns[conn_id].write_timedout = 1; 1282 1291 } 1283 1292 return(wrote); … … 1300 1309 Net_conns[conn_id].task[0] = 0; 1301 1310 if(channel) 1311 { 1312 if(Net_conns[conn_id].write_timedout) 1313 { 1314 Net_conns[conn_id].write_timedout = 0; 1315 #if defined(__linux__) && !defined (darwin) 1316 shutdown(channel, 2); 1317 #endif 1318 } 1302 1319 closesock(channel); 1320 } 1303 1321 return(1); 1304 1322 }
Note:
See TracChangeset
for help on using the changeset viewer.