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 (from parent 1:
76d9a80
)
ensure we're talking to curl ops
author
Michael Wallner
<mike@php.net>
Mon, 30 Jul 2012 18:29:39 +0000
(18:29 +0000)
committer
Michael Wallner
<mike@php.net>
Mon, 30 Jul 2012 18:29:39 +0000
(18:29 +0000)
php_http_curl_client_datashare.c
patch
|
blob
|
history
diff --git
a/php_http_curl_client_datashare.c
b/php_http_curl_client_datashare.c
index 11856be3d36d81e255d03a98ccc45b3e768d3251..1c9cf4d7178964647b94ee7dc0d3b426e889257a 100644
(file)
--- a/
php_http_curl_client_datashare.c
+++ b/
php_http_curl_client_datashare.c
@@
-67,6
+67,11
@@
static STATUS php_http_curl_client_datashare_attach(php_http_client_datashare_t
php_http_curl_client_t *recurl = r->ctx;
TSRMLS_FETCH_FROM_CTX(h->ts);
php_http_curl_client_t *recurl = r->ctx;
TSRMLS_FETCH_FROM_CTX(h->ts);
+ if (r->ops != php_http_curl_client_get_ops()) {
+ php_http_error(HE_WARNING, PHP_HTTP_E_CLIENT_DATASHARE, "Cannot attach a non-curl client to this datashare");
+ return FAILURE;
+ }
+
if (CURLE_OK != (rc = curl_easy_setopt(recurl->handle, CURLOPT_SHARE, curl->handle))) {
php_http_error(HE_WARNING, PHP_HTTP_E_CLIENT_DATASHARE, "Could not attach request to the datashare: %s", curl_easy_strerror(rc));
return FAILURE;
if (CURLE_OK != (rc = curl_easy_setopt(recurl->handle, CURLOPT_SHARE, curl->handle))) {
php_http_error(HE_WARNING, PHP_HTTP_E_CLIENT_DATASHARE, "Could not attach request to the datashare: %s", curl_easy_strerror(rc));
return FAILURE;
@@
-81,6
+86,11
@@
static STATUS php_http_curl_client_datashare_detach(php_http_client_datashare_t
TSRMLS_FETCH_FROM_CTX(h->ts);
TSRMLS_FETCH_FROM_CTX(h->ts);
+ if (r->ops != php_http_curl_client_get_ops()) {
+ php_http_error(HE_WARNING, PHP_HTTP_E_CLIENT_DATASHARE, "Cannot attach a non-curl client to this datashare");
+ return FAILURE;
+ }
+
if (CURLE_OK != (rc = curl_easy_setopt(recurl->handle, CURLOPT_SHARE, NULL))) {
php_http_error(HE_WARNING, PHP_HTTP_E_CLIENT_DATASHARE, "Could not detach request from the datashare: %s", curl_share_strerror(rc));
return FAILURE;
if (CURLE_OK != (rc = curl_easy_setopt(recurl->handle, CURLOPT_SHARE, NULL))) {
php_http_error(HE_WARNING, PHP_HTTP_E_CLIENT_DATASHARE, "Could not detach request from the datashare: %s", curl_share_strerror(rc));
return FAILURE;