Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: dev

[PATCH] Support for multiple IP in Sources

 

 

Cherokee dev RSS feed   Index | Next | Previous | View Threaded


aperez at skarcha

Oct 4, 2011, 3:22 PM

Post #1 of 2 (140 views)
Permalink
[PATCH] Support for multiple IP in Sources

Hello guys!,

Here I am again with a new patch... O:)

The idea comes because of this[1] error building (thanks Jędrzej). One
Test fail because the "php-cgi" process is listening to "127.0.0.1"
and the cherokee server for tests is configured to connect to
"localhost:1980":

============= conf.py================
PHP_FCGI_PORT = 1980
===================================

========== run-tests.py================
source!%(next_source)d!host = localhost:%(PHP_FCGI_PORT)d

if 'fpm' in php_interpreter:
CONF_BASE += "source!%(next_source)d!interpreter =
%(php_interpreter)s -d listen=%(PHP_FCGI_PORT)d -d
daemonize=Off\n"%(locals())
else:
CONF_BASE += "source!%(next_source)d!interpreter =
%(php_interpreter)s -b %(PHP_FCGI_PORT)d\n" %(locals())
===================================

Also, that host has defined two IPs for "localhost": "127.0.0.1" and "::1"

What's the problem? Cherokee launch the PHP interpreter listening to
"127.0.0.1" BUT it resolves "localhost" as "::1", so the result is
"Connection refused".

The attached patch is to make Cherokee to try all the IPs that
resolves the domain name, in this case: "localhost".

More likely is that Álvaro will find a better aproach, but well, here
is the result of my work debugging and looking for a solution.

I hope you understand my English, and please, comment... Thanks! :-)


[1] http://build.cherokee-project.com/builders/main/builds/7/steps/test/logs/stdio

--
Saludos:
Antonio Pérez
Attachments: sources-multi-ip.patch (1.46 KB)


alvaro at octality

Oct 5, 2011, 6:16 AM

Post #2 of 2 (141 views)
Permalink
Re: [PATCH] Support for multiple IP in Sources [In reply to]

Hello there!

2011/10/4 Antonio Prez <aperez [at] skarcha>

>
> The attached patch is to make Cherokee to try all the IPs that
> resolves the domain name, in this case: "localhost".
>
> More likely is that lvaro will find a better aproach, but well, here
> is the result of my work debugging and looking for a solution.
>

The idea behind the patch is very good. Good stuff!!

Having said that, I'm afraid we cannot apply the patch as it is right now.
Basically, the "static" variable works well for a single source, but it
would mess things up when using more than one. Bear in mind that it'd be
shared among different sources.

Luckily, the fix is quite straightforward. If we added that variable to the
cherokee_source_t structure, we would get the code to work almost in the
same way, while we ensure that the code is re-entrant.

--
Greetings, alo
http://www.octality.com/

Cherokee dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.