Changeset 5848

Show
Ignore:
Timestamp:
07/23/08 16:09:04 (4 months ago)
Author:
rbertholon
Message:

still debbugging...

Location:
trunk/centstorage
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/centstorage/ChangeLog

    r5840 r5848  
    1010switch SSL/no SSL, etc) 
    1111* fixed a f*****g segfault 
     12* removing some useless files from the svn 
    1213 
    1314??? - 07/22/2008 
  • trunk/centstorage/modules/recup_perf_datas/connection.c

    r5820 r5848  
    652652    } 
    653653 
     654  tmp = first_client; 
    654655  if (tmp) 
    655656    for (next = tmp->next; next; ) 
     
    657658        if (next->use_ssl == 0) 
    658659          { 
    659             SHUT_FD(tmp->socket); 
    660             free(tmp->addr); 
     660            SHUT_FD(next->socket); 
     661            free(next->addr); 
    661662            tmp->next = next->next; 
    662663            free(next); 
     
    686687    { 
    687688      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); 
    692693      tmp = first_client->next; 
    693694      free(first_client); 
     
    695696    } 
    696697 
    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      } 
    716719  if (log) 
    717720    logger(" [module %s] %s.", MOD_NAME, SSL_CL_DISCONNECTED); 
  • trunk/centstorage/modules/recup_perf_datas/connection.h

    r5747 r5848  
    8484 
    8585/* 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);  \ 
    8787                      if (close(fd) == -1)      \ 
    8888                        perror("Error closing socket: "); } 
  • trunk/centstorage/modules/recup_perf_datas/connection_SSL.c

    r5840 r5848  
    8484  if (tmp->reload) 
    8585    { 
    86       printf("reopen\n"); 
    8786      SSL_library_init(); /* load encryption & hash algorithms for SSL (always return 1) */ 
    8887      SSL_load_error_strings(); /* load the error strings for good error reporting */ 
     
    452451  /* copy the variable defined in the struct confSSL in "local" to avoid using a mutex 
    453452   when accessing them */ 
    454   printf("addr:%d\n", confSSL); 
    455453  (*checkCl) = confSSL->checkCl; 
    456454 
     
    513511        logger(" [module %s] %s.[ERROR]", MOD_NAME, SSL_BINDING_ERROR); 
    514512 
    515       fprintf(stderr, "%s.\n", SSL_BINDING_ERROR); 
     513      fprintf(stderr, "reopen_SSL_connection: %s.\n", SSL_BINDING_ERROR); 
    516514      perror("Reason"); 
    517515      LOCK_MUTEX(&SSL_mutex); 
  • trunk/centstorage/modules/recup_perf_datas/connection_SSL.h

    r5649 r5848  
    3535#define SSL_SOCKET_ERROR "Cannot open socket for secure connection" 
    3636#define SSL_SOCKET_ERROR_LOG "Cannot open socket for SSL" 
    37 #define SSL_BINDING_ERROR "** Cannot bind socket. Exiting thread **" 
     37#define SSL_BINDING_ERROR "** Cannot bind secure socket. Exiting thread **" 
    3838#define SSL_LISTEN_ERROR "** Error on listen. Exiting thread **" 
    3939#define SSL_ACCEPT_ERROR "** Error on accept for SSL connection **" 
  • trunk/centstorage/modules/recup_perf_datas/recup_perf_datas.c

    r5841 r5848  
    381381      UNLOCK_MUTEX(&SSL_mutex); 
    382382    } 
    383   flagStopSSL = 2; 
     383  //  flagStopSSL = 2; 
    384384 
    385385  if (saveSSL == NO) 
     
    419419      if (confModule->SSL == NO) 
    420420        { 
     421          cleanSSL(log); 
    421422          LOCK_MUTEX(&SSL_mutex); 
    422423          flagStopSSL = 1; 
     
    431432          free(arg); 
    432433          cleanNoSSL(log); 
     434          printf("change mode:%d\n", confModule->socket); 
     435 
    433436          close(confModule->socket); 
     437 
    434438          /* stop SSL thread  */ 
    435           LOCK_MUTEX(&SSL_mutex); 
     439          LOCK_MUTEX(&SSL_conf_mutex); 
    436440          flagStopSSL = 1; 
    437           UNLOCK_MUTEX(&SSL_mutex); 
     441          UNLOCK_MUTEX(&SSL_conf_mutex); 
     442 
    438443          if (pthread_join(threadSSL_id, NULL)) 
    439             pthread_exit(NULL); 
     444            { 
     445              fprintf(stderr, "Cannot perform pthread_join().\n"); 
     446              pthread_exit(NULL); 
     447            } 
    440448          if (saveSSLPort != confSSL->SSLPort) 
    441449            {