pad is the new suspect

This commit is contained in:
Quentin 2020-02-05 22:17:42 +01:00
parent a6b17cbf74
commit 92e2925149
2 changed files with 4 additions and 5 deletions

View file

@ -182,7 +182,9 @@ void algo_lightning_pad(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo
// 2. Append abstract packets stored in our buffers
uint64_t add_ref = ref;
printf("---- begin loop ----\n");
while(1) {
dump_buffer_packet(bp);
//fprintf(stderr, " [algo_lightning] Enter loop with ref %ld\n", add_ref);
if (add_ref < 1) {
//fprintf(stderr, " [algo_lightning] add_ref=%ld < 1\n", add_ref);
@ -206,7 +208,9 @@ void algo_lightning_pad(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo
buffer_append_ap (bp, ap);
if (ctx->verbose > 1) fprintf(stderr, " [algo_lightning] Pad packet (now %ld bytes)\n", buffer_full_size (bp));
printf("---- +1 ----\n");
}
printf("---- end loop ----\n");
}
void monitoring(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct buffer_packet* bp) {
@ -271,9 +275,6 @@ int deliver(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct buf
struct algo_ctx* app_ctx = fdinfo->cat->app_ctx;
union abstract_packet* ap = (union abstract_packet*) &bp->ip;
fprintf(stdout, "QDUDEBUG [lightning.deliver] %s extract port %d\n", fdinfo->url, ap->fmt.content.udp_encapsulated.port);
dump_buffer_packet(bp);
if (ctx->verbose > 1) fprintf(stderr, " [algo_lightning] 1/2 Find destination\n");
sprintf(url, "udp:write:127.0.0.1:%d", ap->fmt.content.udp_encapsulated.port);
to_fdinfo = evt_core_get_from_url (ctx, url);

View file

@ -197,8 +197,6 @@ enum FD_STATE read_packet_from_udp (struct evt_core_fdinfo* fdinfo, struct buffe
ap->fmt.headers.size = nread + pkt_header_size;
ap->fmt.headers.cmd = CMD_UDP_ENCAPSULATED;
ap->fmt.content.udp_encapsulated.port = url_get_port_int (fdinfo->url);
fprintf(stdout, "QDUDEBUG [packet.read_pkt_from_udp] %s extract port %d\n", fdinfo->url, ap->fmt.content.udp_encapsulated.port);
dump_buffer_packet(bp);
bp->mode = BP_WRITING;
bp->awrite = 0;