tags:

views:

50

answers:

1

The snippet is from importMsnm.class.php,$data = $this->_get(); returns false on the 2nd time of loop, it worked before :

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;
                }
            }
        }

    }
A: 

It seems like they've once again locked out old clients. Microsoft do this once in a while to make third party clients unusable. Their standard way of handling protocol exceptions is to immediately tearing down the connection.

Emil Vikström
Is it temporary or not?
wamp