summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-06-22 18:01:45 -0400
committerStefan Metzmacher <metze@samba.org>2010-12-15 15:26:05 +0100
commite55426fe7926ae6f8afe5fa6cfc009e0c3b54e38 (patch)
tree8e9f3fe35f41ebc96b008fe59bc3b9a60d72f1d7 /source3/rpc_client
parent07ba35adcbb9feb551125034f091e8d4cb4aa0e8 (diff)
downloadsamba-e55426fe7926ae6f8afe5fa6cfc009e0c3b54e38.tar.gz
samba-e55426fe7926ae6f8afe5fa6cfc009e0c3b54e38.tar.bz2
samba-e55426fe7926ae6f8afe5fa6cfc009e0c3b54e38.zip
s3:rpc_client: let rpc_transport_tstream_init() create read and write queue
metze
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/rpc_transport_tstream.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/source3/rpc_client/rpc_transport_tstream.c b/source3/rpc_client/rpc_transport_tstream.c
index c62540cb3f..e05498b1a2 100644
--- a/source3/rpc_client/rpc_transport_tstream.c
+++ b/source3/rpc_client/rpc_transport_tstream.c
@@ -316,17 +316,13 @@ static NTSTATUS rpc_tstream_write_recv(struct tevent_req *req, ssize_t *sent)
*
* @param mem_ctx - memory context used to allocate the transport
* @param stream - a ready to use tstream
-* @param read_queue - pre-createted tstream read queue
-* @param write_queue - pre-createted tstream write queue
* @param presult - the transport structure
*
* @return - a NT Status error code.
*/
NTSTATUS rpc_transport_tstream_init(TALLOC_CTX *mem_ctx,
- struct tstream_context *stream,
- struct tevent_queue *read_queue,
- struct tevent_queue *write_queue,
- struct rpc_cli_transport **presult)
+ struct tstream_context **stream,
+ struct rpc_cli_transport **presult)
{
struct rpc_cli_transport *result;
struct rpc_tstream_state *state;
@@ -342,9 +338,18 @@ NTSTATUS rpc_transport_tstream_init(TALLOC_CTX *mem_ctx,
}
result->priv = state;
- state->stream = talloc_steal(state, stream);
- state->read_queue = talloc_steal(state, read_queue);
- state->write_queue = talloc_steal(state, write_queue);
+ state->read_queue = tevent_queue_create(state, "read_queue");
+ if (state->read_queue == NULL) {
+ TALLOC_FREE(result);
+ return NT_STATUS_NO_MEMORY;
+ }
+ state->write_queue = tevent_queue_create(state, "write_queue");
+ if (state->write_queue == NULL) {
+ TALLOC_FREE(result);
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ state->stream = talloc_move(state, stream);
state->timeout = 10000; /* 10 seconds. */
result->trans_send = NULL;