Changeset f1f7b5e
- Timestamp:
- 2010-07-24T22:50:23Z (14 years ago)
- Branches:
- master
- Children:
- 8b01217
- Parents:
- 2945c6f
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
dcc.c
r2945c6f rf1f7b5e 104 104 /* listen and request */ 105 105 106 if( ( df->fd = ft_listen( &saddr, host, port, TRUE, &errmsg ) ) == -1 )106 if( ( df->fd = ft_listen( &saddr, host, port, irc->fd, TRUE, &errmsg ) ) == -1 ) 107 107 { 108 108 dcc_abort( df, "Failed to listen locally, check your ft_listen setting in bitlbee.conf: %s", errmsg ); -
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 ); -
protocols/jabber/s5bytestream.c
r2945c6f rf1f7b5e 911 911 912 912 if( strcmp( proxy, "<local>" ) == 0 ) { 913 if( ( tf->fd = ft_listen( &tf->saddr, host, port, FALSE, &errmsg ) ) != -1 ) {913 if( ( tf->fd = ft_listen( &tf->saddr, host, port, jd->fd, FALSE, &errmsg ) ) != -1 ) { 914 914 sh = g_new0( jabber_streamhost_t, 1 ); 915 915 sh->jid = g_strdup( tf->ini_jid );
Note: See TracChangeset
for help on using the changeset viewer.