Fixed problem with UCS2 encoded long messages
This commit is contained in:
+9
-2
@@ -2,7 +2,8 @@
|
||||
|
||||
// More or less copied from https://github.com/farhadi/node-smpp
|
||||
|
||||
var iconv = require('iconv-lite'),
|
||||
var log = require('winston'),
|
||||
iconv = require('iconv-lite'),
|
||||
encodings = {},
|
||||
filters = {},
|
||||
tlvsById = {},
|
||||
@@ -135,7 +136,13 @@ types = {
|
||||
},
|
||||
write: function(value, buffer, offset) {
|
||||
value = value || 0;
|
||||
buffer.writeUInt8(value, offset);
|
||||
|
||||
try {
|
||||
buffer.writeUInt8(value, offset);
|
||||
} catch (err) {
|
||||
log.error('larvitsmpp: lib/defs.js - Could not write integer value "' + value + '" on offset "' + offset + '" when buffer length is "' + buffer.length + '"');
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
size: function() {
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user