Skip to content

Commit

Permalink
[FIX JENKINS-14899] Don't use truncating LargeText for /consoleText
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-beck committed Jun 9, 2015
1 parent b6bff4f commit 20bd4e3
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 20bd4e3

Please sign in to comment.