+
    	:ix  c                   s   ^ RI Ht ^ RIt^ RIt]P                  R8  d   ^ RIt^ RIHt ^ RI	t
^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHtHt ^ RIHtHt ^ RIHt ^ RIHt ^ RIHtHt R	.t ! R
 R	]]]]P                  4      t R# )i    )absolute_importN)GObject)parse_config_setting
get_config)
RpcChannelConnectionState)SETroubleshootServerInterface)SETroubleshootDatabaseInterface)Retryget_error_from_socket_exceptionServerConnectionHandlerc                   sl  a  ] tR t^t o R]P
                  P                  R]P                  33R]P
                  P                  R]P                  ]P                  ]P                  ]P                  33R]P
                  P                  R]P                  ]P                  33R]P
                  P                  R]P                  ]P                  33R]P
                  P                  R]P                  ]P                  ]P                  33/t
R tR tRR	 ltR
 tR tR tR tR tR tR tR tRtV tR# )r
   alertNconnection_state_changedsignatures_updateddatabase_bindasync-errorc                s   \         P                  ! V R R7       \        P                  P                  V 4       V P                  P	                  RV P
                  4       V P                  RV 4       V P                  RV 4       \        RR4      V n        \        RR4      V n	        Wn
        RV n        \        V P                  V P                  R	R
7      V n        RV n        RV n        R# )Zsealert)channel_typeZchangedZSEAlertZSETroubleshootDatabaseNotifyZgeneralpkg_versionrpc_versionFg      ?)Znotify_intervalTZaudit_listenerN)r   __init__r   connection_stateconnecton_connection_state_changeZconnect_rpc_interfacer   r   r   usernameretry_connection_if_closedr   retry_connectionget_connection_retry_intervalconnection_retryreport_connect_failuredatabase_name)selfr      &&D/usr/lib/python3.14/site-packages/setroubleshoot/serverconnection.pyr   Z ServerConnectionHandler.__init__/   s    Dy9  &%%i1P1PQ""9d3""#A4H%i?%i? */' %d&;&;T=_=_qt u&*#-    c                s   V P                  R WW44       V\        P                  ,          '       g3   V\        P                  \        P                  ,          ,          '       dy   V P
                  '       de   V\        P                  ,          '       gF   V P                  P                  \        P                  4       V P                  P                  4        R# R# R# R# )r   N)emitr   OPENHUPERRORr   RETRYr   updater   Zstart)r   r   flagsZflags_addedZflags_removeds   &&&&&r    r   Z2ServerConnectionHandler.on_connection_state_change?   s    		,.>{bO0000k_EXEX[j[p[pEp6q6q...@U@U8U8U%%,,_-B-BC%%++- 9V. 7rr!   c                s   Ve   Wn         V P                  P                  \        P                  ,          '       d   R#  V P                  P                  \        P                  \        P                  \        P                  ,          4       \        P                  ! V P                   P                  V P                   P                  4      V P                   n	        \        P                  ! V P                   P                  P                  4       \        P                  \        P                  4       V P                   P                  P!                  V P                   P#                  4       4       V P%                  V P&                  4       V P                  P                  \        P                  \        P                  \        P(                  ,          4       V P*                  P-                  4        RV n        V P1                  4        R#   \        P2                   d   p\5        T4      w  r4T P.                  R8X  d4   \6        P6                  ! \6        P8                  RT,          4       RT n        T\:        P<                  8X  d   \        P>                  pM\        P                  pT PA                  T\        P                  Y44        R p?R# R p?ii ; i)NTz,attempt to open server connection failed: %sF)!socket_addressr   r(   r   r#   r'   Z
CONNECTINGr%   SocketsocketZfamilytypefcntlZfilenoZF_SETFDZ
FD_CLOEXECr   Zget_py_addressZio_watch_addZhandle_client_ior&   r   Zstopr   do_logonZerrorr	   syslogLOG_ERRErrnoZEPIPEr$   Zclose_connection)r   r)   ZeerrnostrerrorZ	add_flagss   &&    r    openZServerConnectionHandler.openO   s   %"0  &&)=)===	!!(()C)C_EYEY\k\q\qEqr)/t7J7J7Q7QSWSfSfSkSk)lD&KK++2299;U]]EL\L\]&&..t/B/B/Q/Q/STd334!!(()=)=?Y?Y\k\q\q?qr!!&&(*.D'MMO  || 
	=a@OE**d2fnn.\_g.gh.3+#+//	+11	!!)_-G-GY
	s   GH KB(KKc                sL    V P                  V P                  4      '       d   R # R# )TF)r4   r)   r   ZretryZ	user_data   &&&r    r   Z(ServerConnectionHandler.retry_connectionn   s    99T(())r!   c                s,    VP                   ^8  d   ^
# ^<# )i   )Zfailed_attemptsr5   r6   r    r   Z5ServerConnectionHandler.get_connection_retry_intervalt   s      1$r!   c           	     s    \         P                   ! \         P                  R V: RV: RV: 24       V P                  RWV4       R# )zasync_error: method=z errno=z: r   N)r/   r0   r"   )r   Zmethodr2   r3   s   &&&&r    async_error_callbackZ,ServerConnectionHandler.async_error_callbackz   s-    fnnvW\^f&gh		-9r!   c                s   a  V 3R  lpS P                  S P                  4      pVP                  V4       VP                  S P                  4       R# )c                 s.   < SP                  R SV 4       R# )r   Nr"   )Z
propertiesr   s   &r    database_bind_callbackZ<ServerConnectionHandler.bind.<locals>.database_bind_callback   s    IIotZ8r!   N)r   r   add_callbackadd_errbackr7   )r   r9   	async_rpc   f  r    bindZServerConnectionHandler.bind~   sC    	9 &&t'9'9:	56d778r!   c                s   a  V 3R  lpS P                   S n        S P                  S P                  S P                   R4      pVP	                  V4       VP                  S P                  4       R# )c                 sZ   < SP                   P                  \        P                  4       R # N)r   r'   r   ZAUTHENTICATED)r   r   r   s   &&r    logon_callbackZ8ServerConnectionHandler.do_logon.<locals>.logon_callback   s    !!(()F)FGr!   ZpasswdN)r   channel_nameZlogonr   r:   r;   r7   )r   r@   r<   r=   r    r.   Z ServerConnectionHandler.do_logon   sU    	H !MMJJt00$--J	~.d778r!   c                sl    \         P                  ! WW#V4      pVP                  V P                  4       R # r?   )r   
set_filterr;   r7   )r   ZsigZuserZfilter_typeZdatar<   s   &&&&& r    rB   Z"ServerConnectionHandler.set_filter   s+    3>>t$]ab	d778r!   c                s*    V P                  R V4       R# )r   Nr8   )r   Zsiginfor   r    r   ZServerConnectionHandler.alert   s    		'7#r!   c                s*    V P                  R W4       R# )r   Nr8   )r   r,   Zitemr6   r    r   Z*ServerConnectionHandler.signatures_updated   s    		&3r!   )	rA   r   r   r   r   r   r   r)   r   r?   )Z__name__Z
__module__Z__qualname__Z__firstlineno__r   ZSignalFlagsZRUN_LASTZTYPE_PYOBJECTZTYPE_INTZTYPE_STRINGZ__gsignals__r   r   r4   r   r   r7   r>   r.   rB   r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r    r
   r
      s/    
 					%	%tg.C.C-EF"				%	%tg.C.CWEUEUW^WgWgipiyiy-z{				%	%tg.C.CWEZEZ-[\				%	%tg.C.CWEZEZ-[\				%	%tg.A.A7CSCSU\UhUh-ijL. . >:999$4 4r!   )i   )!Z
__future__r    r/   ZsysZversion_infoZ$setroubleshoot.default_encoding_utf8ZsetroubleshootZgi.repositoryr   r2   r1   ZgettextZosZreZsignalZselinuxr+   r*   r-   Zsetroubleshoot.configr   r   Zsetroubleshoot.rpcr   r   Zsetroubleshoot.rpc_interfacesr   r   Zsetroubleshoot.utilr   r	   Z__all__r
   ) r!   r    <module>rC      sp    &  
d/ !   	 	     B : G I F 
|4j;=%oo|4r!   