Compare commits

...

5 Commits

Author SHA1 Message Date
Dora Korpar 405db0e344 [squash] where is this fraking callback 2018-08-24 14:40:25 -07:00
Dora Korpar 0d169ff0d2 [squash] return data.put 2018-08-24 14:26:34 -07:00
Dora Korpar 0da0816e55 [squash] more logs 2018-08-24 14:14:37 -07:00
Dora Korpar c212df91f1 [squash] console log error 2018-08-24 12:31:21 -07:00
Dora Korpar ca5e527b9c bf: ZENKO 966 storage error 2018-08-24 10:21:02 -07:00
4 changed files with 11 additions and 2 deletions

View File

@ -13,10 +13,12 @@ const V4Transform = require('../../../auth/streamingV4/V4Transform');
function prepareStream(stream, streamingV4Params, log, cb) { function prepareStream(stream, streamingV4Params, log, cb) {
if (stream.headers['x-amz-content-sha256'] === if (stream.headers['x-amz-content-sha256'] ===
'STREAMING-AWS4-HMAC-SHA256-PAYLOAD') { 'STREAMING-AWS4-HMAC-SHA256-PAYLOAD') {
console.log('\n\n-----BEFORE V4TRANSFORM-----\n\n');
const v4Transform = new V4Transform(streamingV4Params, log, cb); const v4Transform = new V4Transform(streamingV4Params, log, cb);
stream.pipe(v4Transform); stream.pipe(v4Transform);
return v4Transform; return v4Transform;
} }
console.log('\n\n-----NO V4TRANSFORM----\n\n');
return stream; return stream;
} }

View File

@ -52,18 +52,20 @@ function checkHashMatchMD5(stream, hashedStream, dataRetrievalInfo, log, cb) {
function dataStore(objectContext, cipherBundle, stream, size, function dataStore(objectContext, cipherBundle, stream, size,
streamingV4Params, backendInfo, log, cb) { streamingV4Params, backendInfo, log, cb) {
const dataStream = prepareStream(stream, streamingV4Params, log, cb); const dataStream = prepareStream(stream, streamingV4Params, log, cb);
data.put(cipherBundle, dataStream, size, objectContext, backendInfo, log, return data.put(cipherBundle, dataStream, size, objectContext, backendInfo,
(err, dataRetrievalInfo, hashedStream) => { log, (err, dataRetrievalInfo, hashedStream) => {
if (err) { if (err) {
log.error('error in datastore', { log.error('error in datastore', {
error: err, error: err,
}); });
console.log('\n\n-----ERROR CB-----\n\n')
return cb(err); return cb(err);
} }
if (!dataRetrievalInfo) { if (!dataRetrievalInfo) {
log.fatal('data put returned neither an error nor a key', { log.fatal('data put returned neither an error nor a key', {
method: 'storeObject::dataStore', method: 'storeObject::dataStore',
}); });
console.log('\n\n-----NO DATA RETRIEVAL INFO ERROR CB-----\n\n');
return cb(errors.InternalError); return cb(errors.InternalError);
} }
log.trace('dataStore: backend stored key', { log.trace('dataStore: backend stored key', {

View File

@ -268,6 +268,9 @@ class V4Transform extends Transform {
// final callback // final callback
err => { err => {
if (err) { if (err) {
this.log.error('error preparing stream', {
error: err,
});
return this.cb(err); return this.cb(err);
} }
// get next chunk // get next chunk

View File

@ -167,6 +167,7 @@ const data = {
'following object PUT failure', 'following object PUT failure',
{ error: error.message }); { error: error.message });
} }
console.log('\n\n----ERROR ON PUT----\n\n');
return cb(err); return cb(err);
}); });
} }
@ -180,6 +181,7 @@ const data = {
}); });
return undefined; return undefined;
} }
console.log('\n\n-----SHOULD NOT RETURN LE CB-----\n\n');
return cb(null, dataRetrievalInfo); return cb(null, dataRetrievalInfo);
}); });
}); });