Skip to content

Fix for handling changes introduced in postprocess - #135

Merged
xroche merged 1 commit into
xroche:masterfrom
RomanSek:plugin-postprocess-fix
Jun 12, 2026
Merged

xroche merged 1 commit into
xroche:masterfrom
RomanSek:plugin-postprocess-fix

Conversation

@RomanSek

@RomanSek RomanSek commented May 4, 2017

Copy link
Copy Markdown

Plugin postprocessing didn't introduce changes in files if string chain pointer didn't change. I removed additional check for that so HTTrack will now depend only on return value from plugin to apply changes.
Let me know if you need tests for this fix.

@xroche

xroche commented Jun 10, 2018

Copy link
Copy Markdown
Owner

I don't get the change - if cAddr == TypedArrayElts(output_buffer), the copy will be idem-potent, so this does not change anything

@RomanSek

Copy link
Copy Markdown
Author

I'm a bit rusty with my C, so I can be wrong. I suspect that bug happens when you realloc memory for changed output and get pointer to the same memory address, but with bigger/smaller size of the allocated memory block. In that case if cAddr == TypedArrayElts(output_buffer) will be true, but new output is different and isn't copied properly.

If you want - I can write a plugin that triggers this behavior.

@xroche

xroche commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Merged, thanks, and sorry for the (very) long delay. The pointer-equality guard indeed dropped in-place edits made by the postprocess callback. A regression test covering an in-place edit would be a welcome follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants