Changeset 5848
- Timestamp:
- 07/23/08 16:09:04 (4 months ago)
- Location:
- trunk/centstorage
- Files:
-
- 6 modified
-
ChangeLog (modified) (1 diff)
-
modules/recup_perf_datas/connection.c (modified) (4 diffs)
-
modules/recup_perf_datas/connection.h (modified) (1 diff)
-
modules/recup_perf_datas/connection_SSL.c (modified) (3 diffs)
-
modules/recup_perf_datas/connection_SSL.h (modified) (1 diff)
-
modules/recup_perf_datas/recup_perf_datas.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/centstorage/ChangeLog
r5840 r5848 10 10 switch SSL/no SSL, etc) 11 11 * fixed a f*****g segfault 12 * removing some useless files from the svn 12 13 13 14 ??? - 07/22/2008 -
trunk/centstorage/modules/recup_perf_datas/connection.c
r5820 r5848 652 652 } 653 653 654 tmp = first_client; 654 655 if (tmp) 655 656 for (next = tmp->next; next; ) … … 657 658 if (next->use_ssl == 0) 658 659 { 659 SHUT_FD( tmp->socket);660 free( tmp->addr);660 SHUT_FD(next->socket); 661 free(next->addr); 661 662 tmp->next = next->next; 662 663 free(next); … … 686 687 { 687 688 free(first_client->addr); 688 SSL_shutdown( tmp->ssl);689 close( tmp->socket);690 SSL_free( tmp->ssl);691 SSL_CTX_free( tmp->ctx);689 SSL_shutdown(first_client->ssl); 690 close(first_client->socket); 691 SSL_free(first_client->ssl); 692 SSL_CTX_free(first_client->ctx); 692 693 tmp = first_client->next; 693 694 free(first_client); … … 695 696 } 696 697 697 for (next = tmp->next; next; ) 698 { 699 if (next->use_ssl == 1) 700 { 701 SSL_shutdown(tmp->ssl); 702 close(tmp->socket); 703 SSL_free(tmp->ssl); 704 SSL_CTX_free(tmp->ctx); 705 free(tmp->addr); 706 tmp->next = next->next; 707 free(next); 708 next = tmp->next; 709 } 710 else 711 { 712 tmp = tmp->next; 713 next = next->next; 714 } 715 } 698 tmp = first_client; 699 if (tmp) 700 for (next = tmp->next; next; ) 701 { 702 if (next->use_ssl == 1) 703 { 704 SSL_shutdown(next->ssl); 705 close(next->socket); 706 SSL_free(next->ssl); 707 SSL_CTX_free(next->ctx); 708 free(next->addr); 709 tmp->next = next->next; 710 free(next); 711 next = tmp->next; 712 } 713 else 714 { 715 tmp = tmp->next; 716 next = next->next; 717 } 718 } 716 719 if (log) 717 720 logger(" [module %s] %s.", MOD_NAME, SSL_CL_DISCONNECTED); -
trunk/centstorage/modules/recup_perf_datas/connection.h
r5747 r5848 84 84 85 85 /* shutdown and then close the file descriptor */ 86 #define SHUT_FD(fd) { shutdown(fd, SHUT_RD ); \86 #define SHUT_FD(fd) { shutdown(fd, SHUT_RDWR); \ 87 87 if (close(fd) == -1) \ 88 88 perror("Error closing socket: "); } -
trunk/centstorage/modules/recup_perf_datas/connection_SSL.c
r5840 r5848 84 84 if (tmp->reload) 85 85 { 86 printf("reopen\n");87 86 SSL_library_init(); /* load encryption & hash algorithms for SSL (always return 1) */ 88 87 SSL_load_error_strings(); /* load the error strings for good error reporting */ … … 452 451 /* copy the variable defined in the struct confSSL in "local" to avoid using a mutex 453 452 when accessing them */ 454 printf("addr:%d\n", confSSL);455 453 (*checkCl) = confSSL->checkCl; 456 454 … … 513 511 logger(" [module %s] %s.[ERROR]", MOD_NAME, SSL_BINDING_ERROR); 514 512 515 fprintf(stderr, " %s.\n", SSL_BINDING_ERROR);513 fprintf(stderr, "reopen_SSL_connection: %s.\n", SSL_BINDING_ERROR); 516 514 perror("Reason"); 517 515 LOCK_MUTEX(&SSL_mutex); -
trunk/centstorage/modules/recup_perf_datas/connection_SSL.h
r5649 r5848 35 35 #define SSL_SOCKET_ERROR "Cannot open socket for secure connection" 36 36 #define SSL_SOCKET_ERROR_LOG "Cannot open socket for SSL" 37 #define SSL_BINDING_ERROR "** Cannot bind s ocket. Exiting thread **"37 #define SSL_BINDING_ERROR "** Cannot bind secure socket. Exiting thread **" 38 38 #define SSL_LISTEN_ERROR "** Error on listen. Exiting thread **" 39 39 #define SSL_ACCEPT_ERROR "** Error on accept for SSL connection **" -
trunk/centstorage/modules/recup_perf_datas/recup_perf_datas.c
r5841 r5848 381 381 UNLOCK_MUTEX(&SSL_mutex); 382 382 } 383 flagStopSSL = 2;383 // flagStopSSL = 2; 384 384 385 385 if (saveSSL == NO) … … 419 419 if (confModule->SSL == NO) 420 420 { 421 cleanSSL(log); 421 422 LOCK_MUTEX(&SSL_mutex); 422 423 flagStopSSL = 1; … … 431 432 free(arg); 432 433 cleanNoSSL(log); 434 printf("change mode:%d\n", confModule->socket); 435 433 436 close(confModule->socket); 437 434 438 /* stop SSL thread */ 435 LOCK_MUTEX(&SSL_ mutex);439 LOCK_MUTEX(&SSL_conf_mutex); 436 440 flagStopSSL = 1; 437 UNLOCK_MUTEX(&SSL_mutex); 441 UNLOCK_MUTEX(&SSL_conf_mutex); 442 438 443 if (pthread_join(threadSSL_id, NULL)) 439 pthread_exit(NULL); 444 { 445 fprintf(stderr, "Cannot perform pthread_join().\n"); 446 pthread_exit(NULL); 447 } 440 448 if (saveSSLPort != confSSL->SSLPort) 441 449 {
