};
TCompactProtocol.prototype.writeBool = function(value) {
- if (booleanField_.name != NULL) {
+ if (this.booleanField_.name !== null) {
// we haven't written the field header yet
- this.writeFieldBeginInternal(booleanField_.name,
- booleanField_.fieldType,
- booleanField_.fieldId,
+ this.writeFieldBeginInternal(this.booleanField_.name,
+ this.booleanField_.fieldType,
+ this.booleanField_.fieldId,
(value ? TCompactProtocol.Types.CT_BOOLEAN_TRUE
: TCompactProtocol.Types.CT_BOOLEAN_FALSE));
- booleanField_.name = NULL;
+ this.booleanField_.name = null;
} else {
// we're not part of a field, so just write the value
this.writeByte((value ? TCompactProtocol.Types.CT_BOOLEAN_TRUE
n = new Int64(n);
}
if (! (n instanceof Int64)) {
- throw new TProtocolError(INVALID_DATA, "Expected Int64 or Number, found: " + n);
+ throw new TProtocolException(INVALID_DATA, "Expected Int64 or Number, found: " + n);
}
var buf = new Buffer(10);
throw new TProtocolException(NEGATIVE_SIZE, "Negative map size");
}
- var kvtype = 0;
+ var kvType = 0;
if (msize !== 0) {
kvType = this.trans.readByte();
}
// TODO: optimize this better, allocate one buffer instead of both:
var msg = new Buffer(out.length + 4);
binary.writeI32(msg, out.length);
- frameLeft = binary.readI32(this.inBuf, 0);
out.copy(msg, 4, 0, out.length);
this.onFlush(msg);
}
try {
svc = services[Object.keys(services)[0]];
} catch(e) {
- if (!route) {
- socket.write("HTTP/1.1 403 No Apache Thrift Service availible\r\n\r\n");
- return;
- }
+ socket.write("HTTP/1.1 403 No Apache Thrift Service availible\r\n\r\n");
+ return;
}
//Perform upgrade
var hash = crypto.createHash("sha1");
socket.on('data', function(frame) {
try {
while (frame) {
- result = wsFrame.decode(frame);
+ var result = wsFrame.decode(frame);
//Prepend any existing decoded data
if (data) {
if (result.data) {