From: Robert W. <wrw...@us...> - 2007-03-15 22:28:34
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16670/isnsserver/src Modified Files: iSNSreg.c Log Message: add timeout to socket connection Index: iSNSreg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSreg.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** iSNSreg.c 4 Jan 2007 19:00:07 -0000 1.23 --- iSNSreg.c 15 Mar 2007 22:28:30 -0000 1.24 *************** *** 587,590 **** --- 587,593 ---- updateFlag = TRUE; break; + case ISNS_ISCSI_TYPE: + p_portal->node_type=p_portal->node_type | *(uint32_t *)&attr->val; + updateFlag = TRUE; default: break; *************** *** 1644,1647 **** --- 1647,1652 ---- int updateFlag; ISNS_DBKey read_key; + int node_type = 0; + int nodeTypeIndex = -1; newRegFlag = FALSE; *************** *** 1692,1695 **** --- 1697,1707 ---- } + nodeTypeIndex = ISNSFindTag ( 0, ISNS_ISCSI_TYPE, attr_indx ); + if (nodeTypeIndex != -1) + { + attr = (ISNS_Attr *) attr_indx[nodeTypeIndex]; + node_type = *(uint32_t *)&attr->val; + } + p_entity = &entry.data.entity; read_key.tag = ENTITY_ID_KEY; *************** *** 1697,1706 **** rval = ISNSdbRead(&read_key,&entry); if ( (rval == SUCCESS) && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG) ) { ! /* An entry was found and the update flag is not set, so deregister it */ ! DEBUG_0 (isns_reg_debug &1, RemoveEntity); ! ISNSdbRemoveAttrEntityEntry (db_entity_id.id, NULL, NULL); ! rval = ERROR; } --- 1709,1723 ---- rval = ISNSdbRead(&read_key,&entry); + /* If an entry was found and the update flag is not set deregister it */ + /* Also if the entry was found and the node_type is different then */ + /* don't de-register it */ if ( (rval == SUCCESS) && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG) ) { ! if ( p_entity->node_type == node_type) ! { ! DEBUG_0 (isns_reg_debug &1, RemoveEntity); ! ISNSdbRemoveAttrEntityEntry (db_entity_id.id, NULL, NULL); ! rval = ERROR; ! } } *************** *** 1798,1801 **** --- 1815,1823 ---- updateFlag = TRUE; break; + case ISNS_ISCSI_TYPE: + p_entity->node_type = p_entity->node_type | *(uint32_t *)&attr->val; + updateFlag = TRUE; + break; + default: break; |