Add support for the no_proxy environment variable.

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

grim
pidgin/pidgin
release-2.x.y
PIDGIN-17518
b8e9f8db234a
pidgin
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.

  • 9
  • 0
  • 0
  • 0
  • 9
Description From Last Updated
Why is this not const also? QuLogic QuLogic
I think this is too lax. It needs to check that the suffix starts the string, or is just before ... QuLogic QuLogic
What should you do if port is an invalid port number? QuLogic QuLogic
hostname can never be NULL; it's assigned from items[i] two lines above, which can never be NULL due to the ... QuLogic QuLogic
entry can never be NULL. QuLogic QuLogic
Not really an error? QuLogic QuLogic
Not really an error? QuLogic QuLogic
On which port? I guess 6667 from the examples. QuLogic QuLogic
Set no_proxy_entries = NULL? QuLogic QuLogic
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.

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

    Set no_proxy_entries = NULL?

  11. 
      
Loading...