return 1;
}
-static int write_ok(int fd)
-{
- struct timeval tv = {0, 0};
- fd_set wfds;
- int ret;
-again:
- FD_ZERO(&wfds);
- FD_SET(fd, &wfds);
- ret = select(fd + 1, NULL, &wfds, NULL, &tv);
- if (ret < 0 && errno == EINTR)
- goto again;
- if (ret < 0)
- ret = -E_WRITE_OK;
- return ret;
-}
-
-
static int send_queued_packets(struct http_client *hc)
{
int ret;
list_for_each_entry_safe(qp, tmp, &hc->packet_queue, node) {
ret = write_ok(hc->fd);
if (ret <= 0)
- return ret;
+ return ret? -E_WRITE_OK : 0;
ret = write(hc->fd, qp->packet, qp->len);
if (ret < 0)
return ret;