예제 #1
0
 def _process(self):
     """Same as `Stream.process` but assume `self.lock` is acquired."""
     try:
         StreamBase._process(self)
     except SSLError, e:
         self.close()
         raise TLSError("TLS Error: " + str(e))
예제 #2
0
 def _process(self):
     """Same as `Stream.process` but assume `self.lock` is acquired."""
     try:
         StreamBase._process(self)
     except SSLError,e:
         self.close()
         raise TLSError("TLS Error: "+str(e))
예제 #3
0
 def _read(self):
     """Read data pending on the stream socket and pass it to the parser."""
     self.__logger.debug("StreamTLSMixIn._read(), socket: %r", self.socket)
     if self.tls:
         self._read_tls()
     else:
         StreamBase._read(self)
예제 #4
0
 def _read(self):
     """Read data pending on the stream socket and pass it to the parser."""
     self.__logger.debug("StreamTLSMixIn._read(), socket: %r",self.socket)
     if self.tls:
         self._read_tls()
     else:
         StreamBase._read(self)
예제 #5
0
파일: stream.py 프로젝트: AlexUlrich/digsby
    def _got_features(self):
        """Process incoming <stream:features/> element.

        [initiating entity only]

        The received features node is available in `self.features`."""
        self._handle_tls_features()
        self._handle_sasl_features()
        StreamBase._got_features(self)
        if not self.tls_requested and not self.authenticated:
            self.state_change("fully connected",self.peer)
            self._post_connect()
예제 #6
0
    def _got_features(self):
        """Process incoming <stream:features/> element.

        [initiating entity only]

        The received features node is available in `self.features`."""
        self._handle_tls_features()
        self._handle_sasl_features()
        StreamBase._got_features(self)
        if not self.tls_requested and not self.authenticated:
            self.state_change("fully connected", self.peer)
            self._post_connect()
예제 #7
0
파일: stream.py 프로젝트: AlexUlrich/digsby
    def _process_node(self,xmlnode):
        """Process first level element of the stream.

        The element may be stream error or features, StartTLS
        request/response, SASL request/response or a stanza.

        :Parameters:
            - `xmlnode`: XML node describing the element
        """
        if self._process_node_tls(xmlnode):
            return
        if self._process_node_sasl(xmlnode):
            return
        StreamBase._process_node(self,xmlnode)
예제 #8
0
    def _process_node(self, xmlnode):
        """Process first level element of the stream.

        The element may be stream error or features, StartTLS
        request/response, SASL request/response or a stanza.

        :Parameters:
            - `xmlnode`: XML node describing the element
        """
        if self._process_node_tls(xmlnode):
            return
        if self._process_node_sasl(xmlnode):
            return
        StreamBase._process_node(self, xmlnode)
예제 #9
0
파일: stream.py 프로젝트: Hellogz/pyxmpp
    def __init__(self, default_ns, extra_ns=(), sasl_mechanisms=(), tls_settings=None, keepalive=0, owner=None):
        """Initialize Stream object

        :Parameters:
          - `default_ns`: stream's default namespace ("jabber:client" for
            client, "jabber:server" for server, etc.)
          - `extra_ns`: sequence of extra namespace URIs to be defined for
            the stream.
          - `sasl_mechanisms`: sequence of SASL mechanisms allowed for
            authentication. Currently "PLAIN", "DIGEST-MD5" and "GSSAPI" are supported.
          - `tls_settings`: settings for StartTLS -- `TLSSettings` instance.
          - `keepalive`: keepalive output interval. 0 to disable.
          - `owner`: `Client`, `Component` or similar object "owning" this stream.
        """
        StreamBase.__init__(self, default_ns, extra_ns, keepalive, owner)
        StreamTLSMixIn.__init__(self, tls_settings)
        StreamSASLMixIn.__init__(self, sasl_mechanisms)
        self.__logger = logging.getLogger("pyxmpp.Stream")
예제 #10
0
파일: stream.py 프로젝트: AlexUlrich/digsby
    def _make_stream_features(self):
        """Create the <features/> element for the stream.

        [receving entity only]

        :returns: new <features/> element node."""
        features=StreamBase._make_stream_features(self)
        self._make_stream_tls_features(features)
        self._make_stream_sasl_features(features)
        return features
예제 #11
0
    def _make_stream_features(self):
        """Create the <features/> element for the stream.

        [receving entity only]

        :returns: new <features/> element node."""
        features = StreamBase._make_stream_features(self)
        self._make_stream_tls_features(features)
        self._make_stream_sasl_features(features)
        return features
예제 #12
0
    def __init__(self, default_ns, extra_ns = (), sasl_mechanisms = (),
                    tls_settings = None, keepalive = 0, owner = None):
        """Initialize Stream object

        :Parameters:
          - `default_ns`: stream's default namespace ("jabber:client" for
            client, "jabber:server" for server, etc.)
          - `extra_ns`: sequence of extra namespace URIs to be defined for
            the stream.
          - `sasl_mechanisms`: sequence of SASL mechanisms allowed for
            authentication. Currently "PLAIN", "DIGEST-MD5" and "GSSAPI" are supported.
          - `tls_settings`: settings for StartTLS -- `TLSSettings` instance.
          - `keepalive`: keepalive output interval. 0 to disable.
          - `owner`: `Client`, `Component` or similar object "owning" this stream.
        """
        StreamBase.__init__(self, default_ns, extra_ns, keepalive, owner)
        StreamTLSMixIn.__init__(self, tls_settings)
        StreamSASLMixIn.__init__(self, sasl_mechanisms)
        self.__logger = logging.getLogger("pyxmpp.Stream")
예제 #13
0
파일: stream.py 프로젝트: AlexUlrich/digsby
 def _reset(self):
     """Reset `Stream` object state making it ready to handle new
     connections."""
     StreamBase._reset(self)
     self._reset_tls()
     self._reset_sasl()
예제 #14
0
 def _reset(self):
     """Reset `Stream` object state making it ready to handle new
     connections."""
     StreamBase._reset(self)
     self._reset_tls()
     self._reset_sasl()