Skip to content

Commit

Permalink
Merge pull request #1733 from daniel-beck/JENKINS-14899
Browse files Browse the repository at this point in the history
[FIX JENKINS-14899] Don't use truncating LargeText for /consoleText
  • Loading branch information
daniel-beck committed Jun 11, 2015
2 parents 9b7d8e9 + 20bd4e3 commit ad7cba9
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions core/src/main/java/hudson/model/Run.java
Expand Up @@ -39,10 +39,7 @@
import hudson.Util;
import hudson.XmlFile;
import hudson.cli.declarative.CLIMethod;
import hudson.console.AnnotatedLargeText;
import hudson.console.ConsoleLogFilter;
import hudson.console.ConsoleNote;
import hudson.console.ModelHyperlinkNote;
import hudson.console.*;
import hudson.model.Descriptor.FormException;
import hudson.model.Run.RunExecution;
import hudson.model.listeners.RunListener;
Expand Down Expand Up @@ -2089,19 +2086,13 @@ public void doBuildTimestamp( StaplerRequest req, StaplerResponse rsp, @QueryPar
*/
public void doConsoleText(StaplerRequest req, StaplerResponse rsp) throws IOException {
rsp.setContentType("text/plain;charset=UTF-8");
// Prevent jelly from flushing stream so Content-Length header can be added afterwards
FlushProofOutputStream out = new FlushProofOutputStream(rsp.getCompressedOutputStream(req));
try{
getLogText().writeLogTo(0,out);
} catch (IOException e) {
// see comment in writeLogTo() method
InputStream input = getLogInputStream();
try {
IOUtils.copy(input, out);
} finally {
IOUtils.closeQuietly(input);
}
} finally {
PlainTextConsoleOutputStream out = new PlainTextConsoleOutputStream(rsp.getCompressedOutputStream(req));
InputStream input = getLogInputStream();
try {
IOUtils.copy(input, out);
out.flush();
} finally {
IOUtils.closeQuietly(input);
IOUtils.closeQuietly(out);
}
}
Expand Down

0 comments on commit ad7cba9

Please sign in to comment.