diff --git a/source4/lib/http/http.c b/source4/lib/http/http.c index 53aed246324..2d1f635d380 100644 --- a/source4/lib/http/http.c +++ b/source4/lib/http/http.c @@ -559,7 +559,7 @@ static int http_read_response_next_vector(struct tstream_context *stream, static void http_read_response_done(struct tevent_req *); struct tevent_req *http_read_response_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct tstream_context *stream, + struct http_conn *http_conn, size_t max_content_length) { struct tevent_req *req; @@ -569,7 +569,7 @@ struct tevent_req *http_read_response_send(TALLOC_CTX *mem_ctx, DEBUG(11, ("%s: Reading HTTP response\n", __func__)); /* Sanity checks */ - if (!ev || !stream) { + if (ev == NULL || http_conn == NULL) { DEBUG(0, ("%s: Invalid parameter\n", __func__)); return NULL; } @@ -587,7 +587,7 @@ struct tevent_req *http_read_response_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } - subreq = tstream_readv_pdu_send(state, ev, stream, + subreq = tstream_readv_pdu_send(state, ev, http_conn->tstreams.active, http_read_response_next_vector, state); if (tevent_req_nomem(subreq,req)) { @@ -776,8 +776,7 @@ struct http_send_request_state { static void http_send_request_done(struct tevent_req *); struct tevent_req *http_send_request_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct tstream_context *stream, - struct tevent_queue *send_queue, + struct http_conn *http_conn, struct http_request *request) { struct tevent_req *req; @@ -788,7 +787,7 @@ struct tevent_req *http_send_request_send(TALLOC_CTX *mem_ctx, DEBUG(11, ("%s: Sending HTTP request\n", __func__)); /* Sanity checks */ - if (!ev || !stream || !send_queue || !request) { + if (ev == NULL || request == NULL || http_conn == NULL) { DEBUG(0, ("%s: Invalid parameter\n", __func__)); return NULL; } @@ -824,7 +823,10 @@ struct tevent_req *http_send_request_send(TALLOC_CTX *mem_ctx, state->iov.iov_base = (char *) state->buffer.data; state->iov.iov_len = state->buffer.length; - subreq = tstream_writev_queue_send(state, ev, stream, send_queue, + subreq = tstream_writev_queue_send(state, + ev, + http_conn->tstreams.active, + http_conn->send_queue, &state->iov, 1); if (tevent_req_nomem(subreq, req)) { return tevent_req_post(req, ev); diff --git a/source4/lib/http/http.h b/source4/lib/http/http.h index 25055c91007..f2196031f03 100644 --- a/source4/lib/http/http.h +++ b/source4/lib/http/http.h @@ -118,15 +118,14 @@ struct tstream_context *http_conn_tstream(struct http_conn *http_conn); /* HTTP request */ struct tevent_req *http_send_request_send(TALLOC_CTX *, struct tevent_context *, - struct tstream_context *, - struct tevent_queue *, + struct http_conn *, struct http_request *); NTSTATUS http_send_request_recv(struct tevent_req *); /* HTTP response */ struct tevent_req *http_read_response_send(TALLOC_CTX *, struct tevent_context *, - struct tstream_context *, + struct http_conn *, size_t max_content_length); NTSTATUS http_read_response_recv(struct tevent_req *, TALLOC_CTX *, @@ -135,8 +134,7 @@ NTSTATUS http_read_response_recv(struct tevent_req *, /* HTTP authenticated request */ struct tevent_req *http_send_auth_request_send(TALLOC_CTX *, struct tevent_context *, - struct tstream_context *, - struct tevent_queue *, + struct http_conn *, const struct http_request *, struct cli_credentials *, struct loadparm_context *, diff --git a/source4/lib/http/http_auth.c b/source4/lib/http/http_auth.c index f561c496853..ece660584f6 100644 --- a/source4/lib/http/http_auth.c +++ b/source4/lib/http/http_auth.c @@ -85,8 +85,7 @@ static NTSTATUS http_parse_auth_response(const DATA_BLOB prefix, struct http_auth_state { struct tevent_context *ev; - struct tstream_context *stream; - struct tevent_queue *send_queue; + struct http_conn *http_conn; enum http_auth_method auth; DATA_BLOB prefix; @@ -106,8 +105,7 @@ static void http_send_auth_request_http_rep_done(struct tevent_req *subreq); struct tevent_req *http_send_auth_request_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct tstream_context *stream, - struct tevent_queue *send_queue, + struct http_conn *http_conn, const struct http_request *original_request, struct cli_credentials *credentials, struct loadparm_context *lp_ctx, @@ -126,8 +124,7 @@ struct tevent_req *http_send_auth_request_send(TALLOC_CTX *mem_ctx, return NULL; } state->ev = ev; - state->stream = stream; - state->send_queue = send_queue; + state->http_conn = http_conn; state->auth = auth; state->original_request = original_request; @@ -264,8 +261,7 @@ static void http_send_auth_request_gensec_done(struct tevent_req *subreq) } subreq = http_send_request_send(state, state->ev, - state->stream, - state->send_queue, + state->http_conn, state->next_request); if (tevent_req_nomem(subreq, req)) { return; @@ -312,7 +308,7 @@ static void http_send_auth_request_http_req_done(struct tevent_req *subreq) * from the socket, but for now we just ignore the bytes. */ subreq = http_read_response_send(state, state->ev, - state->stream, + state->http_conn, UINT16_MAX); if (tevent_req_nomem(subreq, req)) { return; diff --git a/source4/librpc/rpc/dcerpc_roh_channel_in.c b/source4/librpc/rpc/dcerpc_roh_channel_in.c index 3f971962753..cc53c2a7f41 100644 --- a/source4/librpc/rpc/dcerpc_roh_channel_in.c +++ b/source4/librpc/rpc/dcerpc_roh_channel_in.c @@ -162,8 +162,6 @@ struct tevent_req *roh_send_RPC_DATA_IN_send(TALLOC_CTX *mem_ctx, const char *path; char *query; char *uri; - struct tstream_context *stream = NULL; - struct tevent_queue *send_queue = NULL; DEBUG(8, ("%s: Sending RPC_IN_DATA request\n", __func__)); @@ -221,13 +219,9 @@ struct tevent_req *roh_send_RPC_DATA_IN_send(TALLOC_CTX *mem_ctx, http_add_header(state, &state->request->headers, "Pragma", "no-cache"); - stream = http_conn_tstream(roh->default_channel_in->http_conn); - send_queue = http_conn_send_queue(roh->default_channel_in->http_conn); - subreq = http_send_auth_request_send(state, ev, - stream, - send_queue, + roh->default_channel_in->http_conn, state->request, credentials, lp_ctx, diff --git a/source4/librpc/rpc/dcerpc_roh_channel_out.c b/source4/librpc/rpc/dcerpc_roh_channel_out.c index 3bd28b0fa12..491bbadfa69 100644 --- a/source4/librpc/rpc/dcerpc_roh_channel_out.c +++ b/source4/librpc/rpc/dcerpc_roh_channel_out.c @@ -162,8 +162,6 @@ struct tevent_req *roh_send_RPC_DATA_OUT_send(TALLOC_CTX *mem_ctx, const char *path; char *query; char *uri; - struct tstream_context *stream = NULL; - struct tevent_queue *send_queue = NULL; DEBUG(8, ("%s: Sending RPC_OUT_DATA request\n", __func__)); @@ -221,13 +219,9 @@ struct tevent_req *roh_send_RPC_DATA_OUT_send(TALLOC_CTX *mem_ctx, http_add_header(state, &state->request->headers, "Pragma", "no-cache"); - stream = http_conn_tstream(roh->default_channel_out->http_conn); - send_queue = http_conn_send_queue(roh->default_channel_out->http_conn); - subreq = http_send_auth_request_send(state, ev, - stream, - send_queue, + roh->default_channel_out->http_conn, state->request, credentials, lp_ctx, @@ -412,7 +406,6 @@ struct tevent_req *roh_recv_out_channel_response_send(TALLOC_CTX *mem_ctx, struct tevent_req *req; struct tevent_req *subreq; struct roh_recv_response_state *state; - struct tstream_context *stream = NULL; DEBUG(8, ("%s: Waiting for RPC_OUT_DATA response\n", __func__)); @@ -421,10 +414,8 @@ struct tevent_req *roh_recv_out_channel_response_send(TALLOC_CTX *mem_ctx, return NULL; } - stream = http_conn_tstream(roh->default_channel_out->http_conn); - subreq = http_read_response_send(state, ev, - stream, + roh->default_channel_out->http_conn, 0); /* we'll get the content later */ if (tevent_req_nomem(subreq, req)) { return tevent_req_post(req, ev);