Show
Ignore:
Timestamp:
08/25/09 13:56:42 (4 years ago)
Author:
nlmills
Message:

merged in changes from summer at LANL

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/cu-security-branch/src/io/bmi/bmi_ib/ib.c

    r7024 r7941  
    8282static int send_cts(struct ib_work *rq); 
    8383static void ib_close_connection(ib_connection_t *c); 
    84 #ifndef __PVFS2_SERVER__ 
    8584static int ib_tcp_client_connect(ib_method_addr_t *ibmap, 
    8685                                 struct bmi_method_addr *remote_map); 
    87 #endif 
    8886static int ib_tcp_server_check_new_connections(void); 
    8987static int ib_block_for_activity(int timeout_ms); 
     
    793791    ib_method_addr_t *ibmap = remote_map->method_data; 
    794792 
    795     if (!ibmap->c) 
    796 #ifdef __PVFS2_SERVER__ 
    797         /* cannot actively connect */ 
    798         ret = 1; 
    799 #else 
     793    if (!ibmap->c && ibmap->reconnect_flag) 
    800794        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 
    802800    return ret; 
    803801} 
     
    15431541 */ 
    15441542static 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) 
    15461545{ 
    15471546    struct bmi_method_addr *map; 
     
    15531552    ibmap->hostname = hostname; 
    15541553    ibmap->port = port; 
     1554    ibmap->reconnect_flag = reconnect_flag; 
    15551555 
    15561556    return map; 
     
    16151615    else 
    16161616    { 
    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 */ 
    16181622        /* but don't call bmi_method_addr_reg_callback! */ 
    16191623    } 
     
    17111715} 
    17121716 
    1713 #ifndef __PVFS2_SERVER__ 
    17141717/* 
    17151718 * Blocking connect initiated by a post_sendunexpected{,_list}, or 
     
    17591762    return 0; 
    17601763} 
    1761 #endif 
    17621764 
    17631765/* 
     
    18291831        } 
    18301832 
    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); 
    18321838        /* register this address with the method control layer */ 
    18331839        c->bmi_addr = bmi_method_addr_reg_callback(c->remote_map);