Closes socket when receiving malformed messages from client. Node-stratum now passes 20k concurrent requests with apache benchmark test.

This commit is contained in:
Matt 2014-02-20 15:49:43 -07:00
parent 9a9726cd1d
commit 04ba84f185
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}