[icecast-dev] PROBLEM REPORT (and example): EPIPE errors
Ricardo Galli
gallir at uib.es
Sun Mar 3 08:32:53 PST 2002
This small example will make icecast unusable after few seconds. The problem
resides on EPIPE received when trying to send the first (58) bytes of the
vorbis predata.
Change the URL for your own, and try it in a LAN.
I have no idea on the reasons of these errors, altough I suspect it's related
to the fact that the headers are sent in blocking state and then we change to
non-blocking. I will try to put all headers in a refbuf and append it to the
client queue.
for i in `seq 100`
do echo $i
timelimit -s 3 wget -q http://mcrg.uib.es:8000/live.ogg &
timelimit -s 3 wget -q http://mcrg.uib.es:8000/live.ogg &
timelimit -s 3 wget -q http://mcrg.uib.es:8000/live.ogg
done
<p>(timelimit is a small program in C to limit the execution of the command to 3
wallclock seconds).
/******
timelimit.c
*******/
#include <stdlib.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
<p><p>pid_t pid, ended=0;
void wakeup(int s)
{
printf("Signal %d received\n", s);
kill(pid, SIGTERM);
}
usage()
{
printf("timelimit {-s secs | -m mins} commands arg1 arg2...\n");
exit(1);
}
<p>main(int argc, char *argv[])
{
int i, seconds = -1;
i = 1;
if (argc > 3) {
if (strcmp(argv[i], "-s") == 0)
seconds = atoi(argv[i+1]);
else if (strcmp(argv[i], "-m") == 0)
seconds = atoi(argv[i+1]) * 60;
}
if (seconds <= 0) usage();
if((pid = fork()) == 0) {
execvp(argv[3], &argv[3]);
printf("Error in exec\n");
exit(1);
}
<p> signal(SIGALRM, wakeup);
alarm(seconds);
while(ended != pid) {
ended = wait(NULL);
}
}
<p><p>
--
ricardo
"I just stopped using Windows and now you tell me to use Mirrors?"
- said Aunt Tillie, just before downloading 2.5.3 kernel.
--- >8 ----
List archives: http://www.xiph.org/archives/
icecast project homepage: http://www.icecast.org/
To unsubscribe from this list, send a message to 'icecast-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Icecast-dev
mailing list