Permalink
Browse files

Pass ipv4_only to hairtunes when -4 is given as an arg.

  • Loading branch information...
1 parent 220250c commit 2e097b670fb2d27a85ef33657a5f615b57034ece @splbio splbio committed Dec 23, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 shairport.pl
View
@@ -83,7 +83,7 @@
my $help;
-my $ipv4;
+my $ipv4_only;
unless (-x $hairtunes_cli) {
say "Can't find the 'hairtunes' decoder binary, you need to build this before using ShairPort.";
@@ -100,7 +100,7 @@
"ao_devicename=s" => \$libao_devicename,
"ao_deviceid=s" => \$libao_deviceid,
"v|verbose" => \$verbose,
- "4" => \$ipv4,
+ "4" => \$ipv4_only,
"w|writepid=s" => \$writepid,
"s|squeezebox" => \$squeeze,
"c|cliport=s" => \$cliport,
@@ -299,7 +299,7 @@ sub REAP {
my $listen;
{
- if (!defined($ipv4)) {
+ if (!defined($ipv4_only)) {
eval {
local $SIG{__DIE__};
$listen = new IO::Socket::INET6(Listen => 1,
@@ -685,6 +685,10 @@ sub conn_handle_request {
my $dec = $hairtunes_cli . join(' ', '', map { sprintf "%s '%s'", $_, $dec_args{$_} } keys(%dec_args));
+ if ($ipv4_only) {
+ $dec .= " ipv4_only";
+ }
+
print "decode command: $dec\n" if ($verbose);
my $decoder = open2(my $dec_out, my $dec_in, $dec);

0 comments on commit 2e097b6

Please sign in to comment.