unbreaking the perl session locale stuff
authormiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 2 Aug 2007 03:03:35 +0000 (03:03 +0000)
committermiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 2 Aug 2007 03:03:35 +0000 (03:03 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1067 9efc2488-bf62-4759-914b-345cdb29e865

src/perlmods/OpenSRF/AppSession.pm
src/perlmods/OpenSRF/DomainObject/oilsMessage.pm

index 3b79359..517fdf8 100644 (file)
@@ -750,13 +750,7 @@ sub recv {
        $logger->debug( "Number of matched responses: " . @list, DEBUG );
        $self->queue_wait(0); # check for statuses
        
-       if (!wantarray) {
-               $self->session_locale( $list[0]->sender_locale );
-               return $list[0];
-       } else {
-               $self->session_locale( $list[-1]->sender_locale );
-       }
-
+       return $list[0] if (!wantarray);
        return @list;
 }
 
index 495e33a..19a4c12 100644 (file)
@@ -181,12 +181,14 @@ sub handler {
        my $session = shift;
 
        my $mtype = $self->type;
+       my $locale = $self->sender_locale;
        my $api_level = $self->api_level || 1;;
        my $tT = $self->threadTrace;
 
        $session->last_message_type($mtype);
        $session->last_message_api_level($api_level);
        $session->last_threadTrace($tT);
+       $session->session_locale($locale);
 
        $log->debug(" Received api_level => [$api_level], MType => [$mtype], ".
                        "from [".$session->remote_id."], threadTrace[".$self->threadTrace."]");