- Timestamp:
- Oct 19, 2009, 10:40:02 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 68f358c
- Parents:
- 26255f0
- git-author:
- Alejandro R. Sedeño <asedeno@mit.edu> (10/13/09 21:37:51)
- git-committer:
- Alejandro R. Sedeño <asedeno@mit.edu> (10/19/09 22:40:02)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
message.c
rc79a047 rba88ae7 736 736 void owl_message_create_from_znotice(owl_message *m, const ZNotice_t *n) 737 737 { 738 #ifdef ZNOTICE_SOCKADDR 739 char hbuf[NI_MAXHOST]; 740 #else /* !ZNOTICE_SOCKADDR */ 738 741 struct hostent *hent; 742 #endif /* ZNOTICE_SOCKADDR */ 739 743 const char *ptr; 740 744 char *tmp, *tmp2; … … 810 814 811 815 /* save the hostname */ 816 #ifdef ZNOTICE_SOCKADDR 817 owl_function_debugmsg("About to do getnameinfo"); 818 if (getnameinfo(&n->z_sender_sockaddr.sa, sizeof(n->z_sender_sockaddr), hbuf, sizeof(hbuf), NULL, 0, 0) == 0) 819 owl_message_set_hostname(m, hbuf); 820 #else /* !ZNOTICE_SOCKADDR */ 812 821 owl_function_debugmsg("About to do gethostbyaddr"); 813 hent =gethostbyaddr(&(n->z_uid.zuid_addr), sizeof(n->z_uid.zuid_addr), AF_INET);814 if (hent && hent->h_name) {822 hent = gethostbyaddr(&n->z_uid.zuid_addr, sizeof(n->z_uid.zuid_addr), AF_INET); 823 if (hent && hent->h_name) 815 824 owl_message_set_hostname(m, hent->h_name); 816 } else {825 else 817 826 owl_message_set_hostname(m, inet_ntoa(n->z_sender_addr)); 818 } 827 #endif /* ZNOTICE_SOCKADDR */ 819 828 820 829 /* set the body */
Note: See TracChangeset
for help on using the changeset viewer.