Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

PDU writer bug fix #11

Merged
merged 4 commits into from

2 participants

This page is out of date. Refresh to see the latest.
Showing with 8 additions and 8 deletions.
  1. +1 −1  README.md
  2. +6 −6 lib/pdu-writer.js
  3. +1 −1  package.json
View
2  README.md
@@ -1,6 +1,6 @@
Shorty - SMPP Client / Server
================================
-Version 0.5.0 Created by Evan Coury and Ben Youngblood
+Version 0.5.4 Created by Evan Coury and Ben Youngblood
Introduction
View
12 lib/pdu-writer.js
@@ -52,7 +52,7 @@ exports.write = function(pdu) {
} else if (field.type === "c-string") {
// get the actual byte length of the string, then add 1 for the
// null terminator
-
+
// Don't try to do anything to a buffer
if (!Buffer.isBuffer(field.value)) {
if (typeof field.value === 'string') {
@@ -155,7 +155,7 @@ exports.write = function(pdu) {
}
} else if (field.type === "c-string") {
// TODO still need to do error checking for out-of-bounds lengths
-
+
/**
* Unlike with reading, this method can actually be the same for
* fixed- and variable-length strings
@@ -187,12 +187,12 @@ exports.write = function(pdu) {
if (definition.octets !== undefined) {
length += definition.octets;
} else {
- if (Buffer.isBuffer(pdu.optional_params[param])) {
- length += pdu.optional_params[param].length;
+ if (Buffer.isBuffer(param)) {
+ length += param.length;
} else {
- length += Buffer.byteLength(pdu.optional_params[param]);
+ length += Buffer.byteLength(param);
}
- }
+ }
// Write the tag and length -- 2 bytes each
buffer.writeUInt16BE(definition.tag, offset);
View
2  package.json
@@ -1,7 +1,7 @@
{
"name": "shorty",
"description": "An asynchronous SMPP client and server built on Node.js.",
- "version": "0.5.3",
+ "version": "0.5.4",
"directories": { "lib": "./lib" },
"main" : "./lib/shorty",
"maintainers": [
Something went wrong with that request. Please try again.