Comparison

net/connlisteners.lua @ 2551:5f15f21014c4

net.connlisteners: Return an error if no SSL context is supplied for a connection of type 'ssl'
author Matthew Wild <mwild1@gmail.com>
date Sun, 31 Jan 2010 17:08:57 +0000
parent 2547:b2cb0935f158
child 2925:692b3c6c5bd2
comparison
equal deleted inserted replaced
2550:445b1de5652e 2551:5f15f21014c4
57 local port = (udata and udata.port) or h.default_port or error("Can't start listener "..name.." because no port was specified, and it has no default port", 0); 57 local port = (udata and udata.port) or h.default_port or error("Can't start listener "..name.." because no port was specified, and it has no default port", 0);
58 local mode = (udata and udata.mode) or h.default_mode or 1; 58 local mode = (udata and udata.mode) or h.default_mode or 1;
59 local ssl = (udata and udata.ssl) or nil; 59 local ssl = (udata and udata.ssl) or nil;
60 local autossl = udata and udata.type == "ssl"; 60 local autossl = udata and udata.type == "ssl";
61 61
62 if autossl and not ssl then
63 return nil, "no ssl context";
64 end
65
62 return server.addserver(interface, port, h, mode, autossl and ssl or nil); 66 return server.addserver(interface, port, h, mode, autossl and ssl or nil);
63 end 67 end
64 68
65 return _M; 69 return _M;