Merge pull request #112 from wdouglascampbell/Issue97

make changes recommended in Issue 97
This commit is contained in:
Mark Cavage 2013-01-14 07:56:15 -08:00
commit dc359215aa
1 changed files with 11 additions and 3 deletions

View File

@ -68,13 +68,21 @@ ModifyDNRequest.prototype._parse = function (ber) {
ModifyDNRequest.prototype._toBer = function (ber) {
assert.ok(ber);
//assert.ok(ber);
ber.writeString(this.entry.toString());
ber.writeString(this.newRdn.toString());
ber.writeBoolean(this.deleteOldRdn);
if (this.newSuperior)
ber.writeString(this.newSuperior.toString());
if (this.newSuperior) {
var s = this.newSuperior.toString();
var len = Buffer.byteLength(s);
ber.writeByte(0x80); // MODIFY_DN_REQUEST_NEW_SUPERIOR_TAG
ber.writeByte(len);
ber._ensure(len);
ber._buf.write(s, ber._offset);
ber._offset += len;
}
return ber;
};