Skip to content

Commit

Permalink
We don't need to re-parse the rfc822 stream, we are reusing the headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jun 1, 2015
1 parent e6486be commit f7641fe
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions framework/ActiveSync/lib/Horde/ActiveSync/Rfc822.php
Expand Up @@ -122,15 +122,13 @@ public function replaceMime(Horde_Mime_Part $part)
'stream' => true,
'headers' => false)
);
$mime_stream = new Horde_Stream_Existing(array('stream' => $mime_stream));

if (!empty($this->_header_text)) {
$hdr = $this->_header_text;
} else {
$this->_stream->rewind();
$hdr = $this->_stream->substring(0, $this->_hdr_pos);
}
$new_stream = Horde_Stream_Wrapper_Combine::getStream(array($hdr, $mime_stream));
$this->_parseStream(new Horde_Stream_Existing(array('stream' => $new_stream)));
// Since we are still using the headers sent from the device, we can
// simply zero out the position members etc...
$this->_hdr_pos = 0;
$this->_stream = $mime_stream;
$mime_stream->rewind();
}

/**
Expand Down

0 comments on commit f7641fe

Please sign in to comment.