- Timestamp:
- 2010-07-24T22:50:23Z (14 years ago)
- Branches:
- master
- Children:
- 8b01217
- Parents:
- 2945c6f
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/ftutil.c
r2945c6f rf1f7b5e 36 36 * Creates a listening socket and returns it in saddr_ptr. 37 37 */ 38 int ft_listen( struct sockaddr_storage *saddr_ptr, char *host, char *port, int for_bitlbee_client, char **errptr )38 int ft_listen( struct sockaddr_storage *saddr_ptr, char *host, char *port, int copy_fd, int for_bitlbee_client, char **errptr ) 39 39 { 40 40 int fd, gret, saddrlen; … … 83 83 } 84 84 } 85 else if( copy_fd >= 0 && getsockname( copy_fd, (struct sockaddr*) &saddrs, &ssize ) == 0 && 86 ( saddrs.ss_family == AF_INET || saddrs.ss_family == AF_INET6 ) && 87 getnameinfo( (struct sockaddr*) &saddrs, ssize, host, HOST_NAME_MAX, 88 NULL, 0, NI_NUMERICHOST ) == 0 ) 89 { 90 /* We just took our local address on copy_fd, which is likely to be a 91 sensible address from which we can do a file transfer now - the 92 most sensible we can get easily. */ 93 } 85 94 else 86 95 { … … 117 126 } 118 127 128 ssize = sizeof( struct sockaddr_storage ); 119 129 ASSERTSOCKOP( getsockname( fd, ( struct sockaddr *)saddr, &ssize ), "Getting socket name" ); 120 130 -
lib/ftutil.h
r2945c6f rf1f7b5e 38 38 /* This function should be used with care. host should be AT LEAST a 39 39 char[HOST_NAME_MAX+1] and port AT LEAST a char[6]. */ 40 int ft_listen( struct sockaddr_storage *saddr_ptr, char *host, char *port, int for_bitlbee_client, char **errptr );40 int ft_listen( struct sockaddr_storage *saddr_ptr, char *host, char *port, int copy_fd, int for_bitlbee_client, char **errptr );
Note: See TracChangeset
for help on using the changeset viewer.