function get_header_login($host, $uri, $port, $header, $url) { $extra_headers = array(); $extra_headers["Cookie"] = sn_login(); $response = whead($host, $uri, $port, ICEWEASEL_UA, $extra_headers); sn_logout(); $header_value = exec_get_header($response, $header, False); if ($header_value != "") { privmsg(" {$header} header for {$url} = {$header_value}"); } }
$redirect_data = get_redirected_url($trailing, "", "", array()); if ($redirect_data === False) { term_echo("get_redirected_url=false"); return; } $rd_url = $redirect_data["url"]; $rd_cookies = $redirect_data["cookies"]; $rd_extra_headers = $redirect_data["extra_headers"]; $host = ""; $uri = ""; $port = 80; if (get_host_and_uri($rd_url, $host, $uri, $port) == False) { term_echo("get_host_and_uri=false"); return; } $headers = whead($host, $uri, $port); $content_length = exec_get_header($headers, "content-length", False); if ($content_length != "") { if ($content_length > 1024 * 1024) { privmsg(chr(3) . "13" . round($content_length / 1024 / 1024, 3) . " Mb (header)"); } elseif ($content_length > 1024) { privmsg(chr(3) . "13" . round($content_length / 1024, 3) . " kb (header)"); } else { privmsg(chr(3) . "13" . $content_length . " bytes (header)"); } return; } $breakcode = "return (strlen(\$response)>=2000000);"; $response = wget($host, $uri, $port, ICEWEASEL_UA, $rd_extra_headers, 20, $breakcode, 256); $html = strip_headers($response); $content_length = strlen($html);