Skip to content

Commit

Permalink
Force UTF-8 when sending WS-Discovery Probe
Browse files Browse the repository at this point in the history
  • Loading branch information
altaroca committed Apr 10, 2016
1 parent 124d781 commit 1558353
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions onvif/modules/lib/WSDiscovery/TransportUDP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,19 @@ sub _notify_response
}

sub send_multi() {
my ($self, $address, $port, $data) = @_;
my ($self, $address, $port, $utf8_string) = @_;

my $destination = $address . ':' . $port;
my $socket = IO::Socket::Multicast->new(PROTO => 'udp',
LocalPort=>$port, PeerAddr=>$destination, ReuseAddr=>1)

or die 'Cannot open multicast socket to ' . ${address} . ':' . ${port};

my $bytes = $utf8_string;
utf8::encode($bytes);

$socket->mcast_ttl(1);
$socket->send($data);
$socket->send($bytes);
}

sub receive_multi() {
Expand Down

0 comments on commit 1558353

Please sign in to comment.