|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2016, PHP 5.6.19
+- CURL:
+ . Fixed bug #71523 (Copied handle with new option CURLOPT_HTTPHEADER crashes
+ while curl_multi_exec). (Laruence)
+
- Date:
. Fixed bug #68078 (Datetime comparisons ignore microseconds). (Willem-Jan
Zijderveld)
return 1;
}
}
- zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct curl_slist *), NULL);
+
+ if (Z_REFCOUNT_P(ch->clone) <= 1) {
+ zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct curl_slist *), NULL);
+ } else {
+ zend_hash_next_index_insert(ch->to_free->slist, &slist, sizeof(struct curl_slist *), NULL);
+ }
error = curl_easy_setopt(ch->cp, option, slist);
--- /dev/null
+--TEST--
+Bug #71523 (Copied handle with new option CURLOPT_HTTPHEADER crashes while curl_multi_exec)
+--SKIPIF--
+<?php
+if (!extension_loaded("curl")) {
+ exit("skip curl extension not loaded");
+}
+?>
+--FILE--
+<?php
+
+$base = curl_init('http://www.google.com/');
+curl_setopt($base, CURLOPT_RETURNTRANSFER, true);
+$mh = curl_multi_init();
+
+for ($i = 0; $i < 2; ++$i) {
+ $ch = curl_copy_handle($base);
+ curl_setopt($ch, CURLOPT_HTTPHEADER, ['Foo: Bar']);
+ curl_multi_add_handle($mh, $ch);
+}
+
+do {
+ curl_multi_exec($mh, $active);
+} while ($active);
+?>
+okey
+--EXPECTF--
+okey