Update capture traffic with better extensions

This commit is contained in:
Quentin 2019-06-04 16:09:20 +02:00
parent 611feaa03b
commit 4643aa7a42
1 changed files with 2 additions and 1 deletions

View File

@ -61,12 +61,13 @@ void traffic_capture_stop(struct capture_ctx* ctx) {
FILE* fd = NULL;
char *exts[] = {"emitted", "received"};
struct dynbuf *dbs[] = {&ctx->in, &ctx->out};
for (int i = 0; i < 2; i++) {
size_t written = 0, ack = 0;
char *out_file = NULL;
asprintf(&out_file, "%s.%d", ctx->filename, i);
asprintf(&out_file, "%s.%s", ctx->filename, exts[i]);
if (out_file == NULL || (fd = fopen(out_file, "w")) == NULL) {
perror("failed to open file");
exit(EXIT_FAILURE);