#NEWLINE# def on_close( self ) : #NEWLINE# #INDENT# log_data = dict ( extra = ( '[transport=%s]' % ( log_data . session . transport_name , ) ) ) #NEWLINE# record_request_start_data ( log_data ) #NEWLINE# if ( self . close_info is not None ) : #NEWLINE# #INDENT# write_log_line ( log_data , path = '/socket/close' , method = 'SOCKET' , remote_ip = self . session . conn_info . ip , email = 'unknown' , client_name = '?' , status_code = self . close_info . status_code , error_content = self . close_info . err_msg ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# deregister_connection ( self ) #NEWLINE# email = ( self . session . user_profile . email if ( self . session . user_profile is not None ) else 'unknown' ) #NEWLINE# write_log_line ( log_data , path = '/socket/close' , method = 'SOCKET' , remote_ip = self . session . conn_info . ip , email = email , client_name = '?' ) #NEWLINE# #UNINDENT# self . did_close = True