- struct udp_target *ut = para_calloc(sizeof(struct udp_target));
-
- strncpy(ut->host, host, sizeof(ut->host));
- ut->port = port > 0 ? port : conf.udp_default_port_arg;
- ut->fd = -1; /* not yet connected */
- PARA_INFO_LOG("adding to target list (%s#%d)\n",
- ut->host, ut->port);
- para_list_add(&ut->node, &targets);
- ut->fcp.slices_per_group = 16;
- ut->fcp.data_slices_per_group = 14;
- ut->fcp.max_slice_bytes = 1400;
- ut->fcp.send = udp_send_fec;
- ut->fcp.private_data = ut;
- vss_add_fec_client(&ut->fcp, &ut->fc);
+ struct udp_target *ut = para_calloc(sizeof(*ut));
+
+ strncpy(ut->host, scd->host, sizeof(ut->host));
+ ut->port = scd->port > 0 ? scd->port : conf.udp_default_port_arg;
+
+ ut->fcp.slices_per_group = scd->slices_per_group;
+ ut->fcp.data_slices_per_group = scd->data_slices_per_group;
+ ut->fcp.max_slice_bytes = scd->max_slice_bytes;
+ ut->fcp.init_fec = udp_init_fec;
+ ut->fcp.send_fec = udp_send_fec;
+
+ ut->sc = para_calloc(sizeof(*ut->sc));
+ ut->sc->fd = -1; /* not yet connected */
+ ut->sc->private_data = ut;
+ ut->fc = vss_add_fec_client(ut->sc, &ut->fcp);
+
+ PARA_INFO_LOG("adding to target list (%s#%d)\n", ut->host, ut->port);
+ para_list_add(&ut->sc->node, &targets);