#NEWLINE# def serve_socket_helper( sock , secure = False , vdb = None ) : #NEWLINE# #INDENT# if secure : #NEWLINE# #INDENT# log ( 'requiring authentication' ) #NEWLINE# try : #NEWLINE# #INDENT# stream = SocketStream . from_secure_server_socket ( sock , vdb ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# log ( 'authenication failed' ) #NEWLINE# sock . close ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# log ( 'authentication successful' ) #NEWLINE# serve_channel ( Channel ( stream ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# serve_channel ( Channel ( SocketStream ( sock ) ) )