Dolda2000 GitWeb
/
ashd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
htparser: Fixed readcrtchain bug.
[ashd.git]
/
src
/
userplex.c
diff --git
a/src/userplex.c
b/src/userplex.c
index
c50a15c
..
48a8ed3
100644
(file)
--- a/
src/userplex.c
+++ b/
src/userplex.c
@@
-158,19
+158,24
@@
static int forkchild(char *usrnm, struct hthead *forreq, int reqfd)
static void serve2(struct user *usr, struct hthead *req, int fd)
{
static void serve2(struct user *usr, struct hthead *req, int fd)
{
+ int serr;
+
if(usr->fd < 0)
usr->fd = forkchild(usr->name, req, fd);
if(usr->fd < 0)
usr->fd = forkchild(usr->name, req, fd);
- if(sendreq(usr->fd, req, fd)) {
- if((errno == EPIPE) || (errno == ECONNRESET)) {
+ if(sendreq2(usr->fd, req, fd, MSG_NOSIGNAL | MSG_DONTWAIT)) {
+ serr = errno;
+ if((serr == EPIPE) || (serr == ECONNRESET)) {
/* Assume that the child has crashed and restart it. */
close(usr->fd);
usr->fd = forkchild(usr->name, req, fd);
/* Assume that the child has crashed and restart it. */
close(usr->fd);
usr->fd = forkchild(usr->name, req, fd);
- if(!sendreq
(usr->fd, req, fd
))
+ if(!sendreq
2(usr->fd, req, fd, MSG_NOSIGNAL | MSG_DONTWAIT
))
return;
}
return;
}
- flog(LOG_ERR, "could not pass on request to user `%s': %s", usr->name, strerror(errno));
- close(usr->fd);
- usr->fd = -1;
+ flog(LOG_ERR, "could not pass on request to user `%s': %s", usr->name, strerror(serr));
+ if(serr != EAGAIN) {
+ close(usr->fd);
+ usr->fd = -1;
+ }
}
}
}
}