X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=udp_send.c;h=533af63a271f190718c45d8073f988b7971bf338;hb=c1d6c466251d21d1fb7b513ba2297ebf94d44853;hp=273b6a42e4c26e21abf4211a7e528ba5a7629a9c;hpb=9609fd30e0d3db45ede3ab5c6bc3a77c15b6aef8;p=paraslash.git diff --git a/udp_send.c b/udp_send.c index 273b6a42..533af63a 100644 --- a/udp_send.c +++ b/udp_send.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2009 Andre Noll + * Copyright (C) 2005-2010 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -160,7 +160,7 @@ static int udp_init_session(struct udp_target *ut) if (ut->fd >= 0) /* nothing to do */ return 0; - ret = makesock(AF_UNSPEC, IPPROTO_UDP, 0, ut->host, ut->port); + ret = para_connect_simple(IPPROTO_UDP, ut->host, ut->port); if (ret < 0) return ret; ut->fd = ret; @@ -237,6 +237,8 @@ static int udp_send_fec(char *buf, size_t len, void *private_data) if (ret < 0) goto fail; ret = send_queued_chunks(ut->fd, ut->cq, 0); + if (ret == -ERRNO_TO_PARA_ERROR(ECONNREFUSED)) + ret = 0; if (ret < 0) goto fail; if (!len) @@ -247,6 +249,8 @@ static int udp_send_fec(char *buf, size_t len, void *private_data) goto fail; } ret = write_nonblock(ut->fd, buf, len, 0); + if (ret == -ERRNO_TO_PARA_ERROR(ECONNREFUSED)) + ret = 0; if (ret < 0) goto fail; if (ret != len) { @@ -303,10 +307,10 @@ static char *udp_info(void) ret = make_message( "udp sender:\n" "\tstatus: %s\n" - "\tport: udp %d\n" + "\tport: %s\n" "\ttargets: %s\n", (sender_status == SENDER_ON)? "on" : "off", - conf.udp_default_port_arg, + stringify_port(conf.udp_default_port_arg, "udp"), tgts? tgts : "(none)" ); free(tgts);