2015-03-23 15:52 GMT+09:00 Daniel Stenberg <[email protected]>:
> I think it is better way that Curl_getconnectinfo() works for BOTH of
>> easy_perform() and multi_perform(). are you agree?
>>
>
> Yes I do.
I felt relieved for the same thought.
Curl_getconnectinfo() want to ONLY work for curl_easy_perform(). I guess
>> this is the point.
>>
>
> That's certainly the important part of it, yes. But as this is a
> documented limitation it is not really a bug - not that it matters very
> much what we call it.
>
This is difficult things.
I just pass you the patch.
If you mind, please check it.
Best regards,
thanks
===============
YAMADA Yasuharu
ACCESS CO., LTD.
[email protected]
--
.
--- connect.c.org 2015-03-23 16:39:27.218849559 +0900
+++ connect.c 2015-03-23 16:42:58.566853526 +0900
@@ -1202,15 +1202,23 @@
DEBUGASSERT(data);
- /* this only works for an easy handle that has been used for
- curl_easy_perform()! */
- if(data->state.lastconnect && data->multi_easy) {
+ /* this works for an easy handle:
+ * - that has been used for curl_easy_perform()
+ * - that is associated with a multi handle, and whose connection
+ * was detached with CURLOPT_CONNECT_ONLY
+ */
+ if(data->state.lastconnect && (data->multi_easy || data->multi)) {
struct connectdata *c = data->state.lastconnect;
struct connfind find;
find.tofind = data->state.lastconnect;
find.found = FALSE;
- Curl_conncache_foreach(data->multi_easy->conn_cache, &find, conn_is_conn);
+ if(data->multi_easy) {
+ Curl_conncache_foreach(data->multi_easy->conn_cache, &find, conn_is_conn);
+ }
+ else {
+ Curl_conncache_foreach(data->multi->conn_cache, &find, conn_is_conn);
+ }
if(!find.found) {
data->state.lastconnect = NULL;
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html