Re: restructuring/rewriting parts of networking code
| From: | Andi Gutmans | Date: | Wed, 26 Jul 2000 16:01:01 +0000 |
| Subject: | Re: restructuring/rewriting parts of networking code | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-26329@lists.php.net to get a copy of this message | ||
At 12:35 26/07/2000 +0200, Stig Venaas wrote:
Hi I've started to look at the network related code in order to add IPv6 support. Resolver functions are used in many places, mostly gethostbyname. Shouldn't we use something that's thread safe? What resolver functions to use might also differ between platforms. What do you think about writing some wrapper functions so that code that uses gethostbyname uses a wrapper fuction. If we need to use different resolver functions we then only need to change it inside the wrappers.Sounds about right to me. Thread-safe PHP needs this and in a few months this will effect most PHP users who move to Apache 2.0.
I think something similar could be done for socket stuff. Couldn't for instance fopen and the ftp functions use the fsockopen stuff?Didn't look at it right now, but just from my memory there is quite a bit of duplication in some of this code and it could definitely be improved. But we need to be very careful not to break anything.
What do you think? I'm ready to start, I plan change things in small steps so that you stop me if I'm doing something stupid. If I start writing wrappers, where should I put it? A new file in main or ext/standard?The right place for such wrappers would be main/. Maybe you should layout the wrappers before you start implementing them and mention what you would touch in the code before you start working? This would allow us to give you some feedback. Andi --- Andi Gutmans <andi@zend.com> http://www.zend.com/