ID:               36152
 Updated by:       [EMAIL PROTECTED]
-Summary:          threaded version of php has problems with curl+ssl &&
                   pgsql+ss at the same time
 Reported By:      misiek at dione dot ids dot pl
 Status:           Assigned
 Bug Type:         cURL related
 Operating System: *
 PHP Version:      5CVS, 4CVS (2006-01-25) (snap)
 Assigned To:      mike
 New Comment:

Well, the problem apparently is, that PHP links with lots of libraries
using openssl and even openssl itself.

Some libs like libcurl leave it up to you to define crypto locking
callbacks while obviously libraries like libpq define their own if we
don't.

We'd need openssl crypto locking callbacks for all PHP once and adjust
extensions, which link libraries that would define their own callbacks,
accordingly.

This is just my best bet.




Previous Comments:
------------------------------------------------------------------------

[2006-01-25 11:21:39] misiek at dione dot ids dot pl

There are PQregisterThreadLock() and PQinitSSL() in libpq which allow
to move initialization from libpq to application.

------------------------------------------------------------------------

[2006-01-25 11:16:28] [EMAIL PROTECTED]

>curl tries to initialize openssl and then to setup own callbacks.
>pgsql via libpq does the same thing.
"curl" here means ext/curl, while ext/pgsql doesn't set its handlers,
libpq does that.
So personally I don't see a way to handle it, if an *external* library
changes callbacks that were set in PHP extension.
I guess the library should be fixed first.

------------------------------------------------------------------------

[2006-01-25 11:11:01] misiek at dione dot ids dot pl

This is how I see it. It's not problem in curl module. It's problem
with callback handling in entire php. openssl allows only single
callback function for entire application. curl and pgsql are just two
things that happen to trigger the problem.

Now curl tries to initialize openssl and then to setup own callbacks.
pgsql via libpq does the same thing. It again initializes already
initialized openssl and setupts own callbacks again.

Every next module which uses openssl callbacks will be problematic
unless initialization and callback handling will be done in upper layer
(php itself) once for all modules. Maybe other solution (like
initializing only once in first module) would also work...

------------------------------------------------------------------------

[2006-01-25 10:55:59] [EMAIL PROTECTED]

Mike. this is related to your patch for #33760.
Please take a look.

------------------------------------------------------------------------

[2006-01-25 10:55:49] [EMAIL PROTECTED]

See also bug #33760


------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/36152

-- 
Edit this bug report at http://bugs.php.net/?id=36152&edit=1

Reply via email to