Permalink
Browse files

Merge branch 'pdu-writer-bugfix01'

  • Loading branch information...
2 parents f71778b + fc11b28 commit 5248b082a20810a9c034458628627a10348aaf04 @bjyoungblood bjyoungblood committed Mar 9, 2013
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
@@ -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
@@ -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
@@ -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": [

0 comments on commit 5248b08

Please sign in to comment.