Changeset 239


Ignore:
Timestamp:
03/25/08 14:43:28 (16 years ago)
Author:
niltonneto
Message:
 
Location:
trunk/instant_messenger
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/instant_messenger/inc/Jabber.abstract.php

    r227 r239  
    4848                        fwrite($socket, "{$USER}@{$SERVER}##{$pPassword}##{$pConnectionType}"); 
    4949 
    50                         #sleep(1); 
    51  
    5250                        $return = fread($socket, 3); 
    53                         #var_dump($return); 
    54                         #$return = "new"; 
    5551 
    5652                        if ( $return == "new" ) 
    5753                        { 
    58                                 $xml  = "<?xml version='1.0' encoding='UTF-8'?>"; 
     54                                $xml  = "<?xml version='1.0' ?>"; 
    5955                                $xml .= "<stream:stream to='" . $SERVER . "' xmlns='jabber:client' "; 
    60                                 $xml .= "xmlns:stream='http://etherx.jabber.org/streams'>";// version='1.0'>"; 
     56                                $xml .= "xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>"; 
    6157 
    6258                                if ( $this->write($xml) === false ) 
     
    144140                                throw new Exception('[starttls] #1 Cannot write to socket (' . $this->_socket . '). File: ' . __FILE__ . '  ::  ' . __LINE__); 
    145141 
    146                         if ( ($xml = $this->read()) === false ) 
    147                                 throw new Exception('[starttls] #2 it isn\'t possible read the socket. File: ' . __FILE__ . '  ::  ' . __LINE__); 
    148  
    149                         if ( !preg_match('/<proceed.*\/>/', $xml, $matches) ) 
    150                                 throw new Exception('[starttls] #3 can\'t start tls in the socket ' .$this->_socket . '. File: ' . __FILE__ . '  ::  ' . __LINE__); 
    151  
    152                         stream_socket_enable_crypto($this->_socket, TRUE, STREAM_CRYPTO_METHOD_TLS_CLIENT); 
     142                        usleep(50000); 
     143                        fread($this->_socket, 4096); 
     144 
     145                        stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT); 
    153146 
    154147                        $xml  = "<?xml version='1.0' encoding='UTF-8'?>"; 
    155148                        $xml .= "<stream:stream to='" . $this->_server . "' xmlns='jabber:client' "; 
    156149                        $xml .= "xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>"; 
     150 
    157151                        if ( $this->write($xml) === false ) 
    158                                 throw new Exception('[starttls] #4 Cannot write to socket (' . $this->_socket . '). File: ' . __FILE__ . '  ::  ' . __LINE__); 
    159  
    160                         usleep(90000); 
    161                         $this->blocking($this->_socket, 0); 
    162  
    163                         if ( ($xml = $this->read()) === false ) 
    164                                 throw new Exception('[starttls] #5 it isn\'t possible read the socket. File: ' . __FILE__ . '  ::  ' . __LINE__); 
    165  
     152                                throw new Exception('[starttls] #2 Cannot write to socket (' . $this->_socket . '). File: ' . __FILE__ . '  ::  ' . __LINE__); 
     153 
     154                        usleep(50000); 
     155 
     156                        fread($this->_socket, 4096); 
     157 
     158                        usleep(50000); 
     159                         
     160                        fread($this->_socket, 4096); 
     161                         
    166162                        if ( !$this->_plain() ) 
    167                                 throw new Exception('[starttls] #6 it isn\'t possible carry out the verification. File: ' . __FILE__ . '  ::  ' . __LINE__); 
     163                                throw new Exception('[starttls] #3 it isn\'t possible carry out the verification. File: ' . __FILE__ . '  ::  ' . __LINE__); 
    168164 
    169165                        return true; 
  • trunk/instant_messenger/js/client.js

    r238 r239  
    8181} 
    8282 
     83var _bkp_onbeforeunload = window.onbeforeunload; 
     84 
    8385window.onbeforeunload = function() 
    8486{ 
     87        if ( typeof _bkp_onbeforeunload == 'function' ) 
     88                _bkp_onbeforeunload(); 
     89 
    8590        disconnected = true; 
    8691        var i; 
     
    8893                con.__HTTP__[i].abort(); 
    8994}; 
    90 //window.onbeforeunload = function(){con.__HTTP__['$this.Ujabber.listen'].abort();} 
Note: See TracChangeset for help on using the changeset viewer.