From: Robert W. <wrw...@us...> - 2007-08-23 02:50:25
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5003/isnsserver/src Modified Files: iSNSLinux.c iSNSdb.c iSNSparse.c iSNSquery.c iSNSreg.c iSNStrcv.c Log Message: fixed tcp memory leak and Attr Query requests Index: iSNSquery.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSquery.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** iSNSquery.c 13 Aug 2007 22:56:45 -0000 1.24 --- iSNSquery.c 23 Aug 2007 02:50:20 -0000 1.25 *************** *** 117,121 **** { int status = ISNS_UNKNOWN_ERR; ! ISNS_Attr *attr; ISNS_Attr *src_attr; ISNS_Attr *attr_indx[SNS_MAX_ATTRS]; --- 117,121 ---- { int status = ISNS_UNKNOWN_ERR; ! ISNS_Key *key; ISNS_Attr *src_attr; ISNS_Attr *attr_indx[SNS_MAX_ATTRS]; *************** *** 123,133 **** ISNSParseMsg( &p_md->msg, attr_indx, key_indx, &src_attr ); ! attr = (ISNS_Attr *)(attr_indx[0]); ! if (attr == NULL) { __DEBUG (isns_query_debug & 1, (No attr in query msg)); return ( ISNS_MSG_FMT_ERR ); } ! switch ( attr->tag ) { case ISNS_ENTITY_ID: --- 123,133 ---- ISNSParseMsg( &p_md->msg, attr_indx, key_indx, &src_attr ); ! key = (ISNS_Key *)(key_indx[0]); ! if (key == NULL) { __DEBUG (isns_query_debug & 1, (No attr in query msg)); return ( ISNS_MSG_FMT_ERR ); } ! switch ( key->tag ) { case ISNS_ENTITY_ID: *************** *** 257,261 **** { case ISNS_ENTITY_ID: ! entityKeyFlag = ii; break; case ISNS_ENTITY_IDX: --- 257,262 ---- { case ISNS_ENTITY_ID: ! if (key->len > 0) ! entityKeyFlag = ii; break; case ISNS_ENTITY_IDX: *************** *** 1021,1025 **** break; case ISNS_PORTAL_IP: ! portalIpKeyFlag = ii; break; case ISNS_PORTAL_PORT: --- 1022,1027 ---- break; case ISNS_PORTAL_IP: ! if (key->len > 0) ! portalIpKeyFlag = ii; break; case ISNS_PORTAL_PORT: *************** *** 1572,1576 **** { case ISNS_ISCSI_NODE_ID: ! nodeKeyIndex = ii; break; case ISNS_ISCSI_TYPE: --- 1574,1579 ---- { case ISNS_ISCSI_NODE_ID: ! if (key->len > 0) ! nodeKeyIndex = ii; break; case ISNS_ISCSI_TYPE: *************** *** 2885,2892 **** { __DEBUG (isns_query_debug &1, portal group record not found ); ! return rval; } ! ! p_portal_group = &entry4.data.portal_group; for (jj = 0; (jj < SNS_MAX_ATTRS) && (attr_indx[jj]); jj++) --- 2888,2895 ---- { __DEBUG (isns_query_debug &1, portal group record not found ); ! // continue on, but knowning that p_portal_group is null } ! else ! p_portal_group = &entry4.data.portal_group; for (jj = 0; (jj < SNS_MAX_ATTRS) && (attr_indx[jj]); jj++) *************** *** 2932,2943 **** break; case ISNS_PORTAL_GROUP_PORT: ! __DEBUG (isns_query_debug &1,ISNS_PORTAL_GROUP_PORT:%i,p_portal->ip_port); ! ISNSAppendAttr (p_msg, ISNS_PORTAL_GROUP_PORT, ISNS_PORTAL_GROUP_PORT_SIZE, NULL, p_portal_group->ip_port); break; case ISNS_PORTAL_GROUP_IP: ! __DEBUG (isns_query_debug &1,Add ISNS_PORTAL_GROUP_IP); ! ISNSAppendAttr (p_msg, ISNS_PORTAL_GROUP_IP, ISNS_PORTAL_GROUP_IP_SIZE, p_portal_group->ip_addr.v, 0); break; case ISNS_PORTAL_GROUP_ISCSI_NAME: --- 2935,2966 ---- break; case ISNS_PORTAL_GROUP_PORT: ! if (p_portal_group) ! { ! __DEBUG (isns_query_debug &1,ISNS_PORTAL_GROUP_PORT:%i,p_portal_group->ip_port); ! ISNSAppendAttr (p_msg, ISNS_PORTAL_GROUP_PORT, ISNS_PORTAL_GROUP_PORT_SIZE, NULL, p_portal_group->ip_port); + } + else + { + //since portal group doesn't exist use portal instead - workaround for open-iscsiinitiator + __DEBUG (isns_query_debug &1,ISNS_PORTAL_GROUP_PORT:%i,p_portal->ip_port); + ISNSAppendAttr (p_msg, ISNS_PORTAL_GROUP_PORT, ISNS_PORTAL_GROUP_PORT_SIZE, + NULL, p_portal->ip_port); + } break; case ISNS_PORTAL_GROUP_IP: ! if (p_portal_group) ! { ! __DEBUG (isns_query_debug &1,Add ISNS_PORTAL_GROUP_IP); ! ISNSAppendAttr (p_msg, ISNS_PORTAL_GROUP_IP, ISNS_PORTAL_GROUP_IP_SIZE, p_portal_group->ip_addr.v, 0); + } + else + { + //since portal group doesn't exist use portal instead - workaround for open-iscsiinitiator + __DEBUG (isns_query_debug &1,Add ISNS_PORTAL_GROUP_IP); + ISNSAppendAttr (p_msg, ISNS_PORTAL_GROUP_IP, ISNS_PORTAL_GROUP_IP_SIZE, + p_portal->ip_addr.v, 0); + } break; case ISNS_PORTAL_GROUP_ISCSI_NAME: *************** *** 2947,2952 **** break; case ISNS_PORTAL_GROUP_TAG: ! ISNSAppendAttr (p_msg, ISNS_PORTAL_GROUP_TAG, ISNS_PORTAL_GROUP_TAG_SIZE, NULL, p_portal_group->portal_tag); break; default: --- 2970,2979 ---- break; case ISNS_PORTAL_GROUP_TAG: ! if (p_portal_group) ! { ! __DEBUG (isns_query_debug &1,Add ISNS_PORTAL_GROUP_TAG); ! ISNSAppendAttr (p_msg, ISNS_PORTAL_GROUP_TAG, ISNS_PORTAL_GROUP_TAG_SIZE, NULL, p_portal_group->portal_tag); + } break; default: Index: iSNSparse.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSparse.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** iSNSparse.c 13 Aug 2007 22:56:45 -0000 1.21 --- iSNSparse.c 23 Aug 2007 02:50:20 -0000 1.22 *************** *** 292,306 **** } ! __DEBUG (isns_parse_debug &1,%s flags:%x,FuncIDText(msg->hdr.type),msg->hdr.flags); /* Store Keys */ ! if (msg->hdr.type & 0x8000) // response messages with error code offset = 4; else offset = 0; ! __DEBUG (isns_parse_debug &1,"offset:%i",offset); ! ! ptr = attr = (ISNS_Attr *)(&msg->payload+offset); if (src_attr != NULL) --- 292,307 ---- } ! __DEBUG (isns_parse_debug &1,%s:0x%x flags:%x msg_len:%i, FuncIDText(msg->hdr.type), msg->hdr.type, msg->hdr.flags, msg->hdr.msg_len); /* Store Keys */ ! if (msg->hdr.type & 0x8000) // response messages with status code ! { ! __DEBUG (isns_parse_debug &1,"response status code:0x%x",msg->payload); offset = 4; + } else offset = 0; ! ptr = attr = (ISNS_Attr *)((char *)&msg->payload+offset); if (src_attr != NULL) *************** *** 317,330 **** } - if ( (msg->hdr.type == ISNS_ESI_RSP) - || (msg->hdr.type == ISNS_REG_DEV_ATTR_RES) - || (msg->hdr.type == ISNS_DEV_ATTR_QRY_RES) ) - - { - __DEBUG (isns_parse_debug &1, skip the error status field / timestamp); - offset += 4; - ptr = (struct ISNS_attr *)((char *) ptr + 4); - } - jj = 0; while ((char *)ptr < (char *) &msg->payload + msg->hdr.msg_len) --- 318,321 ---- *************** *** 430,434 **** } ! __DEBUG (isns_parse_debug &1,"Processing msg type=0x%x, tag=0x%x",msg->msg.hdr.type,pattr->tag); /* length */ --- 421,425 ---- } ! //__DEBUG (isns_parse_debug &1,"Processing msg type=0x%x, tag=%i",msg->msg.hdr.type,pattr->tag); /* length */ Index: iSNSreg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSreg.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** iSNSreg.c 13 Aug 2007 22:56:45 -0000 1.28 --- iSNSreg.c 23 Aug 2007 02:50:21 -0000 1.29 *************** *** 180,183 **** --- 180,184 ---- __DEBUG (isns_reg_debug &1,regPortalFlag:%i,regPortalFlag); __DEBUG (isns_reg_debug &1,regEntityFlag%i,regEnitityFlag); + __DEBUG (isns_reg_debug &1,regPortalGroupFlag%i,regPortalGroupFlag); status = ISNS_NO_ERR; Index: iSNSdb.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdb.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** iSNSdb.c 13 Aug 2007 22:56:44 -0000 1.29 --- iSNSdb.c 23 Aug 2007 02:50:20 -0000 1.30 *************** *** 92,102 **** dbStats iSNS_stats; ! /* ! * Local function prototypes ! */ ! ! void ! ISNSExceptionHdlr (void); ! /********************************************************************* --- 92,107 ---- dbStats iSNS_stats; ! void ISNSExceptionHdlr1(char * string); ! void ISNSExceptionHdlr2(char * string); ! void ISNSExceptionHdlr3(char * string); ! void ISNSExceptionHdlr4(char * string); ! void ISNSExceptionHdlr5(char * string); ! void ISNSExceptionHdlr6(char * string); ! void ISNSExceptionHdlr7(char * string); ! void ISNSExceptionHdlr8(char * string); ! void ISNSExceptionHdlr9(char * string); ! void ISNSExceptionHdlr10(char * string); ! void ISNSExceptionHdlr11(char * string); ! void ISNSExceptionHdlr12(char * string); /********************************************************************* *************** *** 698,724 **** dbfp[NODE_NAME_KEY] = gdbm_open("isns1.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); dbfp[PORT_NAME_KEY] = gdbm_open("isns2.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); dbfp[ENTITY_ID_KEY] = gdbm_open("isns3.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); dbfp[PORTAL_ID_KEY] = gdbm_open("isns4.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); dbfp[DDS_ID_KEY] = gdbm_open("isns5.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); dbfp[DD_ID_KEY] = gdbm_open("isns6.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); dbfp[ISCSI_ID_KEY] = gdbm_open("isns7.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); dbfp[PORTAL_GROUP_ID_KEY] = gdbm_open("isns8.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); dbfp[ENTITY_IDX_KEY] = gdbm_open("isns9.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); dbfp[ISCSI_IDX_KEY] = gdbm_open("isns10.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); dbfp[PORTAL_IDX_KEY] = gdbm_open("isns11.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); dbfp[LIST_KEY] = gdbm_open("isns12.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); ddmem=(SOIP_Dd_Member *)calloc( MAX_MEMBER_PER_DD, sizeof(SOIP_Dd_Member) ); --- 703,729 ---- dbfp[NODE_NAME_KEY] = gdbm_open("isns1.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr1); dbfp[PORT_NAME_KEY] = gdbm_open("isns2.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr2); dbfp[ENTITY_ID_KEY] = gdbm_open("isns3.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr3); dbfp[PORTAL_ID_KEY] = gdbm_open("isns4.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr4); dbfp[DDS_ID_KEY] = gdbm_open("isns5.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr5); dbfp[DD_ID_KEY] = gdbm_open("isns6.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr6); dbfp[ISCSI_ID_KEY] = gdbm_open("isns7.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr7); dbfp[PORTAL_GROUP_ID_KEY] = gdbm_open("isns8.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr8); dbfp[ENTITY_IDX_KEY] = gdbm_open("isns9.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr9); dbfp[ISCSI_IDX_KEY] = gdbm_open("isns10.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr10); dbfp[PORTAL_IDX_KEY] = gdbm_open("isns11.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr11); dbfp[LIST_KEY] = gdbm_open("isns12.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr12); ddmem=(SOIP_Dd_Member *)calloc( MAX_MEMBER_PER_DD, sizeof(SOIP_Dd_Member) ); *************** *** 954,960 **** /******************************************************************** ********************************************************************/ ! void ISNSExceptionHdlr() { ! __LOG_INFO ("ISNSExceptionHdlr stub."); } --- 959,1009 ---- /******************************************************************** ********************************************************************/ ! void ISNSExceptionHdlr1(char * string) { ! __LOG_INFO ("Database 1 ISNSExceptionHdlr:%s",string); ! } ! void ISNSExceptionHdlr2(char * string) ! { ! __LOG_INFO ("Database 2 ISNSExceptionHdlr:%s",string); ! } ! void ISNSExceptionHdlr3(char * string) ! { ! __LOG_INFO ("Database 3 ISNSExceptionHdlr:%s",string); ! } ! void ISNSExceptionHdlr4(char * string) ! { ! __LOG_INFO ("Database 4 ISNSExceptionHdlr:%s",string); ! } ! void ISNSExceptionHdlr5(char * string) ! { ! __LOG_INFO ("Database 5 ISNSExceptionHdlr:%s",string); ! } ! void ISNSExceptionHdlr6(char * string) ! { ! __LOG_INFO ("Database 6 ISNSExceptionHdlr:%s",string); ! } ! void ISNSExceptionHdlr7(char * string) ! { ! __LOG_INFO ("Database 7 ISNSExceptionHdlr:%s",string); ! } ! void ISNSExceptionHdlr8(char * string) ! { ! __LOG_INFO ("Database 8 ISNSExceptionHdlr:%s",string); ! } ! void ISNSExceptionHdlr9(char * string) ! { ! __LOG_INFO ("Database 9 ISNSExceptionHdlr:%s",string); ! } ! void ISNSExceptionHdlr10(char * string) ! { ! __LOG_INFO ("Database 10 ISNSExceptionHdlr:%s",string); ! } ! void ISNSExceptionHdlr11(char * string) ! { ! __LOG_INFO ("Database 11 ISNSExceptionHdlr:%s",string); ! } ! void ISNSExceptionHdlr12(char * string) ! { ! __LOG_INFO ("Database 12 ISNSExceptionHdlr:%s",string); } Index: iSNStrcv.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNStrcv.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** iSNStrcv.c 7 Aug 2007 14:41:48 -0000 1.6 --- iSNStrcv.c 23 Aug 2007 02:50:21 -0000 1.7 *************** *** 33,36 **** --- 33,37 ---- #include <signal.h> #include <sys/poll.h> + #include <errno.h> #include "iSNS.h" *************** *** 39,45 **** #include "iSNScomm.h" #include "iSNSipc.h" - #include "iSNSdebug.h" /******************************************/ --- 40,47 ---- #include "iSNScomm.h" #include "iSNSipc.h" #include "iSNSdebug.h" + #define SOCKET_TIMEOUT_VALUE 120*1000 + /******************************************/ *************** *** 73,86 **** SOCKET sock; SOCKET sockfd; ! #ifdef SNS_LINUX ! int not_needed = 1; ! #else ! char not_needed = 1; ! #endif ! int len; struct sockaddr_in my_addr, their_addr; __DEBUG(sns_tcp_debug & 1, (TCP_RecvMain: Starting)); - /* setup for the bind */ my_addr.sin_family = AF_INET; my_addr.sin_port = htons ((short) sns_comm_main_port); --- 75,88 ---- SOCKET sock; SOCKET sockfd; ! int not_needed = 1; ! socklen_t addrlen; ! int rc; ! int threadcount = 0; ! pthread_attr_t attr; ! struct sockaddr_in my_addr, their_addr; + __DEBUG(sns_tcp_debug & 1, (TCP_RecvMain: Starting)); my_addr.sin_family = AF_INET; my_addr.sin_port = htons ((short) sns_comm_main_port); *************** *** 89,94 **** sock = socket(AF_INET, SOCK_STREAM, 0); - /* Allow reuse of addresses */ #ifdef SNS_LINUX if (setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, ¬_needed, sizeof(not_needed)) < 0) { --- 91,96 ---- sock = socket(AF_INET, SOCK_STREAM, 0); #ifdef SNS_LINUX + /* Allow reuse of addresses */ if (setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, ¬_needed, sizeof(not_needed)) < 0) { *************** *** 98,117 **** #endif ! /* Do a Bind */ ! if (bind (sock, (struct sockaddr *) &my_addr, sizeof (my_addr)) < 0) { ! close (sock); ! if (bind (sock, (struct sockaddr *) &my_addr, sizeof (my_addr)) < 0) ! { ! __LOG_ERROR ("Fatal Error while Binding."); ! return (0); ! } } ! len = sizeof (their_addr); ! if (listen (sock, 100) < 0) { ! __LOG_ERROR ("Fatal Error while doing a Listen"); return (0); } --- 100,119 ---- #endif ! rc = bind (sock, (struct sockaddr *) &my_addr, sizeof (my_addr)); ! if (rc < 0) { ! close (sock); ! { ! __LOG_ERROR ("Fatal Error while Binding:%i - %s.",rc,strerror(errno)); ! return (0); ! } } ! addrlen = sizeof (their_addr); ! rc = listen(sock,100); ! if (rc < 0) { ! __LOG_ERROR ("Fatal Error while doing a Listen:%i - %s",rc,strerror(errno)); return (0); } *************** *** 119,133 **** while (1) { ! /* Do an Accept */ ! if ((sockfd = ! accept (sock, (struct sockaddr *) &their_addr, ! (socklen_t *)&len)) < 0) { ! __LOG_ERROR ("Fatal Error while doing an Accept"); ! return (0); } ! ! __DEBUG(sns_tcp_debug & 1, (Received TCP connection)); ! { #ifdef SNS_LINUX --- 121,131 ---- while (1) { ! sockfd = accept (sock, (struct sockaddr *) &their_addr,&addrlen); ! if (sockfd < 0) { ! __LOG_ERROR ("Fatal Error while doing an Accept sockfd:%i - %s",sockfd,strerror(errno)); ! break; } ! else { #ifdef SNS_LINUX *************** *** 139,144 **** cb_p=malloc(sizeof(TCP_CB)); cb_p->sock=sockfd; #ifdef SNS_LINUX ! pthread_create (&ignore, NULL, (void*) TCP_RecvThread, (LPVOID)cb_p); #else CreateThread(0, 0, TCP_RecvThread, (LPVOID)cb_p, 0, &ignore); --- 137,152 ---- cb_p=malloc(sizeof(TCP_CB)); cb_p->sock=sockfd; + + __DEBUG(sns_tcp_debug & 1,"accepted a TCP connection request thread count:%i",threadcount); + #ifdef SNS_LINUX ! pthread_attr_init(&attr); ! pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED); ! rc = pthread_create (&ignore, &attr, (void*) TCP_RecvThread, (LPVOID)cb_p); ! if (rc != 0) ! { ! __LOG_ERROR("Error creating thread:%i - %s",rc,strerror(rc)); ! } ! threadcount++; #else CreateThread(0, 0, TCP_RecvThread, (LPVOID)cb_p, 0, &ignore); *************** *** 147,155 **** } ! __LOG_INFO ("TCP_RecvMain: Finished."); } - #define SOCKET_TIMEOUT_VALUE 120*1000 - /******************************************/ #ifdef SNS_LINUX --- 155,162 ---- } ! __LOG_INFO("TCP_RecvMain: Finished."); ! return(ERROR); } /******************************************/ #ifdef SNS_LINUX *************** *** 174,183 **** ISNS_Msg_Descp md; ! __DEBUG(sns_tcp_debug & 1, (TCP_RecvThread: Starting)); ! sockfd=cb_p->sock; ! ! __DEBUG(sns_tcp_debug & 1, (connection starting sockfd:%i), sockfd); free(cb_p); startIndex=0; endIndex=0; --- 181,189 ---- ISNS_Msg_Descp md; ! __DEBUG(sns_tcp_debug & 1, (TCP_RecvThread: Starting a thread on socket:%i),cb_p->sock); + sockfd=cb_p->sock; free(cb_p); + startIndex=0; endIndex=0; *************** *** 195,203 **** break; } i = recv(sockfd, &buffer[endIndex], sizeof(buffer)-endIndex, 0); ! if (i<=0) { ! __DEBUG(sns_tcp_debug & 1, (recv error or connection closed)); close(sockfd); break; --- 201,222 ---- break; } + else if (rc < 0) + { + __LOG_ERROR("Error on connection:%i - errno:%i %s",sockfd,errno,strerror(errno)); + close(sockfd); + break; + } i = recv(sockfd, &buffer[endIndex], sizeof(buffer)-endIndex, 0); ! ! if (i == 0) { ! __DEBUG(sns_tcp_debug & 1, (recv no data - client closed connection)); ! close(sockfd); ! break; ! } ! else if (i < 0) ! { ! __LOG_ERROR("recv error we will close connection:%i - %s",i,strerror(errno)); close(sockfd); break; *************** *** 234,242 **** while (!sns_ready) { - #ifdef SNS_LINUX sleep(1); - #else - Sleep(1); - #endif } SendIPCMessage(SNS_EP, (void *)&md, --- 253,257 ---- *************** *** 246,250 **** startIndex+=msg_size; } - if (pending==0) { --- 261,264 ---- *************** *** 254,257 **** } ! return (ERROR); } --- 268,275 ---- } ! __DEBUG(sns_tcp_debug & 1, (TCP_RecvThread: Socket:%i Exiting thread),sockfd); ! /* thread terminates here */ ! pthread_exit(&rc); ! __LOG_ERROR("pthread_exit failed"); ! return (SUCCESS); } Index: iSNSLinux.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSLinux.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** iSNSLinux.c 13 Aug 2007 22:56:44 -0000 1.13 --- iSNSLinux.c 23 Aug 2007 02:50:20 -0000 1.14 *************** *** 399,402 **** --- 399,407 ---- sns_tcp_debug = -1; } + else if (!strcmp(type,"tcp")) + { + sns_comm_debug = -1; + sns_tcp_debug = -1; + } else if (!strcmp(type,"db")) { |