|
|
@ -118,6 +118,8 @@ int ast_carefulwrite(int fd, char *s, int len, int timeoutms)
|
|
|
|
if (res < 0) res = 0;
|
|
|
|
if (res < 0) res = 0;
|
|
|
|
len -= res;
|
|
|
|
len -= res;
|
|
|
|
s += res;
|
|
|
|
s += res;
|
|
|
|
|
|
|
|
res = 0;
|
|
|
|
|
|
|
|
if (len) {
|
|
|
|
fds[0].fd = fd;
|
|
|
|
fds[0].fd = fd;
|
|
|
|
fds[0].events = POLLOUT;
|
|
|
|
fds[0].events = POLLOUT;
|
|
|
|
/* Wait until writable again */
|
|
|
|
/* Wait until writable again */
|
|
|
@ -125,6 +127,7 @@ int ast_carefulwrite(int fd, char *s, int len, int timeoutms)
|
|
|
|
if (res < 1)
|
|
|
|
if (res < 1)
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1292,7 +1295,7 @@ static int process_message(struct mansession *s, struct message *m)
|
|
|
|
ast_mutex_lock(&s->__lock);
|
|
|
|
ast_mutex_lock(&s->__lock);
|
|
|
|
s->busy = 0;
|
|
|
|
s->busy = 0;
|
|
|
|
while(s->eventq) {
|
|
|
|
while(s->eventq) {
|
|
|
|
if (ast_carefulwrite(s->fd, s->eventq->eventdata, strlen(s->eventq->eventdata), s->writetimeout)) {
|
|
|
|
if (ast_carefulwrite(s->fd, s->eventq->eventdata, strlen(s->eventq->eventdata), s->writetimeout) < 0) {
|
|
|
|
ret = -1;
|
|
|
|
ret = -1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|