Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleanup

  cleanup gpl display
  move 'libblode' to 'util'
  • Loading branch information...
commit f19f00bd774b7fdf8aeb501d024ac4bd2c0ae6fb 1 parent f6a35ce
@benlemasurier authored
View
2  .gitignore
@@ -0,0 +1,2 @@
+*.swp
+node_modules/
View
0  LICENSE-GPLv2 → COPYING
File renamed without changes
View
37 blode.js
@@ -2,19 +2,8 @@
* Blode - a simple, powerful syslog-like event broadcast daemon
* Copyright (C) 2010 Ben LeMasurier
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * This program can be distributed under the terms of the GNU GPL.
+ * See the file COPYING.
*/
/*
@@ -30,14 +19,14 @@ HOST = "127.0.0.1";
require("./lib/Math.uuid");
-var lib = require("./lib/libblode"),
- ws = require("websocket-server"),
- net = require("net"),
- sys = require("sys"),
- url = require("url"),
- http = require("http"),
- dgram = require("dgram"),
- event = require("events"),
+var util = require("./lib/util"),
+ ws = require("websocket-server"),
+ net = require("net"),
+ sys = require("sys"),
+ url = require("url"),
+ http = require("http"),
+ dgram = require("dgram"),
+ event = require("events"),
emitter = new event.EventEmitter,
config = require('./config').config,
log_buffer = { id: 0, severity: 'none', message: '--MARK--' };
@@ -134,13 +123,13 @@ var server = net.createServer(function(stream) {
socket_clients.remove(client);
client.stream.end();
});
-
+
stream.on('data', function(data) {
socket_buffer += data;
var message = socket_buffer.indexOf("\r");
- if (message !== -1) {
+ if (message !== -1) {
var json = socket_buffer.slice(0, message);
- try {
+ try {
var broadcast_events = JSON.parse(json);
View
9 lib/libblode.js
@@ -1,9 +0,0 @@
-/*
- * blode support library
- */
-Array.prototype.remove = function(e) {
- for(var i = 0, j = this.length; i < j; i++) {
- if(e == this[i])
- return(this.splice(i, 1));
- }
-};
View
13 lib/util.js
@@ -0,0 +1,13 @@
+/*
+ * Blode - a simple, powerful syslog-like event broadcast daemon
+ * Copyright (C) 2010 Ben LeMasurier <ben.lemasurier@gmail.com>
+ *
+ * This program can be distributed under the terms of the GNU GPL.
+ * See the file COPYING.
+ */
+
+Array.prototype.remove = function(e) {
+ for(var i = 0, j = this.length; i < j; i++)
+ if(e == this[i])
+ return this.splice(i, 1);
+};
Please sign in to comment.
Something went wrong with that request. Please try again.