summaryrefslogtreecommitdiffstats
path: root/src/proxyfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/proxyfunc.c')
-rw-r--r--src/proxyfunc.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/proxyfunc.c b/src/proxyfunc.c
index 2992267..54df298 100644
--- a/src/proxyfunc.c
+++ b/src/proxyfunc.c
@@ -387,35 +387,3 @@ void *SendError(struct mansession *s, char *errmsg) {
return 0;
}
-
-/*! If you are calling ast_carefulwrite, it is assumed that you are calling
- it on a file descriptor that _DOES_ have NONBLOCK set. This way,
- there is only one system call made to do a write, unless we actually
- have a need to wait. This way, we get better performance. */
-int ast_carefulwrite(int fd, char *s, int len, int timeoutms)
-{
- /* Try to write string, but wait no more than ms milliseconds
- before timing out */
- int res=0;
- struct pollfd fds[1];
- while(len) {
- res = m_send(fd, s, len);
- if ((res < 0) && (errno != EAGAIN)) {
- return -1;
- }
- if (res < 0) res = 0;
- len -= res;
- s += res;
- res = 0;
- if (len) {
- fds[0].fd = get_real_fd(fd);
- fds[0].events = POLLOUT;
- /* Wait until writable again */
- res = poll(fds, 1, timeoutms);
- if (res < 1)
- return -1;
- }
- }
- return res;
-}
-