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/transport.pyc
ó
}9Rc@s¸dZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
mZdefd„ƒYZd	efd
„ƒYZdS(sLow-level server communication.iÿÿÿÿN(tfetch(tbpickle(tformat_delta(t
SERVER_APItVERSIONt
HTTPTransportcBsGeZdZdd„Zd„Zd„Zd„Zdded„Z	RS(sÇTransport makes a request to exchange message data over HTTP.

    @param url: URL of the remote Landscape server message system.
    @param pubkey: SSH public key used for secure communication.
    cCs||_||_||_dS(N(t_reactort_urlt_pubkey(tselftreactorturltpubkey((s>/usr/lib/python2.7/dist-packages/landscape/broker/transport.pyt__init__s		cCs|jS(s)Get the URL of the remote message system.(R(R	((s>/usr/lib/python2.7/dist-packages/landscape/broker/transport.pytget_urlscCs
||_dS(s)Set the URL of the remote message system.N(R(R	R((s>/usr/lib/python2.7/dist-packages/landscape/broker/transport.pytset_urlsc
Cs‹i|d6dtd6dd6}|r2||d<n|rKt|ƒ|d<ntjƒ}|t|jdtd	|d
|d|jd|ƒfS(
Ns
X-Message-APIslandscape-client/%ss
User-Agentsapplication/octet-streamsContent-Types
X-Computer-IDsX-Exchange-Tokentposttdatatheaderstcainfotcurl(RtstrtpycurltCurlRRtTrueR(R	tpayloadtcomputer_idtexchange_tokentmessage_apiRR((s>/usr/lib/python2.7/dist-packages/landscape/broker/transport.pyt_curl#s


cCsetj|ƒ}y—tjƒ}tjƒjƒtjkrUtjdtj	|ƒƒn|j
||||ƒ\}}tjdt|ƒt|ƒt
tjƒ|ƒƒWntjd|jƒdSX|jtjƒ}	|	dkrûtjd|	fƒdSyJtj|ƒ}
tjƒjƒtjkrDtjdtj	|
ƒƒnWntjd|ƒdSX|
S(	s>Exchange message data with the server.

        @param payload: The object to send, it must be L{bpickle}-compatible.
        @param computer_id: The computer ID to send the message as (see
            also L{Identity}).
        @param exchange_token: The token that the server has given us at the
            last exchange. It's used to prove that we are still the same
            client.

        @type: C{dict}
        @return: The server's response to sent message or C{None} in case
            of error.

        @note: This code is thread safe (HOPEFULLY).

        sSending payload:
%ss*Sent %d bytes and received %d bytes in %s.s"Error contacting the server at %s.iÈs'Server returned non-expected result: %dsReceived payload:
%ss Server returned invalid data: %rN(Rtdumpsttimetloggingt	getLoggertgetEffectiveLeveltDEBUGtdebugtpprinttpformatRtinfotlenRt	exceptionRtNonetgetinfoRt
RESPONSE_CODEterrortloads(R	RRRRtspayloadt
start_timetcurlyRtcodetresponse((s>/usr/lib/python2.7/dist-packages/landscape/broker/transport.pytexchange/s4		N(
t__name__t
__module__t__doc__R*R
RRRRR4(((s>/usr/lib/python2.7/dist-packages/landscape/broker/transport.pyRs			t
FakeTransportcBsDeZdZdddd„Zd„Zd„Zdded„ZRS(s$Fake transport for testing purposes.cCsg||_g|_g|_d|_d|_d|_d|_d|_i|_	||_
||_dS(Ni(Rtpayloadst	responsest_current_responsetnext_expected_sequenceR*RRRtextraRR(R	R
RR((s>/usr/lib/python2.7/dist-packages/landscape/broker/transport.pyR
cs										cCs|jS(N(R(R	((s>/usr/lib/python2.7/dist-packages/landscape/broker/transport.pyRpscCs
||_dS(N(R(R	R((s>/usr/lib/python2.7/dist-packages/landscape/broker/transport.pyRsscCsÊ|jj|ƒ||_||_||_|jt|jdgƒƒ7_|jt|j	ƒkr†|j	|j}|jd7_ng}i|jd6t
tjƒƒd6|d6}|j
|jƒ|S(Ntmessagesisnext-expected-sequencesnext-exchange-token(R9tappendRRRR<R(tgetR;R:tunicodetuuidtuuid4tupdateR=(R	RRRRR3tresult((s>/usr/lib/python2.7/dist-packages/landscape/broker/transport.pyR4vs			!

N(	R5R6R7R*R
RRRR4(((s>/usr/lib/python2.7/dist-packages/landscape/broker/transport.pyR8`s
		(R7RR R%RBRtlandscape.lib.fetchRt
landscape.libRt
landscape.logRt	landscapeRRtobjectRR8(((s>/usr/lib/python2.7/dist-packages/landscape/broker/transport.pyt<module>sQ

Youez - 2016 - github.com/yon3zu
LinuXploit