Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix JENKINS-23660
  • Loading branch information
slide committed Jul 11, 2014
1 parent ea33390 commit bdece53
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/hudson/plugins/emailext/AttachmentUtils.java
Expand Up @@ -84,8 +84,13 @@ public LogFileDataSource(AbstractBuild<?,?> build, boolean compress) {

public InputStream getInputStream() throws IOException {
InputStream res;
long logFileLength = build.getLogText().length();
long pos = 0;
ByteArrayOutputStream bao = new ByteArrayOutputStream();
build.getLogText().writeLogTo(0, bao);

while(pos < logFileLength) {
pos = build.getLogText().writeLogTo(pos, bao);
}

res = new ByteArrayInputStream(bao.toByteArray());
if(compress) {
Expand Down Expand Up @@ -189,7 +194,7 @@ public static void attachBuildLog(ExtendedEmailPublisherContext context, Multipa
+ " too large for maximum attachments size");
return;
}

DataSource fileSource;
MimeBodyPart attachment = new MimeBodyPart();
if (compress) {
Expand Down

0 comments on commit bdece53

Please sign in to comment.