bsp; if (rtrim($temp) != "HTTP/1.1 200 OK"){
#echo "Unknown HTTP status code: $temp<br>";
echo "未知状态码 $temp<br/>";
flush();
die();
} else {
#echo "set_bar_len30?";
}
}
while ($temp != "\r\n"){
$temp = fgets($ssl_conn,1024);
if (substr($temp,0,19)=="Authentication-Info"){
$auth_info = $temp;
$temp = fgets($ssl_conn,1024);
if (substr($temp,0,14)!="Content-Length"){
$auth_info.= fgets($ssl_conn,1024);
}
break;
}
}
@fclose($ssl_conn);
$temp_array = explode("''",$auth_info);
flush();
data_out("USR $trid TWN S {$temp_array[1]}");
flush();
$temp=data_in();
flush();
$time_since_initmsg = time();
while(!strstr($temp,"ABCHMigrated") && is_string(trim($temp))){
if (substr($temp,0,3)=="sid"){
$sid = trim(substr($temp,5));
}
if (substr($temp,0,2)=="kv"){
$kv = trim(substr($temp,4));
}
if (substr($temp,0,7)=="MSPAuth"){
$mspauth = trim(substr($temp,9));
flush();
}
$temp = data_in();
}
$temp = data_in();
#echo "authenticated<br />";
echo "验证通过!<br/>";
flush();
#data_out("LST 9 RL");
#data_in();
data_out("SYN $trid 0 0");
#echo "retreiving_contact_list<br />";
echo "正在获取好友列表……<br/><br/>";
flush();
stream_set_timeout($sbconn,0,125000);
/* a lazy man doing this :D */
for($i=0;$i<160;$i++) # some say max is 150
{
$temp = data_in();
switch (substr($temp, 0, 3))
{
case "LST":
$temp_array = explode(" ",$temp);
$un = substr($temp_array[1], 2);
$nn = substr($temp_array[2], 2);
$nn1 = substr($temp_array[2], 0, 1);
if($nn1 == "F")
{
echo "<a href=\"mailto:$un\">$nn</a><br/>";
}
else
|