Menu

#1572 Modified Privoxy doesn't work as expected

3.0.19
closed
nobody
other (323)
5
2013-06-03
2013-06-02
Alex Fotios
No

Privoxy: 3.0.19 - runs as service
OS: Windows 8 Pro
All browsers

Hi there,

I've modified perl style regex replace logic in pcrs.c to load replacement text from a separate file whose path can be specified in the rule definition in a filters file (e.g. default.filter or user.filter). This works great but if the file that contains the replacement text is modified Privoxy still loads the text that was in the file when it started. If I restart the Privoxy service it picks up the file modifications as expected. I am using regular fopen(), fgets() type of ANSI C calls.

What could be causing this?

Many thanks!

Discussion

  • Fabian Keil

    Fabian Keil - 2013-06-03

    Most likely this is caused by a bug in the code you added, for example you might have forgotten to let Privoxy monitor changes in "separate files" as well.

    You don't expect us to debug problems in code we didn't write and can't even see, do you?

     
  • Fabian Keil

    Fabian Keil - 2013-06-03
    • summary: Privoxy --> Modified Privoxy doesn't work as expected
    • status: open --> pending
     
  • Alex Fotios

    Alex Fotios - 2013-06-03

    Hi Fabian,

    I hope to contribute this to Privoxy code once I am happy with how it works and it is generic enough. For the time being it only helps me inject a script into loaded pages that does some processing on the DOM. The code is just too ad hoc right now to be if value to anyone (I thjink).

    I am definitely not letting Privoxy know of the new file it needs to monitor. I did not know I have to do that. Can you provide some pointer as to how I may be able to do that and why it is needed? Why won't the file read judt read the latest version of the file?

    Many thanks,
    Alex

     
  • Alex Fotios

    Alex Fotios - 2013-06-03
    • status: pending --> open
     
  • Fabian Keil

    Fabian Keil - 2013-06-03
    • assigned_to: nobody --> fabiankeil
    • status: open --> pending
     
  • Fabian Keil

    Fabian Keil - 2013-06-03

    Filter files (and other files, too) are only read again if they have been modified.

    For details see run_loader() in loaders.c. In your case you'll probably have to adjust load_one_re_filterfile() to also call check_file_changed() for any "separate files" that are referenced. any_loaded_file_changed() probably has to be extended as well.

     
  • Alex Fotios

    Alex Fotios - 2013-06-03

    I think this is a manifestation of the "100% CPU" problem. What
    happens is some site has massive amounts of whitespace in their
    HTML that you don't ultimately see, but Privoxy spends a lot of
    time trying to filter it all. The interim solution is to keep
    Privoxy from filtering that particular site in the user.action
    file. Of course, once Privoxy starts spinning, it'll need to be
    killed and restarted.

    The problem is in the js-annoyances and the unsolicited-popups
    filters. If you turn those off in general (or for your problem
    site(s) in particular) I think you'll have better luck. Can you
    please give that a try?

     
  • Alex Fotios

    Alex Fotios - 2013-06-03

    Thank you! It all makes sense now - I will look into it and hopefully offer to commit this feature into Privoxy's source soon.

     
  • Alex Fotios

    Alex Fotios - 2013-06-03
    • assigned_to: fabiankeil --> nobody
    • status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB