Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Icecast-Server Icecast-Server
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 100
    • Issues 100
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Xiph.Org
  • Icecast-ServerIcecast-Server
  • Issues
  • #2439
Closed
Open
Created May 05, 2022 by Csaba27@Csaba27

HTTP request EOF problem

Hello, i have a problem with icecast 2.4.99 version, after the http response the icecast doesn't close the connection.

There is an example code from PHP:

<?php
//	ini_set("default_socket_timeout", 5);
	$start = microtime(true);

	$fp = fsockopen("icecast-example-host.com", 8000, $errno, $errstr, 5);
	if ($fp)
	{
		$out = "GET /status_json.xsl HTTP/1.1\r\n";
		$out .= "Connection: Close\r\n";
		$out .= "Host: icecast-example-host.com:8000\r\n";
		$out .= "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\r\n";
		$out .= "\r\n";

		fwrite($fp, $out);
//		stream_set_timeout($fp, 5);
		$line_count = 0;
		while (!feof($fp))
		{
			$line_count++;
			echo $line_count . " " . fgets($fp);
			# echo fread($fp, 1024);
		}
		fclose($fp);
	}
	else
	{
		echo $errstr . " (" . $errno . ")" . PHP_EOL;
	}

	echo PHP_EOL . " " . round(microtime(true) - $start, 4);

Run in console and check the execution time (request time).

Edited May 06, 2022 by Csaba27
Assignee
Assign to
Time tracking