Skip to content
Snippets Groups Projects
Commit c6bfc731 authored by Sam Tuke's avatar Sam Tuke
Browse files

Stream writing improved: working with dolphin + kate, gedit & nautilus give...

Stream writing improved: working with dolphin + kate, gedit & nautilus give errors, suspect those issues are clientside
.part file paths fixed in stream{}
parent 4aa80d02
Branches
No related tags found
No related merge requests found
...@@ -119,9 +119,6 @@ class Proxy extends \OC_FileProxy { ...@@ -119,9 +119,6 @@ class Proxy extends \OC_FileProxy {
// Decrypt the keyfile // Decrypt the keyfile
$plainKey = Crypt::multiKeyDecrypt( $encKeyfile, $shareKey, $privateKey ); $plainKey = Crypt::multiKeyDecrypt( $encKeyfile, $shareKey, $privateKey );
// trigger_error("\$shareKey = $shareKey");
// trigger_error("\$plainKey = $plainKey");
} else { } else {
// Make a new key // Make a new key
...@@ -208,8 +205,6 @@ class Proxy extends \OC_FileProxy { ...@@ -208,8 +205,6 @@ class Proxy extends \OC_FileProxy {
$plainData = Crypt::symmetricDecryptFileContent( $data, $plainKeyfile ); $plainData = Crypt::symmetricDecryptFileContent( $data, $plainKeyfile );
// trigger_error("PLAINDATA = ". var_export($plainData, 1));
} elseif ( } elseif (
Crypt::mode() == 'server' Crypt::mode() == 'server'
&& isset( $_SESSION['legacyenckey'] ) && isset( $_SESSION['legacyenckey'] )
......
...@@ -86,6 +86,9 @@ class Stream { ...@@ -86,6 +86,9 @@ class Stream {
// rawPath is relative to the data directory // rawPath is relative to the data directory
$this->rawPath = $this->userId . '/files/' . $this->relPath; $this->rawPath = $this->userId . '/files/' . $this->relPath;
// Fix .part filenames
$this->rawPath = Keymanager::fixPartialFilePath( $this->rawPath );
if ( if (
dirname( $this->rawPath ) == 'streams' dirname( $this->rawPath ) == 'streams'
and isset( self::$sourceStreams[basename( $this->rawPath )] ) and isset( self::$sourceStreams[basename( $this->rawPath )] )
...@@ -257,11 +260,6 @@ class Stream { ...@@ -257,11 +260,6 @@ class Stream {
$this->plainKey = Crypt::multiKeyDecrypt( $this->encKeyfile, $shareKey, $privateKey ); $this->plainKey = Crypt::multiKeyDecrypt( $this->encKeyfile, $shareKey, $privateKey );
// trigger_error( '$this->relPath = '.$this->relPath );
// trigger_error( '$this->userId = '.$this->userId);
// trigger_error( '$this->encKeyfile = '.$this->encKeyfile );
// trigger_error( '$this->plainKey1 = '.var_export($this->plainKey, 1));
return true; return true;
} else { } else {
...@@ -352,12 +350,6 @@ class Stream { ...@@ -352,12 +350,6 @@ class Stream {
// Save the sharekeys // Save the sharekeys
Keymanager::setShareKeys( $view, $this->relPath, $this->encKeyfiles['keys'] ); Keymanager::setShareKeys( $view, $this->relPath, $this->encKeyfiles['keys'] );
// trigger_error( "\$this->encKeyfiles['data'] = ".$this->encKeyfiles['data'] );
// trigger_error( '$this->relPath = '.$this->relPath );
// trigger_error( '$this->userId = '.$this->userId);
// trigger_error( '$this->encKeyfile = '.var_export($this->encKeyfiles, 1) );
// trigger_error( '$this->plainKey2 = '.var_export($this->plainKey, 1));
// If extra data is left over from the last round, make sure it // If extra data is left over from the last round, make sure it
// is integrated into the next 6126 / 8192 block // is integrated into the next 6126 / 8192 block
if ( $this->writeCache ) { if ( $this->writeCache ) {
...@@ -420,7 +412,7 @@ class Stream { ...@@ -420,7 +412,7 @@ class Stream {
// Clear $data ready for next round // Clear $data ready for next round
$data = ''; $data = '';
//
} else { } else {
// Read the chunk from the start of $data // Read the chunk from the start of $data
...@@ -428,8 +420,6 @@ class Stream { ...@@ -428,8 +420,6 @@ class Stream {
$encrypted = $this->preWriteEncrypt( $chunk, $this->plainKey ); $encrypted = $this->preWriteEncrypt( $chunk, $this->plainKey );
//trigger_error("\$encrypted = $encrypted");
// Write the data chunk to disk. This will be // Write the data chunk to disk. This will be
// attended to the last data chunk if the file // attended to the last data chunk if the file
// being handled totals more than 6126 bytes // being handled totals more than 6126 bytes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment