[Pvfs2-cvs] commit by kunkel in pvfs2/src/io/bmi/bmi_tcp: socket-collection-epoll.h bmi-tcp.c

CVS commit program cvs at parl.clemson.edu
Sat Dec 2 06:20:36 EST 2006


Update of /projects/cvsroot/pvfs2/src/io/bmi/bmi_tcp
In directory parlweb1:/tmp/cvs-serv18213/src/io/bmi/bmi_tcp

Modified Files:
      Tag: kunkel-hint-branch
	socket-collection-epoll.h bmi-tcp.c 
Log Message:
Upgrade to current CVS version


Index: socket-collection-epoll.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi_tcp/socket-collection-epoll.h,v
diff -p -u -r1.2 -r1.2.8.1
--- socket-collection-epoll.h	24 May 2006 13:24:50 -0000	1.2
+++ socket-collection-epoll.h	2 Dec 2006 11:20:35 -0000	1.2.8.1
@@ -109,6 +109,7 @@ do { \
     struct tcp_addr* tcp_data = (m)->method_data; \
     if(tcp_data->socket > -1){ \
         struct epoll_event event;\
+        memset(&event, 0, sizeof(event));\
         event.events = EPOLLIN|EPOLLERR|EPOLLHUP;\
         event.data.ptr = tcp_data->map;\
         epoll_ctl(s->epfd, EPOLL_CTL_ADD, tcp_data->socket, &event);\
@@ -119,6 +120,7 @@ do { \
 do { \
     struct epoll_event event;\
     struct tcp_addr* tcp_data = (m)->method_data; \
+    memset(&event, 0, sizeof(event));\
     event.events = 0;\
     event.data.ptr = tcp_data->map;\
     epoll_ctl(s->epfd, EPOLL_CTL_DEL, tcp_data->socket, &event);\
@@ -131,6 +133,7 @@ do { \
     struct epoll_event event;\
     assert(tcp_data->socket > -1); \
     tcp_data->write_ref_count++; \
+    memset(&event, 0, sizeof(event));\
     event.events = EPOLLIN|EPOLLERR|EPOLLHUP|EPOLLOUT;\
     event.data.ptr = tcp_data->map;\
     epoll_ctl(s->epfd, EPOLL_CTL_MOD, tcp_data->socket, &event);\
@@ -143,6 +146,7 @@ do { \
     tcp_data->write_ref_count--; \
     assert(tcp_data->write_ref_count > -1); \
     if (tcp_data->write_ref_count == 0) { \
+        memset(&event, 0, sizeof(event));\
         event.events = EPOLLIN|EPOLLERR|EPOLLHUP;\
         event.data.ptr = tcp_data->map;\
         epoll_ctl(s->epfd, EPOLL_CTL_MOD, tcp_data->socket, &event);\

Index: bmi-tcp.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi_tcp/bmi-tcp.c,v
diff -p -u -r1.106.2.3 -r1.106.2.4
--- bmi-tcp.c	26 Sep 2006 13:03:13 -0000	1.106.2.3
+++ bmi-tcp.c	2 Dec 2006 11:20:35 -0000	1.106.2.4
@@ -1760,16 +1760,32 @@ int BMI_tcp_query_addr_range(method_addr
 const char* BMI_tcp_addr_rev_lookup_unexpected(method_addr_p map)
 {
     struct tcp_addr *tcp_addr_data = map->method_data;
-
-#if !defined(__PVFS2_BMI_REV_LOOKUP_HOSTNAME__) || !defined(HAVE_GETHOSTBYADDR)
-    return(tcp_addr_data->peer);
-
-#else 
-    socklen_t peerlen = sizeof(struct sockaddr_in);
+    int debug_on;
+    uint64_t mask;
+    socklen_t peerlen;
     struct sockaddr_in peer;
     int ret;
     struct hostent *peerent;
     char* tmp_peer;
+
+    /* return default response if we don't have support for the right socket
+     * calls 
+     */
+#if !defined(HAVE_GETHOSTBYADDR)
+    return(tcp_addr_data->peer);
+#else 
+
+    /* Only resolve hostnames if a gossip mask is set to request it.
+     * Otherwise we leave it at ip address 
+     */
+    gossip_get_debug_mask(&debug_on, &mask);
+
+    if(!debug_on || (!(mask & GOSSIP_ACCESS_HOSTNAMES)))
+    {
+        return(tcp_addr_data->peer);
+    }
+
+    peerlen = sizeof(struct sockaddr_in);
 
     if(tcp_addr_data->peer_type == BMI_TCP_PEER_HOSTNAME)
     {



More information about the Pvfs2-cvs mailing list