diff --git a/src/algo_lightning.c b/src/algo_lightning.c index 246a788..c87f25d 100644 --- a/src/algo_lightning.c +++ b/src/algo_lightning.c @@ -122,11 +122,11 @@ void algo_lightning_pad(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo uint64_t ref = lightc->uniq_pkt_sent_id; // 0. Store current buffer to application - fprintf(stderr, " [algo_lightning] Store buffer with pointer %p\n", (void*) ref); + //fprintf(stderr, " [algo_lightning] Store buffer with pointer %p\n", (void*) ref); dup_buffer_toa (&app_ctx->br, bp, (void *)ref); // 1. Clean old buffers (we keep only thunderc->total_links buffer, keeping more would be useless) - fprintf(stderr, " [algo_lightning] Clean queue\n"); + //fprintf(stderr, " [algo_lightning] Clean queue\n"); if (ref > lightc->total_links && get_app_buffer (&app_ctx->br, (void *)(ref - lightc->total_links))) { mv_buffer_atof (&app_ctx->br, (void *)(ref - lightc->total_links)); } @@ -134,29 +134,29 @@ 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; while(1) { - fprintf(stderr, " [algo_lightning] Enter loop with ref %ld\n", add_ref); + //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); + //fprintf(stderr, " [algo_lightning] add_ref=%ld < 1\n", add_ref); break; } add_ref--; struct buffer_packet *bp_iter = get_app_buffer (&app_ctx->br, (void *)add_ref); if (bp_iter == NULL) { - fprintf(stderr, " [algo_lightning] bp_iter=%p == NULL\n", bp_iter); + //fprintf(stderr, " [algo_lightning] bp_iter=%p == NULL\n", bp_iter); break; } union abstract_packet *ap = buffer_first_ap (bp_iter); if (ap->fmt.headers.cmd != CMD_UDP_ENCAPSULATED) { - fprintf(stderr, "Invalid buffer payload!\n"); + //fprintf(stderr, "Invalid buffer payload!\n"); exit(EXIT_FAILURE); } - fprintf(stderr, " [algo_lightning] Currently %ld bytes, would be %ld\n", buffer_full_size (bp), buffer_full_size (bp) + ap->fmt.headers.size); + //fprintf(stderr, " [algo_lightning] Currently %ld bytes, would be %ld\n", buffer_full_size (bp), buffer_full_size (bp) + ap->fmt.headers.size); if (buffer_full_size (bp) + ap->fmt.headers.size > TOR_CELL_SIZE - lightc->monit_pkt_size) break; buffer_append_ap (bp, ap); - /*if (ctx->verbose > 1)*/ fprintf(stderr, " [algo_lightning] Pad packet (now %ld bytes)\n", buffer_full_size (bp)); + if (ctx->verbose > 1) fprintf(stderr, " [algo_lightning] Pad packet (now %ld bytes)\n", buffer_full_size (bp)); } } @@ -410,7 +410,6 @@ int algo_lightning_on_datagram(struct evt_core_ctx* ctx, struct evt_core_fdinfo* cur = ap_next(cur); continue; } - printf("tagging packets delivered on slow link\n"); struct measure_packet *mp = (void*)&cur->fmt.content.udp_encapsulated.payload; mp->flag = 1; cur = ap_next(cur);