Changeset 7941 for branches/cu-security-branch/src/io/bmi/bmi_ib/ib.c
- Timestamp:
- 08/25/09 13:56:42 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/cu-security-branch/src/io/bmi/bmi_ib/ib.c
r7024 r7941 82 82 static int send_cts(struct ib_work *rq); 83 83 static void ib_close_connection(ib_connection_t *c); 84 #ifndef __PVFS2_SERVER__85 84 static int ib_tcp_client_connect(ib_method_addr_t *ibmap, 86 85 struct bmi_method_addr *remote_map); 87 #endif88 86 static int ib_tcp_server_check_new_connections(void); 89 87 static int ib_block_for_activity(int timeout_ms); … … 793 791 ib_method_addr_t *ibmap = remote_map->method_data; 794 792 795 if (!ibmap->c) 796 #ifdef __PVFS2_SERVER__ 797 /* cannot actively connect */ 798 ret = 1; 799 #else 793 if (!ibmap->c && ibmap->reconnect_flag) 800 794 ret = ib_tcp_client_connect(ibmap, remote_map); 801 #endif 795 else if(!ibmap->c && !ibmap->reconnect_flag) 796 ret = 1; /* cannot actively connect */ 797 else 798 ret = 0; 799 802 800 return ret; 803 801 } … … 1543 1541 */ 1544 1542 static struct bmi_method_addr *ib_alloc_method_addr(ib_connection_t *c, 1545 char *hostname, int port) 1543 char *hostname, int port, 1544 int reconnect_flag) 1546 1545 { 1547 1546 struct bmi_method_addr *map; … … 1553 1552 ibmap->hostname = hostname; 1554 1553 ibmap->port = port; 1554 ibmap->reconnect_flag = reconnect_flag; 1555 1555 1556 1556 return map; … … 1615 1615 else 1616 1616 { 1617 map = ib_alloc_method_addr(0, hostname, port); /* alloc new one */ 1617 /* set reconnect flag on this addr; we will be acting as a client 1618 * for this connection and will be responsible for making sure that 1619 * the connection is established 1620 */ 1621 map = ib_alloc_method_addr(0, hostname, port, 1); /* alloc new one */ 1618 1622 /* but don't call bmi_method_addr_reg_callback! */ 1619 1623 } … … 1711 1715 } 1712 1716 1713 #ifndef __PVFS2_SERVER__1714 1717 /* 1715 1718 * Blocking connect initiated by a post_sendunexpected{,_list}, or … … 1759 1762 return 0; 1760 1763 } 1761 #endif1762 1764 1763 1765 /* … … 1829 1831 } 1830 1832 1831 c->remote_map = ib_alloc_method_addr(c, hostname, port); 1833 /* don't set reconnect flag on this addr; we are a server in this 1834 * case and the peer will be responsible for maintaining the 1835 * connection 1836 */ 1837 c->remote_map = ib_alloc_method_addr(c, hostname, port, 0); 1832 1838 /* register this address with the method control layer */ 1833 1839 c->bmi_addr = bmi_method_addr_reg_callback(c->remote_map);
