Skip to content

Commit

Permalink
Merge pull request #280 from ota42y/hotfix/delimiter_fix
Browse files Browse the repository at this point in the history
Fix data split delimiter
  • Loading branch information
Chris Nehren committed Jan 10, 2015
2 parents 795d23b + 84c2110 commit c98030f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/irc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ exports.colors = colors;

var replyFor = require('./codes');

var lineDelimiter = new RegExp('\r\n|\r|\n')

function Client(server, nick, opt) {
var self = this;
self.opt = {
Expand Down Expand Up @@ -736,7 +738,7 @@ Client.prototype.connect = function(retryCount, callback) {
buffer = Buffer.concat([buffer, chunk]);
}

var lines = self.convertEncoding(buffer).toString().split('\r\n');
var lines = self.convertEncoding(buffer).toString().split(lineDelimiter);

if (lines.pop()) {
// if buffer is not ended with \r\n, there's more chunks.
Expand Down

0 comments on commit c98030f

Please sign in to comment.