mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 22:12:25 +00:00
External job monitoring was ignoring the possible encoding difference between Hudson and the remote machine that executed the job.
(<a href="http://www.nabble.com/windows%E3%81%AEhudson%E3%81%8B%E3%82%89ssh%E3%82%B9%E3%83%AC%E3%83%BC%E3%83%96%E3%82%92%E4%BD%BF%E3%81%86%E3%81%A8%E3%81%8D%E3%81%AE%E6%96%87%E5%AD%97%E3%82%B3%E3%83%BC%E3%83%89%E5%8F%96%E3%82%8A%E6%89%B1%E3%81%84%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6-td23583532.html">report</a>) git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@18197 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
ba46603dfd
commit
85a4bc0b6b
4 files changed
+5
-7
No files matched your search
@@ -37,6 +37,7 @@ import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
/**
|
||||
* Entry point to Hudson from command line.
|
||||
@@ -107,7 +108,7 @@ public class Main {
|
||||
|
||||
Writer w = new OutputStreamWriter(os,"UTF-8");
|
||||
w.write("<?xml version='1.0' encoding='UTF-8'?>");
|
||||
w.write("<run><log encoding='hexBinary'>");
|
||||
w.write("<run><log encoding='hexBinary' content-encoding='"+Charset.defaultCharset().name()+"'>");
|
||||
w.flush();
|
||||
|
||||
// run the command
|
||||
|
||||
@@ -32,7 +32,6 @@ import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* Job that runs outside Hudson whose result is submitted to Hudson
|
||||
@@ -89,7 +88,7 @@ public class ExternalJob extends ViewJob<ExternalJob,ExternalRun> implements Top
|
||||
/**
|
||||
* Used to check if this is an external job and ready to accept a build result.
|
||||
*/
|
||||
public void doAcceptBuildResult( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
|
||||
public void doAcceptBuildResult(StaplerResponse rsp) throws IOException, ServletException {
|
||||
rsp.setStatus(HttpServletResponse.SC_OK);
|
||||
}
|
||||
|
||||
@@ -103,9 +102,6 @@ public class ExternalJob extends ViewJob<ExternalJob,ExternalRun> implements Top
|
||||
rsp.setStatus(HttpServletResponse.SC_OK);
|
||||
}
|
||||
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ExternalJob.class.getName());
|
||||
|
||||
public TopLevelItemDescriptor getDescriptor() {
|
||||
return DESCRIPTOR;
|
||||
}
|
||||
|
||||
@@ -99,6 +99,7 @@ public class ExternalRun extends Run<ExternalJob,ExternalRun> {
|
||||
xpp.setInput(in);
|
||||
xpp.nextTag(); // get to the <run>
|
||||
xpp.nextTag(); // get to the <log>
|
||||
charset=xpp.getAttributeValue(null,"content-encoding");
|
||||
while(xpp.nextToken()!=XmlPullParser.END_TAG) {
|
||||
int type = xpp.getEventType();
|
||||
if(type==XmlPullParser.TEXT
|
||||
|
||||
@@ -180,7 +180,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
|
||||
* @see #getCharset()
|
||||
* @since 1.257
|
||||
*/
|
||||
private String charset;
|
||||
protected String charset;
|
||||
|
||||
/**
|
||||
* Keeps this log entries.
|
||||
|
||||
Reference in new issue
Block a user