Minor simplification of code
This commit is contained in:
+4
-7
@@ -310,25 +310,22 @@ function sendReturn(pdu, status, params, closeAfterSend, callback) {
|
||||
closeAfterSend = undefined;
|
||||
}
|
||||
|
||||
if (typeof callback !== 'function') {
|
||||
callback = function() {};
|
||||
}
|
||||
|
||||
utils.pduReturn(pdu, status, params, function(err, retPdu) {
|
||||
if (err) {
|
||||
log.error('larvitsmpp: lib/session.js: sendReturn() - Could not create return PDU: ' + err.message);
|
||||
that.closeSocket();
|
||||
|
||||
if (typeof callback === 'function') {
|
||||
callback(err);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
log.silly('larvitsmpp: lib/session.js: sendReturn() - Sending return PDU: ' + retPdu.toString('hex'));
|
||||
|
||||
that.sockWrite(retPdu, closeAfterSend);
|
||||
|
||||
if (typeof callback === 'function') {
|
||||
callback(null, retPdu);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user