Commit f5193b54 authored by mku's avatar mku

ZP-185 #commentRemove padding from stream wrappers #time 10m

git-svn-id: https://z-push.org/svn/z-push/trunk@1403 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent f033b825
......@@ -48,7 +48,6 @@ class MAPIStreamWrapper {
private $mapistream;
private $position;
private $streamlength;
private $streampad = 0; // pad stream with 0 string for stream converter (streamlength must be multiple of 4)
/**
* Opens the stream
......
......@@ -48,7 +48,6 @@ class StringStreamWrapper {
private $stringstream;
private $position;
private $stringlength;
private $streampad = 0; // pad stream with 0 string for stream converter (streamlength must be multiple of 4)
/**
* Opens the stream
......@@ -74,11 +73,6 @@ class StringStreamWrapper {
$this->stringstream = $contextOptions[self::PROTOCOL]['string'];
$this->stringlength = strlen($this->stringstream);
// pad the stream to the multiple of 4
if ($this->stringlength % 4 != 0 )
$this->streampad = $this->stringlength + 4 - ($this->stringlength % 4);
ZLog::Write(LOGLEVEL_DEBUG, sprintf("StringStreamWrapper::stream_open(): initialized stream length: %d", $this->stringlength));
return true;
......@@ -95,8 +89,6 @@ class StringStreamWrapper {
public function stream_read($len) {
$data = substr($this->stringstream, $this->position, $len);
$this->position += strlen($data);
if ($this->position == $this->stringlength && $this->streampad != 0 )
$data = str_pad($data, $this->streampad, 0x0);
return $data;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment