Dolda2000 GitWeb
/
doldaconnect.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4eba46b
)
Detect errors when writing to sockets.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 24 Apr 2008 01:37:02 +0000
(
03:37
+0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 24 Apr 2008 01:37:02 +0000
(
03:37
+0200)
daemon/net.c
patch
|
blob
|
blame
|
history
diff --git
a/daemon/net.c
b/daemon/net.c
index
44974f1
..
212310a
100644
(file)
--- a/
daemon/net.c
+++ b/
daemon/net.c
@@
-172,6
+172,7
@@
static struct socket *newsock(int type)
struct socket *new;
new = smalloc(sizeof(*new));
+ memset(new, 0, sizeof(*new));
new->refcount = 2;
new->fd = -1;
new->isrealsocket = 1;
@@
-525,8
+526,12
@@
static void sockflush(struct socket *sk)
ret = write(sk->fd, sk->outbuf.s.buf, sk->outbuf.s.datasize);
if(ret < 0)
{
- /* For now, assume transient error, since
- * the socket is polled for errors */
+ if((errno != EINTR) && (errno != EAGAIN))
+ {
+ if(sk->errcb != NULL)
+ sk->errcb(sk, errno, sk->data);
+ closesock(sk);
+ }
break;
}
if(ret > 0)