Add support for the no_proxy environment variable.

Review Request #667 — Created May 25, 2021 and submitted

Information

pidgin/pidgin
release-2.x.y
e5ac6a37a937

Reviewers

This started as a patch on https://issues.imfreedom.org/issue/PIDGIN-17518
but I cleaned it up a bit as well.

Followed the unit tests that are documented in the diff.

Description From Last Updated

Why is this not const also?

QuLogicQuLogic

I think this is too lax. It needs to check that the suffix starts the string, or is just before …

QuLogicQuLogic

What should you do if port is an invalid port number?

QuLogicQuLogic

hostname can never be NULL; it's assigned from items[i] two lines above, which can never be NULL due to the …

QuLogicQuLogic

entry can never be NULL.

QuLogicQuLogic

Not really an error?

QuLogicQuLogic

Not really an error?

QuLogicQuLogic

On which port? I guess 6667 from the examples.

QuLogicQuLogic

Set no_proxy_entries = NULL?

QuLogicQuLogic
rekkanoryo
  1. Ship It!
  2. 
      
QuLogic
  1. 
      
  2. libpurple/proxy.c (Diff revision 1)
     
     

    Why is this not const also?

  3. libpurple/proxy.c (Diff revision 1)
     
     

    I think this is too lax. It needs to check that the suffix starts the string, or is just before a ..

    Right now, if you have no_proxy=node.net, that will match freenode.net, and I don't think that's what's wanted?

    1. Right, I forget this kind of problem. I think if(purple_strequal(connection->hostname, entry->hostname) || (g_str_has_suffix(connection->hostname, entry->hostname) && connection->hostname[strlen(connection->hostname) - strlen(entry->hostname) - 1] == '.')) { should be fine?

  4. libpurple/proxy.c (Diff revision 1)
     
     

    What should you do if port is an invalid port number?

    1. We compare this port with connection's port, and if this port is an invalid port number, it should never equals and will connect with proxy, this is what we want, so it's just fine.

  5. libpurple/proxy.c (Diff revision 1)
     
     

    hostname can never be NULL; it's assigned from items[i] two lines above, which can never be NULL due to the loop condition.

  6. libpurple/proxy.c (Diff revision 1)
     
     

    entry can never be NULL.

  7. libpurple/proxy.c (Diff revision 1)
     
     

    Not really an error?

    1. Yes, not an error I think.

  8. libpurple/proxy.c (Diff revision 1)
     
     

    Not really an error?

    1. Yes, not an error I think.

  9. libpurple/proxy.c (Diff revision 1)
     
     

    On which port? I guess 6667 from the examples.

    1. 6667 as following.

  10. libpurple/proxy.c (Diff revision 1)
     
     

    Set no_proxy_entries = NULL?

  11. 
      
grim
QuLogic
  1. Ship It!
  2. 
      
grim
grim
grim
Review request changed

Status: Closed (submitted)

Loading...