First packets exchanged

This commit is contained in:
Quentin 2019-08-29 11:27:34 +02:00
parent 33b45583a2
commit e99c8a8e5a

View file

@ -234,19 +234,21 @@ void adapt(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct buff
struct evt_core_fdinfo *to_fdinfo = NULL; struct evt_core_fdinfo *to_fdinfo = NULL;
for (int i = ui->ap_arr_vals-1; i >= 0; i--) { for (int i = ui->ap_arr_vals-1; i >= 0; i--) {
fprintf(stderr, "i=%d, ui->ap_arr_vals=%d\n", i, ui->ap_arr_vals); //fprintf(stderr, "i=%d, ui->ap_arr_vals=%d\n", i, ui->ap_arr_vals);
if (ui->ap_arr_meta[i]->fmt.content.udp_metadata_thunder.id <= thunderc->recv_id) continue; if (ui->ap_arr_meta[i]->fmt.content.udp_metadata_thunder.id <= thunderc->recv_id) continue;
thunderc->recv_id = ui->ap_arr_meta[i]->fmt.content.udp_metadata_thunder.id; thunderc->recv_id = ui->ap_arr_meta[i]->fmt.content.udp_metadata_thunder.id;
// Find destination // Find destination
sprintf(url, "udp:write:127.0.0.1:%d", ui->ap_arr_pl[i]->fmt.content.udp_encapsulated.port); sprintf(url, "udp:write:127.0.0.1:%d", ui->ap_arr_pl[i]->fmt.content.udp_encapsulated.port);
to_fdinfo = evt_core_get_from_url (ctx, url); to_fdinfo = evt_core_get_from_url (ctx, url);
fprintf(stderr, "%s\n", url);
if (to_fdinfo == NULL) { if (to_fdinfo == NULL) {
fprintf(stderr, "No fd for URL %s in tcp-read. Dropping packet :( \n", url); fprintf(stderr, "No fd for URL %s in tcp-read. Dropping packet :( \n", url);
} }
struct buffer_packet *bp_dest = inject_buffer_tow (&app_ctx->br, to_fdinfo); struct buffer_packet *bp_dest = inject_buffer_tow (&app_ctx->br, to_fdinfo);
dump_buffer_packet (bp_dest); bp_dest->mode = BP_WRITING;
//dump_buffer_packet (bp_dest);
buffer_append_ap (bp_dest, ui->ap_arr_pl[i]); buffer_append_ap (bp_dest, ui->ap_arr_pl[i]);
main_on_udp_write(ctx, to_fdinfo); main_on_udp_write(ctx, to_fdinfo);
} }