Ignore:
Timestamp:
09/05/07 11:18:58 (17 years ago)
Author:
niltonneto
Message:

* empty log message *

File:
1 edited

Legend:

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

    r55 r64  
    3535   { 
    3636      try 
    37       { 
     37      {  
    3838         if ( !preg_match('/^(.+)@(.+)\/(.+):(\d+)$/',$pUser, $matches) ) 
    3939            throw new Exception('[connect] #1 ' . $pUser . ' must be [USER]@[DOMAIN]/[RESOURCE]:[PORT] and [PORT] is integer. File: ' . __FILE__ . '  ::  ' . __LINE__); 
     
    4949         $xml .= "<stream:stream to='" . $SERVER . "' xmlns='jabber:client' "; 
    5050         $xml .= "xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>"; 
     51 
    5152         if ( $this->write($xml) === false ) 
    5253            throw new Exception('[connect] #3 it isn\'t possible write in the socket ' . $socket . '. File: ' . __FILE__ . '  ::  ' . __LINE__); 
     
    6566 
    6667   protected function connect( $pUser = false, $pPassword = false ) 
    67    { 
     68   {    
    6869      try 
    6970      { 
    7071         $this->_connect($pUser, $pPassword); 
     72                         
    7173         if ( ($xml = $this->read()) === false ) 
    7274            throw new Exception('[connect] #1 it isn\'t possible read the socket. File: ' . __FILE__ . '  ::  ' . __LINE__); 
    73  
     75          
    7476         if ( preg_match('/(<starttls .*<required\/><\/starttls>)/', $xml, $matches) ) 
    7577         { 
     
    8082         } 
    8183         else 
     84                        { 
    8285            if ( !$this->_plain() ) 
    8386               throw new Exception('[connect] #3 it isn\'t possible carry out the verification. File: ' . __FILE__ . '  ::  ' . __LINE__); 
     87                        } 
    8488 
    8589         return true; 
     
    170174            throw new Exception('[_plain] #2 it isn\'t possible carry out the verification. File: ' . __FILE__ . '  ::  ' . __LINE__); 
    171175 
    172          while ( !preg_match("/<iq xmlns='jabber:client' id='auth_1' type='result'\/>/", ($readSocket = $this->read()), $matches) ) 
    173             usleep(10000); 
     176         while ( !preg_match("/<iq xmlns='jabber:client' id='auth_1' type='(result|error)'/", ($readSocket = $this->read()), $matches) ) 
     177                   usleep(10000); 
     178 
     179                        if($matches[1] == "error") 
     180                                return false; 
    174181 
    175182         if ( ($xml = $this->read()) === false ) 
Note: See TracChangeset for help on using the changeset viewer.