From d436e44ae3a7fc310660db0cc3078a9c1c9318e4 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 10 Nov 2014 16:03:51 +0100 Subject: SSH.pm: Print a friendlier message if connecting fails "got EOF while expecting 8 bytes from remote side" is not very helpful. --- perl/lib/Nix/CopyClosure.pm | 1 + perl/lib/Nix/SSH.pm | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'perl') diff --git a/perl/lib/Nix/CopyClosure.pm b/perl/lib/Nix/CopyClosure.pm index 1520f1012c7d..800feb3b413a 100644 --- a/perl/lib/Nix/CopyClosure.pm +++ b/perl/lib/Nix/CopyClosure.pm @@ -57,6 +57,7 @@ sub copyTo { if ($@) { chomp $@; warn "$@; falling back to old closure copying method\n"; + $@ = ""; return oldCopyTo(@_); } diff --git a/perl/lib/Nix/SSH.pm b/perl/lib/Nix/SSH.pm index 9e0c10beb0e0..95393d881450 100644 --- a/perl/lib/Nix/SSH.pm +++ b/perl/lib/Nix/SSH.pm @@ -1,5 +1,6 @@ package Nix::SSH; +use utf8; use strict; use File::Temp qw(tempdir); use IPC::Open2; @@ -89,10 +90,16 @@ sub connectToRemoteNix { my $pid = open2($from, $to, "exec ssh -x -a $sshHost @globalSshOpts @{$sshOpts} nix-store --serve --write $extraFlags"); # Do the handshake. - my $SERVE_MAGIC_1 = 0x390c9deb; # FIXME - my $clientVersion = 0x200; - syswrite($to, pack("L= 0x300; -- cgit 1.4.1