Guest User

Untitled

a guest
Jun 19th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. 1197 if ($fp = @fsockopen($host, $port,$errno,$errst,2))
  2.  
  3. 1198 {
  4.  
  5. 1199 // connected!
  6.  
  7. 1200 $success = true;
  8.  
  9. 1201
  10.  
  11. 1202 //stream_set_timeout($fp,10);
  12.  
  13. 1203 $out = "GET /{$matches[2]} HTTP/1.0\r\n";
  14.  
  15. 1204 $out .= "Host: {$host}\r\n";
  16.  
  17. 1205 $out .= "Connection: Close\r\n\r\n";
  18.  
  19. 1206
  20.  
  21. 1207 fwrite($fp, $out);
  22.  
  23. 1208 if (!isset($xml)) { $xml=''; }
  24.  
  25. 1209 while (!feof($fp))
  26.  
  27. 1210 {
  28.  
  29. 1211 $endtime = microtime(); $etime = explode(' ', $endtime); $end = $etime[0] + $etime[1];
  30.  
  31. 1212 $xmltime = number_format($end - $start, 4);
  32.  
  33. 1213
  34.  
  35. 1214
  36.  
  37. 1215 if ($xmltime > 4)
  38.  
  39. 1216 {
  40.  
  41. 1217 if ($_REQUEST['debug']) echo "<div>WARNING: Taking too long to read file ({$xmltime})</div>";
  42.  
  43. 1218 $success = false;
  44.  
  45. 1219 break;
  46.  
  47. 1220 }
  48.  
  49. 1221
  50.  
  51. 1222 $line = fgets($fp, 4096);
  52.  
  53. 1223 $xml .= $line;
  54.  
  55. 1224 }
  56.  
  57. 1225
  58.  
  59. 1226 fclose($fp);
  60.  
  61. 1227 }
Add Comment
Please, Sign In to add comment