403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.6/site-packages/papyon/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages/papyon/transport.pyo
Ñò
O Jc@sßdZddkZddkZddkZddkZddkZddgZeidƒZde	fd„ƒYZ
eiZdei
fd„ƒYZeieƒdefd	„ƒYZeieƒd
efd„ƒYZdS(shNetwork Transport Layer

This module provides an abstraction of the transport to be used to communicate
with the MSN servers, actually MSN servers can communicate either through
direct connection using TCP/1863 or using TCP/80 by tunelling the protocol
inside HTTP POST requests.

The classes of this module are structured as follow:
G{classtree BaseTransport}iÿÿÿÿNt
ServerTypetDirectConnectionspapyon.transportcBseZdZdZRS(tSBtNS(t__name__t
__module__tSWITCHBOARDtNOTIFICATION(((s4/usr/lib/python2.6/site-packages/papyon/transport.pyR,st
BaseTransportcBseZdZheieieffd6eieidfd6eieidfd6eieieffd6eieieffd6eieieffd6Zei	hd„Z
ed„ƒZd	„Z
d
„Zdd„Zedd„Zddedd
„Zd„Zd„ZRS(sùAbstract Base Class that modelize a connection to the MSN service, this
    abstraction is used to build various transports that expose the same
    interface, basically a transport is created using its constructor then it
    simply emits signals when network events (or even abstracted network events)
    occur, for example a Transport that successfully connected to the MSN
    service will emit a connection-success signal, and when that transport
    received a meaningful message it would emit a command-received signal.
        
        @ivar server: the server being used to connect to
        @type server: tuple(host, port)
        
        @ivar server_type: the server that we are connecting to, either
            Notification or switchboard.
        @type server_type: L{ServerType}

        @ivar proxies: proxies that we can use to connect
        @type proxies: dict(type => L{gnet.proxy.ProxyInfos})
        
        @ivar transaction_id: the current transaction ID
        @type transaction_id: integer


        @cvar connection-failure: signal emitted when the connection fails
        @type connection-failure: ()

        @cvar connection-success: signal emitted when the connection succeed
        @type connection-success: ()

        @cvar connection-reset: signal emitted when the connection is being
        reset
        @type connection-reset: ()

        @cvar connection-lost: signal emitted when the connection was lost
        @type connection-lost: ()

        @cvar command-received: signal emitted when a command is received
        @type command-received: FIXME

        @cvar command-sent: signal emitted when a command was successfully
            transmitted to the server
        @type command-sent: FIXME

        @undocumented: __gsignals__sconnection-failuresconnection-successsconnection-resetsconnection-lostscommand-receivedscommand-sentcCs8tii|ƒ||_||_||_d|_dS(s¿Connection initialization
        
            @param server: the server to connect to.
            @type server: (host: string, port: integer)

            @param server_type: the server that we are connecting to, either
                Notification or switchboard.
            @type server_type: L{ServerType}

            @param proxies: proxies that we can use to connect
            @type proxies: {type: string => L{gnet.network.ProxyInfos}}iN(tgobjecttGObjectt__init__tservertserver_typetproxiest_transaction_id(tselfRR
R((s4/usr/lib/python2.6/site-packages/papyon/transport.pyRys
			cCs|iS(N(R(R((s4/usr/lib/python2.6/site-packages/papyon/transport.pyttransaction_id‹scCs
t‚dS(sConnect to the server serverN(tNotImplementedError(R((s4/usr/lib/python2.6/site-packages/papyon/transport.pytestablish_connectionscCs
t‚dS(sDisconnect from the serverN(R(R((s4/usr/lib/python2.6/site-packages/papyon/transport.pytlose_connection”scCs
t‚dS(sªReset the connection

            @param server: when set, reset the connection and
                connect to this new server
            @type server: tuple(host, port)N(R(RR((s4/usr/lib/python2.6/site-packages/papyon/transport.pytreset_connection˜scGs
t‚dS(sâ
        Sends a L{msnp.Command} to the server.

            @param command: command to send
            @type command: L{msnp.Command}

            @param increment: if False, the transaction ID is not incremented
            @type increment: bool

            @param callback: callback to be used when the command has been
                transmitted
            @type callback: callable

            @param cb_args: callback arguments
            @type cb_args: Any, ...
        N(R(Rtcommandt	incrementtcallbacktcb_args((s4/usr/lib/python2.6/site-packages/papyon/transport.pytsend_command¡scGs?tiƒ}|i||i||Œ|i||||Œ|S(sÛ
        Builds a command object then send it to the server.
        
            @param command: the command name, must be a 3 letters
                uppercase string.
            @type command: string
        
            @param arguments: command arguments
            @type arguments: (string, ...)
        
            @param payload: payload data
            @type payload: string

            @param increment: if False, the transaction ID is not incremented
            @type increment: bool

            @param callback: callback to be used when the command has been
                transmitted
            @type callback: callable

            @param cb_args: callback arguments
            @type cb_args: tuple
        (tmsnptCommandtbuildRR(RRt	argumentstpayloadRRRtcmd((s4/usr/lib/python2.6/site-packages/papyon/transport.pytsend_command_ex´scCsdS(N((R((s4/usr/lib/python2.6/site-packages/papyon/transport.pytenable_pingÒscCs|id7_|iS(sVIncrements the Transaction ID then return it.
            
            @rtype: integeri(R(R((s4/usr/lib/python2.6/site-packages/papyon/transport.pyt_increment_transaction_idÕs((N((RRt__doc__R	tSIGNAL_RUN_FIRSTt	TYPE_NONEtobjectt__gsignals__RRRtpropertyRRRtNoneRtTrueRR!R"R#(((s4/usr/lib/python2.6/site-packages/papyon/transport.pyR2s<+




				cBs¡eZdZeihd„Zeiie_ed„ƒZd„Z	d„Z
d
d„Ze
d
d„Zd„Zd„Zd	„Zd
„Zd„Zd„ZRS(s8Implements a direct connection to the net using TCP/1863cCsÄti||||ƒtii|d|dƒ}|id|iƒ|id|iƒtii	|ƒ}|id|i
ƒ||_d|i_||_
d|_t|_t|_d|_dS(Niisnotify::statusterrortreceiveds
(RRtgnettiot	TCPClienttconnectt#_DirectConnection__on_status_changet_DirectConnection__on_errortparsertDelimiterParsert_DirectConnection__on_receivedt	_receivert	delimitert
_transportR*t _DirectConnection__pending_chunktFalset_DirectConnection__resettingt_DirectConnection__errort_DirectConnection__png_timeout(RRR
Rt	transporttreceiver((s4/usr/lib/python2.6/site-packages/papyon/transport.pyRás					cCs
|iiS(N(R9tsockname(R((s4/usr/lib/python2.6/site-packages/papyon/transport.pyRA÷scCs%tid|iƒ|iiƒdS(Ns<-> Connecting to %s:%d(tloggertdebugRR9topen(R((s4/usr/lib/python2.6/site-packages/papyon/transport.pyRûscCsGt|_|iiƒ|idj	oti|iƒd|_ndS(N(R;R<R9tcloseR>R*R	t
source_remove(R((s4/usr/lib/python2.6/site-packages/papyon/transport.pyRÿs
	
cCs–|o;|iid|dƒ|iid|dƒ||_nt|_|idj	oti|iƒd|_n|ii	ƒ|ii
ƒdS(Nthostitporti(R9tset_propertyRR+R<R>R*R	RFRERD(RR((s4/usr/lib/python2.6/site-packages/papyon/transport.pyRs
	

cGs^tidt|ƒƒ|||f}|iit|ƒ|i|Œ|o|iƒndS(Ns>>> (RBRCtunicodeR9tsendtstrt"_DirectConnection__on_command_sentR#(RRRRRtour_cb_args((s4/usr/lib/python2.6/site-packages/papyon/transport.pyRs
cCs9tiƒ}|iddƒ|i|tƒd|_tS(NtPNG(RRRR*RR;R>(RR ((s4/usr/lib/python2.6/site-packages/papyon/transport.pyR"s
	cCs)|id|ƒ|o||ŒndS(Nscommand-sent(temit(RRt
user_callbacktuser_cb_args((s4/usr/lib/python2.6/site-packages/papyon/transport.pyt__on_command_sent scCs3t|idƒ}ti|d|iƒ|_dS(Niiè(tintRR	ttimeout_addR"R>(RRttimeout((s4/usr/lib/python2.6/site-packages/papyon/transport.pyt__handle_ping_reply%scCs¥|idƒ}|tiijo5|io|idƒt|_n|idƒnK|tiijo7|io|io|iddƒnt|_ndS(Ntstatussconnection-resetsconnection-successsconnection-lost(
tget_propertyR.tIoStatustOPENR<RPR;tCLOSEDR=R*(RR?tparamRX((s4/usr/lib/python2.6/site-packages/papyon/transport.pyt__on_status_change*s


cCsS|idƒ}t|_|tiijo|id|ƒn|id|ƒdS(NRXsconnection-lostsconnection-failure(RYR+R=R.RZR[RP(RR?treasonRX((s4/usr/lib/python2.6/site-packages/papyon/transport.pyt
__on_error6s
	cCsAtiƒ}|io7|id|}|i|ƒd|_d|i_n©|i|ƒ|itiijp3|i	ƒox|i
dj	oht|i
ƒdjoRyt|i
dƒ}Wn
d}nX|djo||_||i_dSnt
idt|ƒƒ|idjo|i|ƒn|id|ƒdS(Ns
iiÿÿÿÿs<<< tQNGscommand-received(RRR:tparseR*R7R8tnametINCOMING_PAYLOADtis_errorRtlenRTRBRCRJt$_DirectConnection__handle_ping_replyRP(RR@tchunkR tpayload_len((s4/usr/lib/python2.6/site-packages/papyon/transport.pyt
__on_received>s*

	
3

		N(RRR$RRRRR)RARRR*RR+RR"RMRgR2R3R6(((s4/usr/lib/python2.6/site-packages/papyon/transport.pyRÞs							tHTTPPollConnectioncBsŒeZdZeihd„Zd„Zd„Zd„Zd
d„Z
ed
d„Zd„Z
d„Zd	„Zd
„Zd„Zd„ZRS(sŸImplements an HTTP polling transport, basically it encapsulates the MSNP
    commands into an HTTP request, and receive responses by polling a specific
    urlcCsW||_d}ti||||ƒ|iƒg|_t|_d|_t|_	dS(Nsgateway.messenger.hotmail.comiP(sgateway.messenger.hotmail.comiP(
t_target_serverRRt_setup_transportt_command_queueR;t_waiting_for_responseR*t_session_idt_HTTPPollConnection__error(RRR
R((s4/usr/lib/python2.6/site-packages/papyon/transport.pyR]s	
			cCsª|i}|i}d|jo(tii|d|d|dƒ}ntii|d|dƒ}|id|iƒ|id|iƒ|id|iƒ||_	dS(Nthttpiisresponse-receivedsrequest-sentR,(
RRR.tprotocoltHTTPR1t _HTTPPollConnection__on_receivedt_HTTPPollConnection__on_sentt_HTTPPollConnection__on_errorR9(RRRR?((s4/usr/lib/python2.6/site-packages/papyon/transport.pyRmhs		
(cCs=tid|iƒtid|iƒ|_|idƒdS(Ns<-> Connecting to %s:%diˆsconnection-success(RBRCRR	RUt_pollt_polling_source_idRP(R((s4/usr/lib/python2.6/site-packages/papyon/transport.pyRtscCsAti|iƒ|`|ip|iddƒnt|_dS(Nsconnection-lost(R	RFRyRqRPR*R;(R((s4/usr/lib/python2.6/site-packages/papyon/transport.pyRys

cCs%|o
||_n|idƒdS(Nsconnection-reset(RlRP(RR((s4/usr/lib/python2.6/site-packages/papyon/transport.pyR€s
cGs*|ii||||fƒ|iƒdS(N(Rntappendt
_send_command(RRRRR((s4/usr/lib/python2.6/site-packages/papyon/transport.pyR…scCsOt|iƒdjp
|iodS|iddd!\}}d}hdd6dd6dd	6d
d6dd
6dd6}t|ƒ}|idjo"|d|i|idf7}n:|djo|d|i7}d}n|d|i7}|ii	|||dƒt
|_|dj	otidt
|ƒƒn|o|iƒndS(Niis/gateway/gateway.dlls*/*tAcceptsen-ussAccept-Languages
Keep-Alivet
Connectionsno-cachetPragmasapplication/x-msn-messengersContent-TypesProxy-Connections?Action=open&Server=%s&IP=%ss?Action=poll&SessionID=%sts
?SessionID=%stPOSTs>>> (RfRnRoRLRpR*R
RlR9trequestR+RBRCRJR#(RRRtresourcetheaderststr_command((s4/usr/lib/python2.6/site-packages/papyon/transport.pyR{‰s2 


	
cCs|ip|idƒntS(N(RoRR*R+(R((s4/usr/lib/python2.6/site-packages/papyon/transport.pyRx«s
cCst|_|id|ƒdS(Nsconnection-lost(R+RqRP(RR?R_((s4/usr/lib/python2.6/site-packages/papyon/transport.pyR`°s	c
CsX|idjo!|idtiƒ|iƒnd|ijoÍ|ididƒ}x´|D]¨}g}|iddƒD]}||iƒq{~\}}|djo
||_q^|djo$||i	df|_	|i
ƒq^|d	jo|d
joq^q^Wnt|_|i
}	x't|	ƒdjo|i|	ƒ}	q#W|iƒdS(Ni“sconnection-lostsX-MSN-Messengert;t=it	SessionIDsGW-IPtSessionREi(RXRPtTransportErrortPROXY_FORBIDDENRRƒtsplittstripRpRRmR;RotbodyRft$_HTTPPollConnection__extract_commandR{(
RR?t
http_responsetdatatelemt_[1]tptkeytvaluetcommands((s4/usr/lib/python2.6/site-packages/papyon/transport.pyRj´s*9


		cCsst|iƒdjodS|iidƒ\}}}}|dj	o)|o||Œn|id|ƒndS(Niscommand-sent(RfRntpopR*RP(RR?thttp_requestRRRR((s4/usr/lib/python2.6/site-packages/papyon/transport.pyt	__on_sentÍs
cCs*|iddƒ\}}tiƒ}|i|iƒƒ|itiijp3|iƒo¡|idj	o‘t
|iƒdjo{yt|idƒ}Wn
d}nX|djo|| iƒ|_nt
idt|ƒƒ|id|ƒ||St
idt|ƒƒ|id|ƒ|SdS(Ns
iiiÿÿÿÿs<<< scommand-received(R‹RRRbRŒRcRdReRR*RfRTRRBRCRJRP(RRtfirsttrestR Ri((s4/usr/lib/python2.6/site-packages/papyon/transport.pyt__extract_commandÖs"3

	N(RRR$RRRRmRRR*RR+RR{RxRwRuRvRŽ(((s4/usr/lib/python2.6/site-packages/papyon/transport.pyRkYs				"					(R$R.t
gnet.protocolRtloggingR	t__all__t	getLoggerRBR'RtIoErrorR‰R
Rt
type_registerRRk(((s4/usr/lib/python2.6/site-packages/papyon/transport.pyt<module>s	©
x


Youez - 2016 - github.com/yon3zu
LinuXploit