--- bin/ldap-rewrite.pl 2009/03/16 09:46:47 19 +++ bin/ldap-rewrite.pl 2009/03/16 13:27:44 23 @@ -108,12 +108,11 @@ foreach my $type ( keys %$data ) { my $vals = $data->{$type}; - $vals =~ s{#\s*$}{}; - - my @vals = split(/\s*#\s*/, $vals); - push @{ $response->{protocolOp}->{searchResEntry}->{attributes} }, - { type => $config->{overlay_prefix} . $type, vals => [ @vals ] }; + push @{ $response->{protocolOp}->{searchResEntry}->{attributes} }, { + type => $config->{overlay_prefix} . $type, + vals => ref($vals) eq 'ARRAY' ? $vals : [ $vals ], + }; } } @@ -132,6 +131,10 @@ die "Could not create listener socket: $!\n" unless $listenersock; die "Could not create connection to server: $!\n" unless $targetsock; + # mark sockets as binary + binmode( $listenersock ); + binmode( $targetsock ); + my $sel = IO::Select->new($listenersock); my %Handlers; while (my @ready = $sel->can_read) {