X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-test.git;a=blobdiff_plain;f=yarrg%2Fcommod-update-receiver;h=d01b6de1753c3cbfac8b7751d0266c5af36a0116;hp=9c8dd30eb68672e7e3a8bd4db3ca959fe1d97f07;hb=2e5e1c4479f350077245d74a9c82c08590554a22;hpb=70fbec215ab03e711cd53b065df64c004ba45256 diff --git a/yarrg/commod-update-receiver b/yarrg/commod-update-receiver index 9c8dd30..d01b6de 100755 --- a/yarrg/commod-update-receiver +++ b/yarrg/commod-update-receiver @@ -25,20 +25,6 @@ # are used without permission. This program is not endorsed or # sponsored by Three Rings. -# All calls contain: -# clientname "ypp-sc-tools" -# clientversion 2.1-g2e06a26 [from git-describe --tags HEAD] -# clientfixes "lastpage" [space separated list] -# -# Timestamp requests contain: -# requesttimestamp -# -# Uploads contain: -# ocean canonical mixed case -# island canonical mixed case -# data filename=deduped.tsv.gz output of yarrg --tsv - - use strict (qw(vars)); use POSIX; use MIME::Entity; @@ -49,7 +35,7 @@ $CGI::POST_MAX= 3*1024*1024; use CGI qw/:standard -private_tempfiles/; -setlocale(LC_CTYPE, "en_GB.UTF-8"); +set_ctype_utf8(); our $now= time; defined $now or die $!; @@ -63,7 +49,7 @@ sub fail ($) { print header(-status=>'400 Bad commodity update', -type=>'text/plain', -charset=>'us-ascii'); - print "Error: $msg\n"; + print "\nError: $msg\n"; exit 0; } @@ -124,6 +110,8 @@ $o{'island'}= must_param('island', $re_any); my $arches= $oceans{$o{'ocean'}}; fail("unknown ocean") unless $arches; +parse_info_serverside_ocean($o{'ocean'}); + my $island_found= 0; foreach my $islands (values %$arches) { my $sources= $islands->{$o{'island'}}; @@ -147,9 +135,10 @@ foreach my $mid (<_mid-*.hold>) { unlink $mid or $!==&ENOENT or die "$mid $!"; } +$o{'instance'}= $ENV{'YARRG_INSTANCE'}; my $mcontent= MIME::Entity->build(To => 'yarrg-commod-updates', - Subject => $pwd, + Subject => $ENV{'YARRG_INSTANCE'}, Type => 'multipart/mixed', Boundary => '=', 'Message-ID' => $mid,