make changes recommended in Issue 97

This commit is contained in:
Doug Campbell 2013-01-14 17:14:35 +08:00
parent 51e6abf477
commit efb3ea98b7
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) { ModifyDNRequest.prototype._toBer = function (ber) {
assert.ok(ber); //assert.ok(ber);
ber.writeString(this.entry.toString()); ber.writeString(this.entry.toString());
ber.writeString(this.newRdn.toString()); ber.writeString(this.newRdn.toString());
ber.writeBoolean(this.deleteOldRdn); ber.writeBoolean(this.deleteOldRdn);
if (this.newSuperior) if (this.newSuperior) {
ber.writeString(this.newSuperior.toString()); 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; return ber;
}; };