Menu

#1711 browser close socket to privoxy when access some URL, but without privoxy it just work fine

3.0.x
closed
6
2016-04-09
2016-04-03
Weeds
No

I use privoxy 3.0.24, and found when I access this url http://vdl.china.com.cn/test_tianmai/AnHuiHD/2016/04/02/AnHuiHD_2500000_20160402_18393222_0_126.mp4
, it could not be played fully.
I add debug code in privoxy just see that the FD_ISSET check client socket close the socket, and I capture packet through wireshark, show client FIN and RST the socket.

when I remove privoxy, it just work fine.
Browser used : Safari, Firefox. URL link as above.

Please help me check what cause browser close socket to privoxy ? thanks a lot.

Discussion

  • Weeds

    Weeds - 2016-04-04

    Sorry, not provide much information.
    Now, I have add the privoxy config and user.filter user.action three configuration file for your reference.
    And the log as below when error happened, even if toggle off.

    Accepted connection from 127.0.0.1 on socket 6
    2016-04-04 10:44:56.199 000002a0 Connect: Waiting for the next client connection. Currently active threads: 3
    2016-04-04 10:44:56.199 00000040 Connect: Complete client request received.
    2016-04-04 10:44:56.199 00000040 Request: vdl.china.com.cn/test_tianmai/AnHuiHD/2016/04/02/AnHuiHD_2500000_20160402_18393222_0_126.mp4
    2016-04-04 10:44:56.199 00000040 Connect: to vdl.china.com.cn
    2016-04-04 10:44:56.215 00000040 Connect: Connected to vdl.china.com.cn[125.91.251.6]:80.
    2016-04-04 10:44:56.215 00000040 Connect: Created new connection to vdl.china.com.cn:80 on socket 9.
    2016-04-04 10:44:56.216 00000040 Connect: to vdl.china.com.cn successful
    2016-04-04 10:44:56.238 00000040 Connect: The client closed socket 6 while the server socket 9 is still open.
    2016-04-04 10:44:56.238 00000040 Connect: Marking the server socket 9 tainted.
    2016-04-04 10:44:56.238 00000040 Connect: Received 5318 bytes while expecting 22022508.
    2016-04-04 10:44:56.238 00000040 Connect: Closing server socket 9 connected to vdl.china.com.cn. Keep-alive 1. Tainted: 1. Socket alive 1. Timeout: 0.

    I also use the CLIENT_HEADER_TAGGER in user.filter file, but it still not work fine.

    To reproduce this problem:
    Just use privoxy as web proxy, and access url http://vdl.china.com.cn/test_tianmai/AnHuiHD/2016/04/02/AnHuiHD_2500000_20160402_18393222_0_126.mp4

    You will see above log in privoxy log(I have added some log debug log into the privoxy, just find out browser-side client close the socket, the deep reason, I can not find anymore)

    If above information is not enough, please contact me, I will provide as detail as I can, thanks.

     

    Last edit: Weeds 2016-04-04
    • Fabian Keil

      Fabian Keil - 2016-04-04

      I tried from several locations, but the server isn't accepting my
      connections (with or without Privoxy) so I can't reproduce this myself.

      Please provide a complete log excerpt that shows at least one whole failing
      request and the response. Please use the debug settings documented at:
      https://www.privoxy.org/user-manual/contact.html
      and a unmodified Privoxy version.

      Your user.filter contains an action section that doesn't belong
      there.

      Filter files just define taggers, to enable them you need an action
      section and your user.action only seems to enable a custom filter.

      To allow Range requests, please copy the last two action sections from:
      https://www.privoxy.org/user-manual/actions-file.html#CLIENT-HEADER-TAGGER
      to one of your action files. (Copying all of them won't hurt, but
      only the last two are relevant here.)

       
      • Weeds

        Weeds - 2016-04-04

        OK, I will try that right now.
        As you say the link unaccessable, I think maybe due to China Firewall cause that.
        I have already download the video and put it on my site found it still can reproduce, so you can try link: http://hiweeds.net/test.mp4 if this still have some cannot access, try replace domain with IP address 112.74.112.103

        Currently, I add action and filter rule to action file, not help with that.

         
        • Fabian Keil

          Fabian Keil - 2016-04-04

          I had no problems downloading the file from http://hiweeds.net/test.mp4:
          SHA256 (test.mp4) = e6c6ace335ed411152e107cce59fcca91dfda252afd76fd4a0f0bc1119a9dcf2

          Did you verify that you can reproduce the problem with this URL?

          It's likely that the problem has something to do with the server
          and the actual content does not matter.

           
          • Weeds

            Weeds - 2016-04-04

            I tried with privoxy 3.0.24 source code, if just use default Makefile, it will work fine.

            But if I use configure like this:

            ./configure --sysconfdir=/Users/weeds/git/privoxy-3.0.24-stable --disable-toggle --disable-force --disable-acl-support --disable-trust-files --disable-editor --disable-stats --disable-image-blocking --disable-trust-files --with-debug

            It will reproduce the problem I found. and I have collect the log in attachments.
            You can see below message when error happen:

            127.0.0.1 - - [04/Apr/2016:19:30:30 +0800] "GET http://hiweeds.net/test.mp4 HTTP/1.1" 200 0
            2016-04-04 19:30:30.288 00000220 Connect: Received 8275 bytes while expecting 22022508.
            2016-04-04 19:30:30.289 000003a8 Connect: Closing server socket 11 connected to hiweeds.net. Keep-alive 0. Tainted: 1. Socket alive 1. Timeout: 0.

             
            • Fabian Keil

              Fabian Keil - 2016-04-04

              Your log excerpt indicates that you did not enable the tagger I suggested
              previously and that Range headers are being removed as suspected:
              2016-04-04 19:30:30.264 000003a8 Header: Content filtering is enabled. Crunching: 'Range: bytes=196608-262143' to prevent range-mismatch problems.

              As mentioned before, this could explain why the client does
              not like the response. Please try to reproduce the problem with
              the tagger enabled.

               
              • Weeds

                Weeds - 2016-04-04

                See below comment

                 
  • Weeds

    Weeds - 2016-04-04

    I enable header tagger. (see user.action and user.filter)
    it works on Firefox browser, but not work on Safari

    You can see my the log.

     
    • Fabian Keil

      Fabian Keil - 2016-04-04

      You put the action section in a filter file instead of an action file:

      From your log:
      2016-04-04 21:09:42.335 000002a0 Info: Loading filter file: /Users/weeds/git/privoxy/user.filter
      2016-04-04 21:09:42.335 000002a0 Error: Adding re_filter job '{+client-header-tagger{range-requests}}' to filter client-useragent failed: (pcrs:) Syntax error while parsing command
      2016-04-04 21:09:42.335 000002a0 Error: Adding re_filter job '/' to filter client-useragent failed: (pcrs:) Syntax error while parsing command

      As a result, Range headers are still being removed:
      2016-04-04 21:09:47.613 000001d0 Header: Content filtering is enabled. Crunching: 'Range: bytes=199573-22022507' to prevent range-mismatch problems.

       
      • Weeds

        Weeds - 2016-04-05

        Understood.

        Now the major problem is how to enable the clien-header-tagger.
        I follow your suggestions above to copy last two section into action file, but still no enable it.

        user.action:

        {+client-header-tagger{range-requests}}
        /
        {-filter -deanimate-gifs}
        TAG:^RANGE-REQUEST$

        **user.filter: **

        FILTER: range-requests
        TAG:^RANGE-REQUEST$

        The error log as below:

        2016-04-06 10:34:44.466 7f58e480a700 Info: Loading filter file: /home/weeds/debug/privoxy-3.0.24-stable/user.filter
        2016-04-06 10:34:44.466 7f58e480a700 Error: Adding re_filter job 'TAG:^RANGE-REQUEST$' to filter range-requests failed: (pcrs:) Syntax error while parsing command
        2016-04-06 10:34:44.466 7f58e480a700 Info: Loading actions file: /home/weeds/debug/privoxy-3.0.24-stable/user.action
        2016-04-06 10:34:44.466 7f58e480a700 Error: Missing filter 'range-requests'
        2016-04-06 10:34:44.466 7f58e480a700 Error: Invalid action section in file '/home/weeds/debug/privoxy-3.0.24-stable/user.action', starting at line 7: {+client-header-tagger{range-requests}}

        And I search the reference document, still not find the way to enable the range-requests tagger.
        Could you indicate where I am doing wrong ? thanks

         
        • Fabian Keil

          Fabian Keil - 2016-04-05

          Your user.action excerpt looks good, but your user.filter excerpt
          is invalid (incorrect filter type combined with a TAG pattern which
          is only valid in action files).

          Also note that the range-request client-header tagger is already
          defined in default.filter:
          http://ijbswa.cvs.sourceforge.net/viewvc/ijbswa/current/default.filter?view=markup#l778

          If you disabled the default.filter file shipped with Privoxy you
          could copy and paste the client-header tagger from there to your
          user.filter file.

           
  • Weeds

    Weeds - 2016-04-06

    Thanks Fabian, that solved my problem.

     
  • Fabian Keil

    Fabian Keil - 2016-04-09
    • status: open --> pending
    • assigned_to: David Schmidt --> Fabian Keil
     
  • Fabian Keil

    Fabian Keil - 2016-04-09

    You're welcome. Thanks for the confirmation.

    Privoxy 3.0.25 will allow Range requests by default.

     
  • Fabian Keil

    Fabian Keil - 2016-04-09
    • status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB