anonymous2ch / libproxy

Automatically exported from code.google.com/p/libproxy
GNU Lesser General Public License v2.1
0 stars 0 forks source link

config file resolution not working #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create $HOME/.proxy.conf or SYSCONFDIR/proxy.conf with proper proxy
configuration
2. Disable all other possible proxy resolutions (e.g. environment variables)
3. Start some code that uses libproxy to resolve proxy

What is the expected output? What do you see instead?
Proxy is not resolved at all. With library debugging 

What version of the product are you using? On what operating system?
0.3.0, Linux

Please provide any additional information below.
There are some bugs inside src/modules/config_file.c, and I will attach
'fixed' file. Module is not properly registered, and casting of
pxConfigModule to pxFileConfigModule is faulty. I tested it, and now it
looks fine. Please evaluate, and if it suites you include it to the next
release.

Original issue reported on code.google.com by vladimir...@gmail.com on 5 Oct 2009 at 10:56

Attachments:

GoogleCodeExporter commented 9 years ago
Vladimir,

Thanks for the report. Please for future references always work on svn trunk 
and, if
possible, attach the output of "svn diff"... this makes it easier to verify 
what's
changing. I took the liberty to create this step for you this time (attachment
config_file patch is purely a diff of the file provided by vladimir to the svn 
rev
444 version)

Some comments on the patch: without testing it, it looks good to me and makes 
sense,
except:
@@ -108,7 +106,7 @@
 bool
 px_module_load(pxModuleManager *self)
 {
-       bool a = px_module_manager_register_module_with_name(self, pxConfigFile,
"config_file_system", _system_constructor, _destructor);
-       bool b = px_module_manager_register_module_with_name(self, pxConfigFile,
"config_file_user",   _user_constructor,   _destructor);
-       return (a || b);
+       bool a = px_module_manager_register_module_with_name(self, 
pxConfigModule,
"config_file_system", _system_constructor, _destructor);
+       bool b = px_module_manager_register_module_with_name(self, 
pxConfigModule,
"config_file_user",   _user_constructor,   _destructor);
+       return ( b);
 }

This would mean that the registration is 'only' valid if a user conf file is 
found,
but would fail for a system conf file /etc/proxy.conf).

I'll do some testing and will consider merging the patch, without the last 
chunlk.

Thanks for your submission.

Original comment by dominiqu...@gmail.com on 5 Oct 2009 at 3:37

Attachments:

GoogleCodeExporter commented 9 years ago
I had no time to create patch... Sorry about this.

Just a small comment... Faulty line in the patch is:

return ( b);

it should be

return (a || b);

I made this mistake during some debugging, and I forgot to remove it...
During registration module pxConfigModule should be used instead pxConfigFile.

Cheers!

Original comment by vladimir...@gmail.com on 6 Oct 2009 at 8:16

GoogleCodeExporter commented 9 years ago
Fixed in trunk

Original comment by npmccallum@gmail.com on 22 Jan 2010 at 8:43