Permalink
Browse files

Increase process.setMaxListeners

  • Loading branch information...
erming committed Apr 29, 2015
1 parent 7138ca6 commit 2cee0ea6ef5ee51de0190332f976934b55bbc8e4
Showing with 13 additions and 6 deletions.
  1. +9 −4 CHANGELOG.md
  2. +2 −2 package.json
  3. +2 −0 src/plugins/irc-events/link.js
View
@@ -1,3 +1,8 @@
0.51.1 / 2015-04-29
===================
* Increase process.setMaxListeners to prevent link preview to cause a crash
0.51.0 / 2015-04-16
==================
@@ -6,24 +11,24 @@
* Added 'displayNetwork' setting
0.49.3 / 2015-01-04
==================
===================
* Fully expand chat when userlist is hidden
* Remove vertical whitespace in chat windows
* Support @mention
0.49.2 / 2015-01-04
==================
===================
* Fix crash on broken links
0.49.1 / 2015-01-04
==================
===================
* Fix undefined content-type (link plugin)
0.49.0 / 2014-12-23
==================
===================
* Replaced superagent with request
* Solves a problem where some links would crash the server
View
@@ -1,7 +1,7 @@
{
"name": "shout",
"description": "Web IRC client",
"version": "0.51.0",
"description": "The self-hosted Web IRC client",
"version": "0.51.1",
"author": "Mattias Erming",
"preferGlobal": true,
"bin": {
@@ -5,6 +5,8 @@ var request = require("request");
var Helper = require("../../helper");
var es = require('event-stream');
process.setMaxListeners(0);
module.exports = function(irc, network) {
var client = this;
irc.on("message", function(data) {

6 comments on commit 2cee0ea

@jmcbee

This comment has been minimized.

Show comment
Hide comment
@jmcbee

jmcbee May 9, 2015

Contributor

Hello,

Why would link preview cause a crash without max listeners set to 0?

Contributor

jmcbee replied May 9, 2015

Hello,

Why would link preview cause a crash without max listeners set to 0?

@erming

This comment has been minimized.

Show comment
Hide comment
@erming

erming May 9, 2015

Owner

The default maxListener is 10 (if I remember correctly), and when you pass that limit, the library emits an exception.

So if I were to link more than 10 links in a very short period of time, this would open too many listeners and crash.

Owner

erming replied May 9, 2015

The default maxListener is 10 (if I remember correctly), and when you pass that limit, the library emits an exception.

So if I were to link more than 10 links in a very short period of time, this would open too many listeners and crash.

@jmcbee

This comment has been minimized.

Show comment
Hide comment
@jmcbee

jmcbee May 9, 2015

Contributor

Hello,

Thanks for the reply. Would it be that the listener for these links aren't being closed? This might be a source of a memory leak.

Contributor

jmcbee replied May 9, 2015

Hello,

Thanks for the reply. Would it be that the listener for these links aren't being closed? This might be a source of a memory leak.

@erming

This comment has been minimized.

Show comment
Hide comment
@erming

erming May 9, 2015

Owner

I found an issue from the request.js library: request/request#311

From reading the comments, it seems that some links may create a redirect loop. Blergh..

Owner

erming replied May 9, 2015

I found an issue from the request.js library: request/request#311

From reading the comments, it seems that some links may create a redirect loop. Blergh..

@jmcbee

This comment has been minimized.

Show comment
Hide comment
@jmcbee

jmcbee May 10, 2015

Contributor

Maybe we should use a simpler http client library.

Contributor

jmcbee replied May 10, 2015

Maybe we should use a simpler http client library.

@pdurbin

This comment has been minimized.

Show comment
Hide comment
@pdurbin

pdurbin Nov 15, 2015

I was hoping this commit might solve the problem I'm having of Shout crashing ( https://github.com/erming/shout-roadmap/issues/10 ) but I'm already running version 0.51.1. If anyone has any ideas for me, please let me know! Thanks.

pdurbin replied Nov 15, 2015

I was hoping this commit might solve the problem I'm having of Shout crashing ( https://github.com/erming/shout-roadmap/issues/10 ) but I'm already running version 0.51.1. If anyone has any ideas for me, please let me know! Thanks.

Please sign in to comment.