Skip to content

Commit

Permalink
Proxy protocol v1 support: Removed automatic socket destruction on er…
Browse files Browse the repository at this point in the history
…rors, it was introduced by mistake.

Proxy protocol tests: server reset after each test.
  • Loading branch information
rmruano committed Sep 28, 2021
1 parent d613937 commit 2bd2152
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion lib/smpp.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ function Session(options) {
this.socket.on('error', function(e) {
clearTimeout(connectTimeout);
self.debug("socket.error", e.message, e);
if (self.socket) self.socket.destroy();
if (self._interval) {
clearInterval(self._interval);
self._interval = 0;
Expand Down
9 changes: 5 additions & 4 deletions test/proxy_protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('ProxyProtocol', function() {
}
}

before(function (done) {
beforeEach(function (done) {
server = smpp.createServer({
enable_proxy_protocol_detection: true,
}, function (session) {
Expand All @@ -49,11 +49,12 @@ describe('ProxyProtocol', function() {
port = server.address().port;
});

after(function (done) {
afterEach(function (done) {
server.sessions.forEach(function (session) {
session.destroy();
session.close();
});
server.close(done);
server.close();
done();
});

it('should decode an IPv4 proxy protocol header and use it as remoteAddress', function (done) {
Expand Down

0 comments on commit 2bd2152

Please sign in to comment.