--- loncom/lonnet/perl/lonnet.pm 2008/02/24 22:59:17 1.943 +++ loncom/lonnet/perl/lonnet.pm 2008/02/26 10:39:44 1.944 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.943 2008/02/24 22:59:17 raeburn Exp $ +# $Id: lonnet.pm,v 1.944 2008/02/26 10:39:44 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1692,15 +1692,17 @@ sub absolute_url { # fn Possibly encrypted resource name/id. # form Hash that describes how the rendering should be done # and other things. -# r Optional reference that will be given the response. -# This is mostly provided so that the caller can implement -# error detection, recovery and retry policies. +# Returns: +# Scalar context: The content of the reply. +# Array context: 2 element list of the content and the full response variable. # # Returns: # The content of the response. sub ssi { - my ($fn,%form, $r)=@_; + my ($fn,%form)=@_; + my $count = scalar(@_); + my $ua=new LWP::UserAgent; @@ -1717,12 +1719,13 @@ sub ssi { $request->header(Cookie => $ENV{'HTTP_COOKIE'}); my $response=$ua->request($request); + my $status = $response->code; - if ($r) { - $$r = $response; + if (wantarray) { + return ($response->content, $response); + } else { + return $response->content; } - - return $response->content; } sub externalssi {