Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

client should handle parse errors the same way the server does

  • Loading branch information...
commit 411fb317201b87cbde1a9f233fb0e194be27d1e5 1 parent 469f1d9
@bjyoungblood bjyoungblood authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/client.js
View
12 lib/client.js
@@ -97,8 +97,16 @@ exports.client = function(config) {
// so we need to keep track of anything that's been split up
try {
parsedBuffer = data.fromBuffer(buffer, self.splitPacketBuffer);
- } catch (ex) {
- self.emit('error', ex);
+ } catch (err) {
+ self.unbind();
+ self.emit('smppError', err);
+ return;
+ }
+
+ if (typeof parsedBuffer !== "object") {
+ self.unbind();
+ self.emit('smppError', "bad data from server or something weird");
+ return;
}
pdus = parsedBuffer.pdus;
Please sign in to comment.
Something went wrong with that request. Please try again.