Comparing version 0.1.0-alpha.30 to 0.1.0-alpha.31
@@ -46,2 +46,6 @@ 'use strict'; | ||
this.socket.once('error', err => this.onError(err)); | ||
this.parser.once('error', err => { | ||
this.onError(err); | ||
return this.close(); | ||
}); | ||
} | ||
@@ -48,0 +52,0 @@ |
'use strict'; | ||
const EventEmitter = require('events'); | ||
// We use 4-bytes unsigned integers so we waste the fourth byte when limiting | ||
@@ -8,4 +10,5 @@ // max frame size number in megabytes. The good thing is that we can increase the | ||
class FrameParser { | ||
class FrameParser extends EventEmitter { | ||
constructor(socket, handler) { | ||
super(); | ||
this.socket = socket; | ||
@@ -65,3 +68,3 @@ this.handler = handler; | ||
if (this.frame > MAX_ALLOWED_FRAME_SIZE) { | ||
return this.socket.end('Invalid Frame Size'); | ||
return this.emit('error', new Error('Invalid Frame Size')); | ||
} | ||
@@ -68,0 +71,0 @@ if (chunk.length > 4) { |
{ | ||
"name": "zone-mta", | ||
"private": false, | ||
"version": "0.1.0-alpha.30", | ||
"version": "0.1.0-alpha.31", | ||
"description": "Tiny outbound MTA", | ||
@@ -6,0 +6,0 @@ "main": "app.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
305721
6033