Software /
code /
prosody
Comparison
net/server.lua @ 1570:a46453758631
net.server: Continue to initialise port listener even when SSL errors occur
author | Matthias Diener |
---|---|
date | Thu, 23 Jul 2009 01:29:41 +0100 |
parent | 1546:7d7bf705675d |
child | 1574:3692706f78e3 |
comparison
equal
deleted
inserted
replaced
1568:b11bac42d56f | 1570:a46453758631 |
---|---|
170 local err | 170 local err |
171 | 171 |
172 local ssl = false | 172 local ssl = false |
173 | 173 |
174 if sslctx then | 174 if sslctx then |
175 ssl = true | |
175 if not ssl_newcontext then | 176 if not ssl_newcontext then |
176 return nil, "luasec not found" | 177 out_error "luasec not found" |
178 ssl = false | |
177 end | 179 end |
178 if type( sslctx ) ~= "table" then | 180 if type( sslctx ) ~= "table" then |
179 out_error "server.lua: wrong server sslctx" | 181 out_error "server.lua: wrong server sslctx" |
180 return nil, "wrong server sslctx" | 182 ssl = false |
181 end | 183 end |
182 sslctx, err = ssl_newcontext( sslctx ) | 184 sslctx, err = ssl_newcontext( sslctx ) |
183 if not sslctx then | 185 if not sslctx then |
184 err = err or "wrong sslctx parameters" | 186 err = err or "wrong sslctx parameters" |
185 out_error( "server.lua: ", err ) | 187 out_error( "server.lua: ", err ) |
186 return nil, err | 188 ssl = false |
187 end | 189 end |
188 ssl = true | 190 end |
189 else | 191 if not ssl then |
190 out_put("server.lua: ", "ssl not enabled on ", serverport); | 192 out_put("server.lua: ", "ssl not enabled on ", serverport); |
191 end | 193 end |
192 | 194 |
193 local accept = socket.accept | 195 local accept = socket.accept |
194 | 196 |
195 --// public methods of the object //-- | 197 --// public methods of the object //-- |