Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Avoid locking with logging #276

Merged
merged 2 commits into from

2 participants

@badosu
Collaborator

Sets socket.io loglevel to warn by default and to debug if config.debug is set.

Sets the debug value to false by default. The reason for this is that users may DoS unintentionally a subway server by issuing /list commands, this is specially worse when the output is being printed on stdout or a file.

@ericbarch ericbarch merged commit e21bca5 into thedjpetersen:master
@badosu badosu deleted the badosu:avoid-locking-with-logging branch
@badosu
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 22, 2013
  1. @badosu

    Set debug to false as default

    badosu authored
  2. @badosu
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 1 deletion.
  1. +1 −1  config.js
  2. +8 −0 lib/subway.js
View
2  config.js
@@ -1,5 +1,5 @@
module.exports = {
- debug: true,
+ debug: false,
dbadapter: 'sqlite3',
dbname: process.env.DB_PATH || 'subway.db',
View
8 lib/subway.js
@@ -41,6 +41,14 @@ Subway.prototype.start = function () {
// link up socket.io with our express app
instance.app.io = io.listen(server);
+
+ if (config.debug) {
+ instance.app.io.set("log level", 3);
+ }
+ else {
+ instance.app.io.set("log level", 1);
+ }
+
if (config.use_polling) {
instance.app.io.configure(function() {
instance.app.io.set("transports", ["xhr-polling"]);
Something went wrong with that request. Please try again.