# HG changeset patch # User Matthew Wild # Date 1320218246 0 # Node ID cf4e49b250c7c3d0e66be2e7d3bca602a0ca4969 # Parent 2928a74357c89f53c2ddfe0179bb42447f428f8a# Parent c8f7ae9381cd9063bb3ce1545d4083fefec41716 Merge with Zash diff -r 2928a74357c8 -r cf4e49b250c7 core/certmanager.lua --- a/core/certmanager.lua Sun Oct 23 20:56:33 2011 +0200 +++ b/core/certmanager.lua Wed Nov 02 07:17:26 2011 +0000 @@ -75,9 +75,9 @@ else reason = "Reason: "..tostring(reason):lower(); end - log("error", "SSL/TLS: Failed to load %s: %s", file, reason); + log("error", "SSL/TLS: Failed to load %s: %s (host: %s)", file, reason, host); else - log("error", "SSL/TLS: Error initialising for host %s: %s", host, err ); + log("error", "SSL/TLS: Error initialising for host %s: %s (host: %s)", host, err, host); end end return ctx, err; diff -r 2928a74357c8 -r cf4e49b250c7 prosody --- a/prosody Sun Oct 23 20:56:33 2011 +0200 +++ b/prosody Wed Nov 02 07:17:26 2011 +0000 @@ -203,7 +203,7 @@ -- path1;path2;path3;defaultpath... CFG_PLUGINDIR = table.concat(custom_plugin_paths, path_sep)..path_sep..(CFG_PLUGINDIR or "plugins"); end - prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR, + prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR or ".", plugins = CFG_PLUGINDIR or "plugins", data = data_path }; prosody.arg = _G.arg; diff -r 2928a74357c8 -r cf4e49b250c7 util/jid.lua --- a/util/jid.lua Sun Oct 23 20:56:33 2011 +0200 +++ b/util/jid.lua Wed Nov 02 07:17:26 2011 +0000 @@ -13,6 +13,16 @@ local nameprep = require "util.encodings".stringprep.nameprep; local resourceprep = require "util.encodings".stringprep.resourceprep; +local escapes = { + [" "] = "\\20"; ['"'] = "\\22"; + ["&"] = "\\26"; ["'"] = "\\27"; + ["/"] = "\\2f"; [":"] = "\\3a"; + ["<"] = "\\3c"; [">"] = "\\3e"; + ["@"] = "\\40"; ["\\"] = "\\5c"; +}; +local unescapes = {}; +for k,v in pairs(escapes) do unescapes[v] = k; end + module "jid" local function _split(jid) @@ -91,4 +101,7 @@ return false end +function escape(s) return s and (s:gsub(".", escapes)); end +function unescape(s) return s and (s:gsub("\\%x%x", unescapes)); end + return _M;