Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
341b3f0
)
Make htparser exit when the root multiplexer exits.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 1 Jan 2009 03:50:08 +0000
(
04:50
+0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 1 Jan 2009 03:50:08 +0000
(
04:50
+0100)
src/htparser.c
patch
|
blob
|
blame
|
history
diff --git
a/src/htparser.c
b/src/htparser.c
index
07f3dd6
..
001c6c1
100644
(file)
--- a/
src/htparser.c
+++ b/
src/htparser.c
@@
-453,6
+453,28
@@
out:
close(ss);
}
close(ss);
}
+static void plexwatch(struct muth *muth, va_list args)
+{
+ vavar(int, fd);
+ char *buf;
+ int ret;
+
+ while(1) {
+ block(fd, EV_READ, 0);
+ buf = smalloc(65536);
+ ret = recv(fd, buf, 65536, 0);
+ if(ret < 0) {
+ flog(LOG_WARNING, "received error on rootplex read channel: %s", strerror(errno));
+ exit(1);
+ } else if(ret == 0) {
+ exit(0);
+ }
+ /* Maybe I'd like to implement some protocol in this direction
+ * some day... */
+ free(buf);
+ }
+}
+
int main(int argc, char **argv)
{
int fd;
int main(int argc, char **argv)
{
int fd;
@@
-478,6
+500,7
@@
int main(int argc, char **argv)
} else {
mustart(listenloop, fd);
}
} else {
mustart(listenloop, fd);
}
+ mustart(plexwatch, plex);
ioloop();
return(0);
}
ioloop();
return(0);
}