+ if (sc) {
+ udp_delete_target(sc, "com_delete");
+ return 1;
+ }
+ PARA_NOTICE_LOG("not deleting non-existing target '%s'\n", scd->host);
+ return -E_TARGET_NOT_FOUND;
+}
+
+/** Initialize UDP session and set maximum payload size. */
+static int udp_init_fec(struct sender_client *sc)
+{
+ int mps;
+
+ udp_init_session(sc);
+ mps = generic_max_transport_msg_size(sc->fd) - sizeof(struct udphdr);
+ PARA_INFO_LOG("current MPS = %d bytes\n", mps);
+ return mps;
+}
+
+/** Check and clear socket error if any. */
+static int udp_check_socket_state(struct sender_client *sc)
+{
+ struct udp_target *ut = sc->private_data;
+ int ret;
+ socklen_t errlen = sizeof(ret);
+
+ if (getsockopt(sc->fd, SOL_SOCKET, SO_ERROR, &ret, &errlen) < 0) {
+ PARA_ERROR_LOG("SO_ERROR failed: %s\n", strerror(ret));