Changeset 64 for trunk/instant_messenger/inc/Jabber.abstract.php
- Timestamp:
- 09/05/07 11:18:58 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/instant_messenger/inc/Jabber.abstract.php
r55 r64 35 35 { 36 36 try 37 { 37 { 38 38 if ( !preg_match('/^(.+)@(.+)\/(.+):(\d+)$/',$pUser, $matches) ) 39 39 throw new Exception('[connect] #1 ' . $pUser . ' must be [USER]@[DOMAIN]/[RESOURCE]:[PORT] and [PORT] is integer. File: ' . __FILE__ . ' :: ' . __LINE__); … … 49 49 $xml .= "<stream:stream to='" . $SERVER . "' xmlns='jabber:client' "; 50 50 $xml .= "xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>"; 51 51 52 if ( $this->write($xml) === false ) 52 53 throw new Exception('[connect] #3 it isn\'t possible write in the socket ' . $socket . '. File: ' . __FILE__ . ' :: ' . __LINE__); … … 65 66 66 67 protected function connect( $pUser = false, $pPassword = false ) 67 { 68 { 68 69 try 69 70 { 70 71 $this->_connect($pUser, $pPassword); 72 71 73 if ( ($xml = $this->read()) === false ) 72 74 throw new Exception('[connect] #1 it isn\'t possible read the socket. File: ' . __FILE__ . ' :: ' . __LINE__); 73 75 74 76 if ( preg_match('/(<starttls .*<required\/><\/starttls>)/', $xml, $matches) ) 75 77 { … … 80 82 } 81 83 else 84 { 82 85 if ( !$this->_plain() ) 83 86 throw new Exception('[connect] #3 it isn\'t possible carry out the verification. File: ' . __FILE__ . ' :: ' . __LINE__); 87 } 84 88 85 89 return true; … … 170 174 throw new Exception('[_plain] #2 it isn\'t possible carry out the verification. File: ' . __FILE__ . ' :: ' . __LINE__); 171 175 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; 174 181 175 182 if ( ($xml = $this->read()) === false )
Note: See TracChangeset
for help on using the changeset viewer.