From: Daniel Kahn Gillmor Date: Mon, 18 Oct 2010 05:04:48 +0000 (-0400) Subject: remove more environment variables from Client.pm, for a more flexible programmatic... X-Git-Tag: msva-perl_debian/0.6-1~3^2~27 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=307c0a9eae20e22d682b1805f05c0086d9f9ee1c;p=monkeysphere-validation-agent.git remove more environment variables from Client.pm, for a more flexible programmatic interface --- diff --git a/Crypt/Monkeysphere/MSVA/Client.pm b/Crypt/Monkeysphere/MSVA/Client.pm index 820266d..0d91aad 100644 --- a/Crypt/Monkeysphere/MSVA/Client.pm +++ b/Crypt/Monkeysphere/MSVA/Client.pm @@ -46,14 +46,16 @@ my $peer = shift; my $pkctype = shift; my $pkcdata = shift; + my $msvasocket = shift; + + if (! defined $msvasocket or $msvasocket eq '') { + $msvasocket = 'http://localhost:8901'; + } my $apd = create_apd($context, $peer, $pkctype, $pkcdata); my $apdjson = to_json($apd); - # get msva socket from environment - my $msvasocket = $ENV{MONKEYSPHERE_VALIDATION_AGENT_SOCKET}; - # create the user agent my $ua = LWP::UserAgent->new; @@ -73,6 +75,7 @@ $apdjson, ); + msvalog('debug', "Contacting MSVA at %s\n", $requesturl); my $response = $ua->request($request); my $status = $response->status_line; diff --git a/msva-query-agent b/msva-query-agent index 8dfd192..846d27d 100755 --- a/msva-query-agent +++ b/msva-query-agent @@ -32,7 +32,7 @@ my $pkcdata = do { ; }; -my ($status,$ret) = Crypt::Monkeysphere::MSVA::Client->query_agent($context,$peer,$pkctype, $pkcdata); +my ($status,$ret) = Crypt::Monkeysphere::MSVA::Client->query_agent($context,$peer,$pkctype, $pkcdata, $ENV{MONKEYSPHERE_VALIDATION_AGENT_SOCKET}); msvalog('info', "status: %s\n", $status); msvalog('info', "valid: %s\n", $ret->{valid});