403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/landscape/broker/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/landscape/broker/ping.pyc
ó
}9Rc@s¸dZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
d	efd
„ƒYZdefd„ƒYZd
efd„ƒYZdS(s
Implementation of a lightweight exchange-triggering mechanism via
small HTTP requests asking if we should do a full exchange.
iÿÿÿÿN(tinfo(tFailure(tdefer(tloads(tfetch(tlog_failuret
PingClientcBs,eZdZdd„Zd„Zd„ZRS(s:An HTTP client which knows how to talk to the ping server.cCs+|dkrt}n||_||_dS(N(tNoneRt_reactortget_page(tselftreactorR	((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyt__init__s		csœ|dk	ridd6}tji|d6ƒ}tjƒ‰‡fd†}|jjˆj||j|dt	d|d|ƒˆj
|jƒˆStjt
ƒS(	srAsk the question: are there messages for this computer ID?

        @param url: The URL of the ping server to hit.
        @param insecure_id: This client's insecure ID, if C{None} no HTTP
            request will be performed and the result will be C{False}.

        @return: A deferred resulting in True if there are messages
            and False otherwise.
        s!application/x-www-form-urlencodedsContent-Typetinsecure_idcsˆjt|||ƒƒdS(N(terrbackR(ttypetvaluettb(t
page_deferred(s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyR)stposttdatatheadersN(Rturllibt	urlencodeRtDeferredRtcall_in_threadtcallbackR	tTruetaddCallbackt_got_resulttsucceedtFalse(R
turlR
RRR((Rs9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pytpings

cCs!t|ƒitd6krtSdS(sº
        Given a response that came from a ping server, return True if
        the response indicates that their are messages waiting for
        this computer, False otherwise.
        tmessagesN(RR(R
twebtext((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyR3sN(t__name__t
__module__t__doc__RRR!R(((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyRs	tPingercBskeZdZed„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd	„Zd
„Z
RS(s‰
    A plugin which pings the Landscape server with HTTP requests to
    see if a full exchange should be initiated.

    @param reactor: The reactor to schedule calls with.
    @param identity: The L{Identity} holding the insecure ID used when pinging.
    @param exchanger: The L{MessageExchange} to trigger exchanges with.
    @param config: The L{BrokerConfiguration} to get the 'ping_url' and
        'ping_interval' parameters from. The 'ping_url' specifies what URL
        to hit when pinging, and 'ping_interval' how frequently to ping.
        Changes in the configuration object will take effect from the next
        scheduled ping.
    cCsV||_||_||_||_d|_d|_||_|jd|j	ƒdS(Ntmessage(
t_configt	_identityRt
_exchangerRt_call_idt_ping_clienttping_client_factorytcall_ont_handle_set_intervals(R
Rtidentityt	exchangertconfigR.((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyRLs							cCs
|jjS(N(R)tping_url(R
((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pytget_urlWscCs
|jjS(N(R)t
ping_interval(R
((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pytget_intervalZscCs#|j|jƒ|_|jƒdS(sStart pinging.N(R.RR-t	_schedule(R
((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pytstart]scs[ˆjjˆjjˆjjƒ}|jˆjƒ|jˆj	ƒ|j
‡fd†ƒdS(s8Perform a ping; if there are messages, fire an exchange.cs
ˆjƒS(N(R8(t_(R
(s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyt<lambda>hsN(R-R!R)R4R*R
RRt
addErrbackt
_got_errortaddBoth(R
tdeferred((R
s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyR!bs
	cCs*|r&tdƒ|jjdtƒndS(Ns@Ping indicates message available. Scheduling an urgent exchange.turgent(RR+tschedule_exchangeR(R
texchange((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyRjs
cCst|d|jjfƒdS(Ns"Error contacting ping server at %s(RR-R (R
tfailure((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyR=pscCs%|jj|jj|jƒ|_dS(s4Schedule a new ping using the current ping interval.N(Rt
call_laterR)R6R!R,(R
((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyR8uscCsƒ|ddkrPd|krP|d|j_|jjƒtd|jjƒn|jdk	r|jj|jƒ|jƒndS(NRs
set-intervalsR!s Ping interval set to %d seconds.(	R)R6twriteRR,RRtcancel_callR8(R
R(((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyR0zs
cCs2|jdk	r.|jj|jƒd|_ndS(s Stop pinging the message server.N(R,RRRF(R
((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pytstop„s(R$R%R&RRR5R7R9R!RR=R8R0RG(((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyR'=s

								
t
FakePingercBseZd„Zd„ZRS(cOsdS(N((R
targstkwargs((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyRscCsdS(N((R
((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyR9s(R$R%RR9(((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyRH‹s	(R&RtloggingRttwisted.python.failureRttwisted.internetRtlandscape.lib.bpickleRtlandscape.lib.fetchRtlandscape.lib.logRtobjectRR'RH(((s9/usr/lib/python2.7/dist-packages/landscape/broker/ping.pyt<module>s,N

Youez - 2016 - github.com/yon3zu
LinuXploit