projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge branch 'v2.6.x'
[m6w6/ext-http]
/
src
/
php_http_client_curl.c
diff --git
a/src/php_http_client_curl.c
b/src/php_http_client_curl.c
index be1783252a5a98a6fe843c0af8095f8d1cf52f61..be04be89296d47728cc8aa63571d7675eca35c63 100644
(file)
--- a/
src/php_http_client_curl.c
+++ b/
src/php_http_client_curl.c
@@
-215,6
+215,7
@@
static int php_http_curle_seek_callback(void *userdata, curl_off_t offset, int o
static int php_http_curle_raw_callback(CURL *ch, curl_infotype type, char *data, size_t length, void *ctx)
{
php_http_client_curl_handler_t *h = ctx;
static int php_http_curle_raw_callback(CURL *ch, curl_infotype type, char *data, size_t length, void *ctx)
{
php_http_client_curl_handler_t *h = ctx;
+ unsigned utype = PHP_HTTP_CLIENT_DEBUG_INFO;
/* catch progress */
switch (type) {
/* catch progress */
switch (type) {
@@
-258,20
+259,43
@@
static int php_http_curle_raw_callback(CURL *ch, curl_infotype type, char *data,
h->client->callback.progress.func(h->client->callback.progress.arg, h->client, &h->queue, &h->progress);
}
break;
h->client->callback.progress.func(h->client->callback.progress.arg, h->client, &h->queue, &h->progress);
}
break;
+
case CURLINFO_HEADER_OUT:
case CURLINFO_HEADER_OUT:
- case CURLINFO_DATA_OUT:
+ utype |= PHP_HTTP_CLIENT_DEBUG_HEADER;
+ goto data_out;
+
case CURLINFO_SSL_DATA_OUT:
case CURLINFO_SSL_DATA_OUT:
+ utype |= PHP_HTTP_CLIENT_DEBUG_SSL;
+ goto data_out;
+
+ case CURLINFO_DATA_OUT:
+ data_out:
+ utype |= PHP_HTTP_CLIENT_DEBUG_OUT;
h->progress.info = "send";
break;
h->progress.info = "send";
break;
+
case CURLINFO_HEADER_IN:
case CURLINFO_HEADER_IN:
- case CURLINFO_DATA_IN:
+ utype |= PHP_HTTP_CLIENT_DEBUG_HEADER;
+ goto data_in;
+
case CURLINFO_SSL_DATA_IN:
case CURLINFO_SSL_DATA_IN:
+ utype |= PHP_HTTP_CLIENT_DEBUG_SSL;
+ goto data_in;
+
+ case CURLINFO_DATA_IN:
+ data_in:
+ utype |= PHP_HTTP_CLIENT_DEBUG_IN;
h->progress.info = "receive";
break;
h->progress.info = "receive";
break;
+
default:
break;
}
default:
break;
}
+ if (h->client->callback.debug.func) {
+ h->client->callback.debug.func(h->client->callback.debug.arg, h->client, &h->queue, utype, data, length);
+ }
+
#if 0
/* debug */
_dpf(type, data, length);
#if 0
/* debug */
_dpf(type, data, length);
@@
-2056,6
+2080,7
@@
static void php_http_client_curl_dtor(php_http_client_t *h)
if (curl->ev_ops) {
curl->ev_ops->dtor(&curl->ev_ctx);
if (curl->ev_ops) {
curl->ev_ops->dtor(&curl->ev_ctx);
+ curl->ev_ops = NULL;
}
curl->unfinished = 0;
}
curl->unfinished = 0;