bitflu.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Index: bitflu.pl
  2. --- bitflu.pl.orig 2007-02-24 12:26:16 +0100
  3. +++ bitflu.pl 2007-02-25 12:42:50 +0100
  4. @@ -188,6 +188,7 @@
  5. #Options with getopt support:
  6. # 1. prio: commandline switch , 2.nd: rcfile 3th: defaults
  7. $config->{client}->{port} = $getopts{torrent} || $config->{client}->{port} || 6688; # BitTorrent incoming port (UDP and TCP)
  8. +$config->{client}->{bind} ||= 0;
  9. $config->{client}->{telnet} = $getopts{telnet} if defined($getopts{telnet});
  10. $config->{client}->{telnet} = 4001 unless defined($config->{client}->{telnet});
  11. @@ -225,7 +226,7 @@
  12. $config->{client}->{notifycompleted} = 0 unless defined($config->{client}->{notifycompleted}); #WALL about completed downloads
  13. # Lock Non-Runtime vars
  14. -foreach (qw(rootdir downloaddir http httpbind port telnet telnetbind key peerid chroot runas_gid runas_uid userauth)) {
  15. +foreach (qw(rootdir downloaddir http httpbind port bind telnet telnetbind key peerid chroot runas_gid runas_uid userauth)) {
  16. $config->{client_locked}->{$_} = 1;
  17. }
  18. @@ -245,7 +246,7 @@
  19. $config->{SYS}->{kick_refreshpeers} = 0;
  20. $config->{SYS}->{kick_autoload} = 0; # ugly: used by other classes
  21. -print Data::Dumper::Dumper($config->{client});
  22. +#print Data::Dumper::Dumper($config->{client});
  23. # DHT:
  24. # should fork, secure_process() and launch DHT
  25. @@ -257,7 +258,7 @@
  26. l(L_WARN, "Bitflu ".BITFLU_VERSION." (build: ".BITFLU_BUILD.") starting ...");
  27. my $torrent_handle = new IO::Select();
  28. - my $torrent_socket = IO::Socket::INET->new(LocalPort=>$config->{client}->{port},
  29. + my $torrent_socket = IO::Socket::INET->new(LocalPort=>$config->{client}->{port}, LocalAddr=>$config->{client}->{bind},
  30. Proto=>'tcp', Listen=>1, ReuseAddr=>1) or die "$0 Unable to bind to $config->{client}->{port} : $!\n";
  31. $torrent_handle->add($torrent_socket);
  32. @@ -1166,7 +1167,7 @@
  33. }
  34. elsif($ACSTAT{$sock}->{AUTH_STATE} == TELNET_CLIENT_WAITFORUSER) {
  35. $ACSTAT{$sock}->{GIVEN_USER} = substr($full_data,0,-2);
  36. - _xwA($sock, "# Password : ");
  37. + _xwA($sock, "# Password: ");
  38. $ACSTAT{$sock}->{AUTH_STATE} = TELNET_CLIENT_WAITFORPASS;
  39. }
  40. elsif($ACSTAT{$sock}->{AUTH_STATE} == TELNET_CLIENT_WAITFORPASS) {