projects
/
m6w6
/
ext-http
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
0fa008b
)
- bad pointer arithmetics
author
Michael Wallner
<mike@php.net>
Fri, 21 Oct 2005 11:28:54 +0000
(11:28 +0000)
committer
Michael Wallner
<mike@php.net>
Fri, 21 Oct 2005 11:28:54 +0000
(11:28 +0000)
http_request_api.c
patch
|
blob
|
history
diff --git
a/http_request_api.c
b/http_request_api.c
index 9cfa1bdaf65c8ae4872b0b280a5859eec40a8c80..857bc6706b8afc27f0a6451012accbaf4d708d61 100644
(file)
--- a/
http_request_api.c
+++ b/
http_request_api.c
@@
-40,9
+40,7
@@
#include <curl/curl.h>
#include <curl/curl.h>
-/*
- * cruft for thread safe SSL crypto locks
- */
+/* {{{ cruft for thread safe SSL crypto locks */
#if defined(ZTS) && defined(HTTP_HAVE_SSL)
# ifdef PHP_WIN32
# define HTTP_NEED_SSL_TSL
#if defined(ZTS) && defined(HTTP_HAVE_SSL)
# ifdef PHP_WIN32
# define HTTP_NEED_SSL_TSL
@@
-79,6
+77,7
@@
# endif /* HTTP_HAVE_OPENSSL || HTTP_HAVE_GNUTLS */
# endif /* PHP_WIN32 */
#endif /* ZTS && HTTP_HAVE_SSL */
# endif /* HTTP_HAVE_OPENSSL || HTTP_HAVE_GNUTLS */
# endif /* PHP_WIN32 */
#endif /* ZTS && HTTP_HAVE_SSL */
+/* }}} */
ZEND_EXTERN_MODULE_GLOBALS(http);
ZEND_EXTERN_MODULE_GLOBALS(http);
@@
-899,15
+898,15
@@
static inline zval *_http_curl_getopt_ex(HashTable *options, char *key, size_t k
/* }}} */
#ifdef HTTP_NEED_OPENSSL_TSL
/* }}} */
#ifdef HTTP_NEED_OPENSSL_TSL
-
-static MUTEX_T *http_
ssl_mutex
= NULL;
+/* {{{ */
+static MUTEX_T *http_
openssl_tsl
= NULL;
static void http_ssl_lock(int mode, int n, const char * file, int line)
{
if (mode & CRYPTO_LOCK) {
static void http_ssl_lock(int mode, int n, const char * file, int line)
{
if (mode & CRYPTO_LOCK) {
- tsrm_mutex_lock(http_
ssl_mutex
[n]);
+ tsrm_mutex_lock(http_
openssl_tsl
[n]);
} else {
} else {
- tsrm_mutex_unlock(http_
ssl_mutex
[n]);
+ tsrm_mutex_unlock(http_
openssl_tsl
[n]);
}
}
}
}
@@
-920,10
+919,10
@@
static inline void http_ssl_init(void)
{
int i, c = CRYPTO_num_locks();
{
int i, c = CRYPTO_num_locks();
- http_
ssl_mutex
= malloc(c * sizeof(MUTEX_T));
+ http_
openssl_tsl
= malloc(c * sizeof(MUTEX_T));
for (i = 0; i < c; ++i) {
for (i = 0; i < c; ++i) {
- http_
ssl_mutex
[i] = tsrm_mutex_alloc();
+ http_
openssl_tsl
[i] = tsrm_mutex_alloc();
}
CRYPTO_set_id_callback(http_ssl_id);
}
CRYPTO_set_id_callback(http_ssl_id);
@@
-932,27
+931,28
@@
static inline void http_ssl_init(void)
static inline void http_ssl_cleanup(void)
{
static inline void http_ssl_cleanup(void)
{
- if (http_
ssl_mutex
) {
+ if (http_
openssl_tsl
) {
int i, c = CRYPTO_num_locks();
CRYPTO_set_id_callback(NULL);
CRYPTO_set_locking_callback(NULL);
for (i = 0; i < c; ++i) {
int i, c = CRYPTO_num_locks();
CRYPTO_set_id_callback(NULL);
CRYPTO_set_locking_callback(NULL);
for (i = 0; i < c; ++i) {
- tsrm_mutex_free(http_
ssl_mutex
[i]);
+ tsrm_mutex_free(http_
openssl_tsl
[i]);
}
}
- free(http_
ssl_mutex
);
- http_
ssl_mutex
= NULL;
+ free(http_
openssl_tsl
);
+ http_
openssl_tsl
= NULL;
}
}
#endif /* HTTP_NEED_OPENSSL_TSL */
}
}
#endif /* HTTP_NEED_OPENSSL_TSL */
+/* }}} */
#ifdef HTTP_NEED_GNUTLS_TSL
#ifdef HTTP_NEED_GNUTLS_TSL
-
+/* {{{ */
static int http_ssl_mutex_create(void **m)
{
static int http_ssl_mutex_create(void **m)
{
- if (*((MUTEX_T *
*
) m) = tsrm_mutex_alloc()) {
+ if (*((MUTEX_T *) m) = tsrm_mutex_alloc()) {
return SUCCESS;
} else {
return FAILURE;
return SUCCESS;
} else {
return FAILURE;
@@
-961,21
+961,21
@@
static int http_ssl_mutex_create(void **m)
static int http_ssl_mutex_destroy(void **m)
{
static int http_ssl_mutex_destroy(void **m)
{
- tsrm_mutex_free(*((MUTEX_T *
*
) m));
+ tsrm_mutex_free(*((MUTEX_T *) m));
return SUCCESS;
}
static int http_ssl_mutex_lock(void **m)
{
return SUCCESS;
}
static int http_ssl_mutex_lock(void **m)
{
- return tsrm_mutex_lock(*((MUTEX_T *
*
) m));
+ return tsrm_mutex_lock(*((MUTEX_T *) m));
}
static int http_ssl_mutex_unlock(void **m)
{
}
static int http_ssl_mutex_unlock(void **m)
{
- return tsrm_mutex_unlock(*((MUTEX_T *
*
) m));
+ return tsrm_mutex_unlock(*((MUTEX_T *) m));
}
}
-static struct gcry_thread_cbs http_
ssl_callbacks
= {
+static struct gcry_thread_cbs http_
gnutls_tsl
= {
GCRY_THREAD_OPTIONS_USER,
NULL,
http_ssl_mutex_create,
GCRY_THREAD_OPTIONS_USER,
NULL,
http_ssl_mutex_create,
@@
-986,16
+986,17
@@
static struct gcry_thread_cbs http_ssl_callbacks = {
static inline void http_ssl_init(void)
{
static inline void http_ssl_init(void)
{
- gcry_control(GCRYCTL_SET_THREAD_CBS, &http_
ssl_callbacks
);
+ gcry_control(GCRYCTL_SET_THREAD_CBS, &http_
gnutls_tsl
);
}
static inline void http_ssl_cleanup(void)
{
return;
}
}
static inline void http_ssl_cleanup(void)
{
return;
}
-
#endif /* HTTP_NEED_GNUTLS_TSL */
#endif /* HTTP_NEED_GNUTLS_TSL */
+/* }}} */
+/* {{{ http_curl_defaults(CURL *) */
static inline void _http_curl_defaults(CURL *ch)
{
HTTP_CURL_OPT(URL, NULL);
static inline void _http_curl_defaults(CURL *ch)
{
HTTP_CURL_OPT(URL, NULL);
@@
-1052,6
+1053,7
@@
static inline void _http_curl_defaults(CURL *ch)
HTTP_CURL_OPT(READDATA, NULL);
HTTP_CURL_OPT(INFILESIZE, 0);
}
HTTP_CURL_OPT(READDATA, NULL);
HTTP_CURL_OPT(INFILESIZE, 0);
}
+/* }}} */
#endif /* HTTP_HAVE_CURL */
#endif /* HTTP_HAVE_CURL */