X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=http_send.c;h=276c0e416bb1218b2c24788bbe86f671da58731c;hp=c574ba3ca91f58c5114f08e4191c624898bd1a04;hb=68f5f7bdb30e7adcb87d0f314c67f0f80b337306;hpb=2ed89c59f0efcd0a2763f47c7d3455663241e623;ds=sidebyside diff --git a/http_send.c b/http_send.c index c574ba3c..276c0e41 100644 --- a/http_send.c +++ b/http_send.c @@ -178,23 +178,6 @@ static int queue_packet(struct http_client *hc, const char *buf, size_t len) 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; @@ -205,7 +188,7 @@ static int send_queued_packets(struct http_client *hc) 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; @@ -288,7 +271,7 @@ static void http_post_select(__unused struct audio_format *af, fd_set *rfds, { int i = -1, match; struct http_client *hc, *tmp; - char *err_msg; + const char *err_msg; list_for_each_entry_safe(hc, tmp, &clients, node) { i++;