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;
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;
}
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)) {
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;
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;
}
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);
/* 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 *,
/* 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 *,
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;
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,
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;
}
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;
* 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;
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__));
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,
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__));
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,
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__));
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);