Closes socket when receiving malformed messages from client. Node-stratum now passes 20k concurrent requests with apache benchmark test.
This commit is contained in:
parent
9a9726cd1d
commit
04ba84f185
|
@ -170,8 +170,11 @@ var StratumClient = function(options){
|
|||
messageJson = JSON.parse(message);
|
||||
} catch(e) {
|
||||
_this.emit('malformedMessage', message);
|
||||
socket.end();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (messageJson) {
|
||||
handleMessage(messageJson);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue