From 862a646c7d4054e056feace0bb2591014284be9c Mon Sep 17 00:00:00 2001 From: kohsuke Date: Fri, 9 Feb 2007 20:28:06 +0000 Subject: [PATCH] bug fix in the remoting mechanism. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2126 71c3de6d-444a-0410-be80-ed276b4c234a --- .../main/java/hudson/remoting/UserRequest.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/remoting/src/main/java/hudson/remoting/UserRequest.java b/remoting/src/main/java/hudson/remoting/UserRequest.java index 66d58201b6..617e7c1bb8 100644 --- a/remoting/src/main/java/hudson/remoting/UserRequest.java +++ b/remoting/src/main/java/hudson/remoting/UserRequest.java @@ -104,11 +104,17 @@ final class UserResponse implements Serializable { } public RSP retrieve(Channel channel, ClassLoader cl) throws IOException, ClassNotFoundException, EXC { - Object o = new ObjectInputStreamEx(new ByteArrayInputStream(response), cl).readObject(); - if(isException) - throw (EXC)o; - else - return (RSP) o; + Channel old = Channel.setCurrent(channel); + try { + Object o = new ObjectInputStreamEx(new ByteArrayInputStream(response), cl).readObject(); + + if(isException) + throw (EXC)o; + else + return (RSP) o; + } finally { + Channel.setCurrent(old); + } } private static final long serialVersionUID = 1L; -- GitLab