Comparison

net/server_select.lua @ 5484:17ce73907c48

net.server_select: Normalize indentation
author Kim Alvefur <zash@zash.se>
date Wed, 17 Apr 2013 21:30:44 +0200
parent 5482:f2631a14b953
child 5485:5147eed0a42e
comparison
equal deleted inserted replaced
5482:f2631a14b953 5484:17ce73907c48
567 coroutine_yield( ) -- handshake not finished 567 coroutine_yield( ) -- handshake not finished
568 end 568 end
569 end 569 end
570 out_put( "server.lua: ssl handshake error: ", tostring(err or "handshake too long") ) 570 out_put( "server.lua: ssl handshake error: ", tostring(err or "handshake too long") )
571 _ = handler and handler:force_close("ssl handshake failed") 571 _ = handler and handler:force_close("ssl handshake failed")
572 return false, err -- handshake failed 572 return false, err -- handshake failed
573 end 573 end
574 ) 574 )
575 end 575 end
576 if luasec then 576 if luasec then
577 handler.starttls = function( self, _sslctx) 577 handler.starttls = function( self, _sslctx)
611 -- Secure now (if handshake fails connection will close) 611 -- Secure now (if handshake fails connection will close)
612 ssl = true 612 ssl = true
613 613
614 handler.readbuffer = handshake 614 handler.readbuffer = handshake
615 handler.sendbuffer = handshake 615 handler.sendbuffer = handshake
616 return handshake( socket ) -- do handshake 616 return handshake( socket ) -- do handshake
617 end 617 end
618 end 618 end
619 619
620 handler.readbuffer = _readbuffer 620 handler.readbuffer = _readbuffer
621 handler.sendbuffer = _sendbuffer 621 handler.sendbuffer = _sendbuffer
627 _readlistlen = addsocket(_readlist, socket, _readlistlen) 627 _readlistlen = addsocket(_readlist, socket, _readlistlen)
628 628
629 if sslctx and luasec then 629 if sslctx and luasec then
630 out_put "server.lua: auto-starting ssl negotiation..." 630 out_put "server.lua: auto-starting ssl negotiation..."
631 handler.autostart_ssl = true; 631 handler.autostart_ssl = true;
632 local ok, err = handler:starttls(sslctx); 632 local ok, err = handler:starttls(sslctx);
633 if ok == false then 633 if ok == false then
634 return nil, nil, err 634 return nil, nil, err
635 end 635 end
636 end 636 end
637 637
638 return handler, socket 638 return handler, socket
639 end 639 end
640 640