Software /
code /
prosody
Comparison
net/server.lua @ 2967:c39ad633b26d
net.server: Fix logic error causing traceback when receiving a non-number port
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 09 Apr 2010 12:25:54 +0100 |
parent | 2923:b7049746bd29 |
child | 2968:fdd049a4e551 |
comparison
equal
deleted
inserted
replaced
2960:de405832bfb6 | 2967:c39ad633b26d |
---|---|
696 local err | 696 local err |
697 --out_put("server.lua: autossl on ", port, " is ", startssl) | 697 --out_put("server.lua: autossl on ", port, " is ", startssl) |
698 if type( listeners ) ~= "table" then | 698 if type( listeners ) ~= "table" then |
699 err = "invalid listener table" | 699 err = "invalid listener table" |
700 end | 700 end |
701 if not type( port ) == "number" or not ( port >= 0 and port <= 65535 ) then | 701 if type( port ) ~= "number" or not ( port >= 0 and port <= 65535 ) then |
702 err = "invalid port" | 702 err = "invalid port" |
703 elseif _server[ port ] then | 703 elseif _server[ port ] then |
704 err = "listeners on port '" .. port .. "' already exist" | 704 err = "listeners on port '" .. port .. "' already exist" |
705 elseif sslctx and not luasec then | 705 elseif sslctx and not luasec then |
706 err = "luasec not found" | 706 err = "luasec not found" |