aboutsummaryrefslogtreecommitdiff
path: root/lib/multi.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-03-14 22:22:22 +0100
committerDaniel Stenberg <daniel@haxx.se>2011-03-14 22:22:22 +0100
commit8831000bc07de463d277975a3ddfb6a31dcf14b4 (patch)
tree0313bc919a3ee27021c352e9efad38ad8c62407e /lib/multi.c
parented8749e308a9ed0da49ad46b8b2ba5e8aae80244 (diff)
protocol handler: added flags field
The protocol handler struct got a 'flags' field for special information and characteristics of the given protocol. This now enables us to move away central protocol information such as CLOSEACTION and DUALCHANNEL from single defines in a central place, out to each protocol's definition. It also made us stop abusing the protocol field for other info than the protocol, and we could start cleaning up other protocol-specific things by adding flags bits to set in the handler struct. The "protocol" field connectdata struct was removed as well and the code now refers directly to the conn->handler->protocol field instead. To make things work properly, the code now always store a conn->given pointer that points out the original handler struct so that the code can learn details from the original protocol even if conn->handler is modified along the way - for example when switching to go over a HTTP proxy.
Diffstat (limited to 'lib/multi.c')
-rw-r--r--lib/multi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/multi.c b/lib/multi.c
index d68c368f3..8172d061d 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1476,7 +1476,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
* a protocol which uses two "channels" like FTP, as then the error
* happened in the data connection.
*/
- if(!(easy->easy_conn->protocol & PROT_DUALCHANNEL))
+ if(!(easy->easy_conn->handler->flags & PROTOPT_DUAL))
easy->easy_conn->bits.close = TRUE;
Curl_posttransfer(data);
@@ -1768,7 +1768,7 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle)
/* go over all connections that have close actions */
for(i=0; i< multi->connc->num; i++) {
if(multi->connc->connects[i] &&
- multi->connc->connects[i]->protocol & PROT_CLOSEACTION) {
+ multi->connc->connects[i]->handler->flags & PROTOPT_CLOSEACTION) {
Curl_disconnect(multi->connc->connects[i], /* dead_connection */ FALSE);
multi->connc->connects[i] = NULL;
}
@@ -2129,7 +2129,7 @@ static CURLMcode multi_socket(struct Curl_multi *multi,
data = conn->recv_pipe->head->ptr;
}
- if(conn && !(conn->handler->protocol & PROT_LOCKEDBITS))
+ if(conn && !(conn->handler->flags & PROTOPT_DIRLOCK))
/* set socket event bitmask if they're not locked */
conn->cselect_bits = ev_bitmask;
@@ -2137,7 +2137,7 @@ static CURLMcode multi_socket(struct Curl_multi *multi,
result = multi_runsingle(multi, now, data->set.one_easy);
while (CURLM_CALL_MULTI_PERFORM == result);
- if(conn && !(conn->handler->protocol & PROT_LOCKEDBITS))
+ if(conn && !(conn->handler->flags & PROTOPT_DIRLOCK))
/* clear the bitmask only if not locked */
conn->cselect_bits = 0;
@@ -2682,7 +2682,7 @@ static void multi_connc_remove_handle(struct Curl_multi *multi,
for nice connection closures".
*/
- if(conn->protocol & PROT_CLOSEACTION) {
+ if(conn->handler->flags & PROTOPT_CLOSEACTION) {
/* this handle is still being used by a shared connection and
thus we leave it around for now */
if(add_closure(multi, data) == CURLM_OK)