X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=blobdiff_plain;f=yarrg%2Fcommod-update-receiver;h=123ca0cd7acc0c3778555ff786aa843881232dd0;hp=cbd98f84b2e15c64b64bd4e4d1674d856f95b1b4;hb=663db396d271b241a8ec76bd44fbda9ec432e10f;hpb=59316f0dcddd4e5d15e47dfde36f513e1685c4ae diff --git a/yarrg/commod-update-receiver b/yarrg/commod-update-receiver index cbd98f8..123ca0c 100755 --- a/yarrg/commod-update-receiver +++ b/yarrg/commod-update-receiver @@ -62,7 +62,8 @@ sub must_param ($$) { my %o; if (param('get_source')) { - header('application/octet-stream'); + # There's another copy of this in dictionary-update-receiver. Sorry. + print header('application/octet-stream') or die $!; source_tarball('..', sub { print $_[0] or die $!; }); exit 0; } @@ -92,7 +93,7 @@ addlog("receiving"); $o{'clientname'}= must_param('clientname',$re_any); my $clientinfo= $clients{$o{'clientname'}}; -fail('unknown client') unless defined $clientinfo; +fail('unknown client '.errsan($o{'clientname'})) unless defined $clientinfo; my $clientfixes= must_param('clientfixes', "^([-0-9a-z ]*)\$"); my @clientfixes= sort grep { m/./ } split /\s+/, $clientfixes; @@ -114,7 +115,7 @@ $o{'ocean'}= must_param('ocean', $re_any); $o{'island'}= must_param('island', $re_any); my $arches= $oceans{$o{'ocean'}}; -fail("unknown ocean") unless $arches; +fail("unknown ocean ".errsan($o{'ocean'})) unless $arches; parse_info_serverside_ocean($o{'ocean'}); @@ -125,7 +126,7 @@ foreach my $islands (values %$arches) { die if $island_found; $island_found= $sources; } -fail("unknown island") unless $island_found; +fail("unknown island ".errsan($o{'island'})) unless $island_found; $o{'timestamp'}= must_param('timestamp', "^([1-9]\\d{1,20})\$"); fail("clock skew") if $o{'timestamp'} >= $now;