Comparing version 1.1.1 to 1.1.2
@@ -372,2 +372,3 @@ // File: block_file.js | ||
// console.warn("BlockFile#flush: called!") | ||
async.series( [ function(scb){ self.writeSegments(scb) } | ||
@@ -614,3 +615,3 @@ , function(scb){ self.writeHeader(scb) } | ||
var seg = this.segment[hdl.segNum] | ||
var seg = this.segments[hdl.segNum] | ||
@@ -684,3 +685,6 @@ var ok = seg.release(hdl) | ||
cb = hdl | ||
hdl = undefined | ||
} | ||
//hdl == null covers null and undefined | ||
if ( hdl == null || hdl.size() < buffer.length) { | ||
numBlks = Math.ceil( buffer.length / this.props.blockSize() ) | ||
@@ -690,4 +694,2 @@ hdl = this.reserve(numBlks) | ||
//this._store(buffer, hdl, cb) | ||
blkOff = this._calcBlkOff(hdl.segNum, hdl.blkNum) | ||
@@ -694,0 +696,0 @@ fs.write( this.fd |
@@ -143,3 +143,14 @@ | ||
/** | ||
* Calculate the size of space (in bytes) that the Handle points to. | ||
* | ||
* @return {Number} non-zero positive integer number of bytes | ||
*/ | ||
Handle.prototype.size = function(){ | ||
return (this.spanNum+1) * this.props.blockSize() | ||
} | ||
/** | ||
* Encode a handle into a 32 or 64 (based on props) value. | ||
@@ -146,0 +157,0 @@ * |
{ | ||
"name" : "block-file" | ||
, "version" : "1.1.1" | ||
, "version" : "1.1.2" | ||
, "description" : "A library to read/write blocks from a file" | ||
@@ -5,0 +5,0 @@ , "keywords" : ["block", "buffer", "storage"] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98040
2678