pipeline: switch some code over to functions

... to "compartmentalize" a bit and make it easier to change behavior
when multiplexing is used instead of good old pipelining.
This commit is contained in:
Daniel Stenberg
2015-05-13 14:24:30 +02:00
parent 7d0df07e48
commit d6f1c74330
5 changed files with 118 additions and 59 deletions

View File

@@ -2885,15 +2885,14 @@ void Curl_getoff_all_pipelines(struct SessionHandle *data,
struct connectdata *conn)
{
bool recv_head = (conn->readchannel_inuse &&
(gethandleathead(conn->recv_pipe) == data)) ? TRUE : FALSE;
Curl_recvpipe_head(data, conn));
bool send_head = (conn->writechannel_inuse &&
(gethandleathead(conn->send_pipe) == data)) ? TRUE : FALSE;
Curl_sendpipe_head(data, conn));
if(Curl_removeHandleFromPipeline(data, conn->recv_pipe) && recv_head)
conn->readchannel_inuse = FALSE;
Curl_pipeline_leave_read(conn);
if(Curl_removeHandleFromPipeline(data, conn->send_pipe) && send_head)
conn->writechannel_inuse = FALSE;
Curl_pipeline_leave_write(conn);
}
static void signalPipeClose(struct curl_llist *pipeline, bool pipe_broke)