Skip to content

Instantly share code, notes, and snippets.

View skaurus's full-sized avatar

Dmitry Shalashov skaurus

View GitHub Profile
@skaurus
skaurus / gist:635395
Created October 19, 2010 23:25
buggy mojo init.d
#!/bin/bash
#
# around Startup script for the around web application
#
# chkconfig: 35 85 15
# description: around
# pidfile: /var/run/around.pid
# Source function library.
. /etc/rc.d/init.d/functions
#!/bin/sh
#
# chkconfig: 345 85 15
# description: Mojolicious app init.d script
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
--- new3.js 2010-07-07 10:07:46.000000000 +0000
+++ ws_my.js 2010-07-07 10:08:53.000000000 +0000
@@ -52,7 +52,10 @@
policy_file = '<cross-domain-policy><allow-access-from domain="*" to-ports="*" /></cross-domain-policy>';
-exports.createServer = function (websocketListener) {
+exports.createServer = function (websocketListener, options) {
+ if (!options) options = {};
+ if (!options.flashpolicy) options.flashpolicy = policy_file;
--- ws.js 2010-07-06 07:23:24.000000000 +0000
+++ ws_my.js 2010-07-07 09:33:39.000000000 +0000
@@ -12,16 +12,26 @@
});
}
-var sys = require("sys"),
- net = require("net"),
- headerExpressions = [
- /^GET (\/[^\s]*) HTTP\/1\.1$/,
--- lib/http1.js 2010-07-06 07:54:46.000000000 +0000
+++ lib/http.js 2010-07-06 07:53:55.000000000 +0000
@@ -37,7 +37,7 @@
parser.onHeaderField = function (b, start, len) {
var slice = b.toString('ascii', start, start+len).toLowerCase();
- if (parser.value) {
+ if (parser.value != undefined) {
parser.incoming._addHeaderLine(parser.field, parser.value);
parser.field = null;