2010-09-27 442 views
0

該片段是從importMsnm.class.php$data = $this->_get();回報false環路的第二次,它的工作之前:是否支持MSNP9?

VER 1 MSNP9 CVR0 
VER 1 CVR0 
CVR 1 0x0409 win 4.10 i386 MSNMSGR 7.0.0816 MSMSGS [email protected] 
connection is lost 


function connect($passport, $password) 
    { 
     $this->trID = 1; 

     if (!$this->fp = @fsockopen($this->server, $this->port, $errno, $errstr, 2)) {  
      //die("Could not connect to messenger service"); 
      return array(); 
     } else { 
      stream_set_timeout($this->fp, 2); 
      $this->_put("VER $this->trID MSNP9 CVR0\r\n"); 
      while (! feof($this->fp)) 
      { 
       $data = $this->_get(); 
       switch ($code = substr($data, 0, 3)) 
       { 
        default: 
         //echo $this->_get_error($code); 
         return false; 
        break; 
        case 'VER': 
         $this->_put("CVR $this->trID 0x0409 win 4.10 i386 MSNMSGR 7.0.0816 MSMSGS $passport\r\n"); 
        break; 
        case 'CVR': 
         $this->_put("USR $this->trID TWN I $passport\r\n"); 
        break; 
        case 'XFR': 
         list(, , , $ip) = explode (' ', $data); 
         list($ip, $port) = explode (':', $ip); 

         if ($this->fp = @fsockopen($ip, $port, $errno, $errstr, 2)) 
         { 
          $this->trID = 1; 

          $this->_put("VER $this->trID MSNP9 CVR0\r\n"); 
         } 
         else 
         { 
          if (! empty($this->debug)) echo 'Unable to connect to msn server (transfer)'; 

          return false; 
         } 
        break; 
        case 'USR': 
         if (isset($this->authed)) 
         { 
          return true; 
         } 
         else 
         { 
          $this->passport = $passport; 
          $this->password = urlencode($password); 

          list(,,,, $code) = explode(' ', trim($data)); 

          if ($auth = $this->_ssl_auth($code)) 
          { 
           $this->_put("USR $this->trID TWN S $auth\r\n"); 

           $this->authed = 1; 
          } 
          else 
          { 
           if (! empty($this->debug)) echo 'auth failed'; 

           return false; 
          } 
         } 
        break; 
       } 
      } 
     } 

    } 

回答

0

好像他們已經再次鎖定老客戶。微軟偶爾會這樣做,以使第三方客戶端無法使用。他們處理協議例外的標準方式是立即拆除連接。

+0

這是臨時性的嗎? – wamp 2010-09-27 06:41:22