Skip to content

Commit c820413

Browse files
committed
Minor protocol fixes for Thin mode
1 parent 15f10c1 commit c820413

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/thin/protocol/buffer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ class BaseBuffer {
987987
writeUInt64BE(n) {
988988
const buf = this.reserveBytes(8);
989989
buf.writeUInt32BE(0);
990-
buf.writeUInt32BE(n);
990+
buf.writeUInt32BE(n, 4);
991991
}
992992

993993
//---------------------------------------------------------------------------

lib/thin/protocol/messages/dataType.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,16 @@ const Message = require("./base.js");
3838
*/
3939
class DataTypeMessage extends Message {
4040

41-
decode() { }
41+
processMessage(buf) {
42+
while (true) { // eslint-disable-line
43+
const dataType = buf.readUInt16BE();
44+
if (dataType === 0)
45+
break;
46+
const convDataType = buf.readUInt16BE();
47+
if (convDataType !== 0)
48+
buf.skipBytes(4);
49+
}
50+
}
4251

4352
encode(buf) {
4453
buf.writeUInt8(constants.TNS_MSG_TYPE_DATA_TYPES);

0 commit comments

Comments
 (0)