From 1067d1738109d3a559df80648bf7736a5e133a72 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Mon, 25 Jul 2011 16:31:41 +0100 Subject: [PATCH] Log the disconnect diagnostic info that etherpad still sends. Maybe thats usefull --- node/server.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/node/server.js b/node/server.js index f663f696..a1c42ae1 100644 --- a/node/server.js +++ b/node/server.js @@ -31,6 +31,7 @@ var async = require('async'); var express = require('express'); var path = require('path'); var minify = require('./minify'); +var formidable = require('formidable'); var exportHandler; var importHandler; var exporthtml; @@ -217,6 +218,17 @@ async.waterfall([ importHandler.doImport(req, res, req.params.pad); }); + //The Etherpad client side sends information about how a disconnect happen + //I don't know how to use them, but maybe there usefull, so we should print them out to the log + app.post('/ep/pad/connection-diagnostic-info', function(req, res) + { + new formidable.IncomingForm().parse(req, function(err, fields, files) + { + console.log(new Date().toUTCString() + ": DIAGNOSTIC-INFO: " + fields.diagnosticInfo); + res.end("OK"); + }); + }); + //serve index.html under / app.get('/', function(req, res) {