- if (sc->cq != NULL) {
- /* ignore return value, closing the target anyway. */
- (void)write(sc->fd, buf, len);
- udp_close_target(sc);
- }
+ udp_close_target(sc);
+}
+
+static int udp_resolve_target(const char *url, struct sender_command_data *scd)
+{
+ const char *result;
+ int ret, port;
+
+ ret = parse_fec_url(url, scd);
+ if (ret)
+ return ret;
+ port = scd->port > 0 ? scd->port : conf.udp_default_port_arg;
+
+ ret = para_connect_simple(IPPROTO_UDP, scd->host, port);
+ if (ret < 0)
+ return ret;
+
+ result = remote_name(ret);
+ close(ret);
+
+ if (!parse_url(result, scd->host, sizeof(scd->host), &scd->port))
+ return -E_ADDRESS_LOOKUP;
+ return 1;