diff options
Diffstat (limited to 'src/main/extractor_plugin_main.c')
-rw-r--r-- | src/main/extractor_plugin_main.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/main/extractor_plugin_main.c b/src/main/extractor_plugin_main.c index c56dfab..4f6c77c 100644 --- a/src/main/extractor_plugin_main.c +++ b/src/main/extractor_plugin_main.c | |||
@@ -460,6 +460,7 @@ handle_start_message (struct ProcessingContext *pc) | |||
460 | LOG ("Failed to read 'start' message\n"); | 460 | LOG ("Failed to read 'start' message\n"); |
461 | return -1; | 461 | return -1; |
462 | } | 462 | } |
463 | fprintf (stderr, "Got start msg\n"); | ||
463 | pc->shm_ready_bytes = start.shm_ready_bytes; | 464 | pc->shm_ready_bytes = start.shm_ready_bytes; |
464 | pc->file_size = start.file_size; | 465 | pc->file_size = start.file_size; |
465 | pc->read_position = 0; | 466 | pc->read_position = 0; |
@@ -475,6 +476,10 @@ handle_start_message (struct ProcessingContext *pc) | |||
475 | if (-1 == EXTRACTOR_write_all_ (pc->out, &done, sizeof (done))) | 476 | if (-1 == EXTRACTOR_write_all_ (pc->out, &done, sizeof (done))) |
476 | { | 477 | { |
477 | LOG ("Failed to write 'done' message\n"); | 478 | LOG ("Failed to write 'done' message\n"); |
479 | FILE *f; | ||
480 | f = fopen("debug.txt", "a+"); | ||
481 | fprintf(f, "Failed to write 'done' message' \n"); | ||
482 | fclose(f); | ||
478 | return -1; | 483 | return -1; |
479 | } | 484 | } |
480 | if ( (NULL != pc->plugin->specials) && | 485 | if ( (NULL != pc->plugin->specials) && |
@@ -524,18 +529,33 @@ process_requests (struct ProcessingContext *pc) | |||
524 | if (0 != handle_start_message (pc)) | 529 | if (0 != handle_start_message (pc)) |
525 | { | 530 | { |
526 | LOG ("Failure to handle START\n"); | 531 | LOG ("Failure to handle START\n"); |
532 | FILE *f; | ||
533 | f = fopen("debug.txt", "a+"); | ||
534 | fprintf(f, "Failure to handle START' \n"); | ||
535 | fclose(f); | ||
527 | return; | 536 | return; |
528 | } | 537 | } |
529 | break; | 538 | break; |
530 | case MESSAGE_UPDATED_SHM: | 539 | case MESSAGE_UPDATED_SHM:{ |
531 | LOG ("Illegal message\n"); | 540 | LOG ("Illegal message\n"); |
532 | /* not allowed here, we're not waiting for SHM to move! */ | 541 | /* not allowed here, we're not waiting for SHM to move! */ |
542 | FILE *f; | ||
543 | f = fopen("debug.txt", "a+"); | ||
544 | fprintf(f, "Illegal message' \n"); | ||
545 | fclose(f); | ||
546 | |||
533 | return; | 547 | return; |
548 | } | ||
534 | case MESSAGE_DISCARD_STATE: | 549 | case MESSAGE_DISCARD_STATE: |
535 | /* odd, we're already in the start state... */ | 550 | /* odd, we're already in the start state... */ |
536 | continue; | 551 | continue; |
537 | default: | 552 | default: |
538 | LOG ("Received invalid messag %d\n", (int) code); | 553 | LOG ("Received invalid messag %d\n", (int) code); |
554 | FILE *f; | ||
555 | f = fopen("debug.txt", "a+"); | ||
556 | fprintf(f, "Received invalid messag' \n"); | ||
557 | fclose(f); | ||
558 | |||
539 | /* error, unexpected message */ | 559 | /* error, unexpected message */ |
540 | return; | 560 | return; |
541 | } | 561 | } |
@@ -625,6 +645,14 @@ EXTRACTOR_plugin_main_ (struct EXTRACTOR_PluginList *plugin, | |||
625 | process_requests (&pc); | 645 | process_requests (&pc); |
626 | LOG ("IPC error; plugin `%s' terminates!\n", | 646 | LOG ("IPC error; plugin `%s' terminates!\n", |
627 | plugin->short_libname); | 647 | plugin->short_libname); |
648 | |||
649 | |||
650 | FILE *f; | ||
651 | f = fopen("debug.txt", "a+"); | ||
652 | fprintf(f, "IPC error; plugin `%s' terminates!\n", | ||
653 | plugin->short_libname); | ||
654 | fclose(f); | ||
655 | |||
628 | #if WINDOWS | 656 | #if WINDOWS |
629 | if (NULL != pc.shm) | 657 | if (NULL != pc.shm) |
630 | UnmapViewOfFile (pc.shm); | 658 | UnmapViewOfFile (pc.shm); |