summaryrefslogtreecommitdiff
path: root/source4/wrepl_server/wrepl_in_connection.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-03-05 18:30:10 +0100
committerStefan Metzmacher <metze@samba.org>2010-03-07 17:12:39 +0100
commitae049c49df88fcbcce490cd81361912e67775b12 (patch)
treecdbe230d15a26f4be777bef79dbf278e358b0335 /source4/wrepl_server/wrepl_in_connection.c
parentacd3a2729e02d765e31166c3211c3f3fcc3c6252 (diff)
downloadsamba-ae049c49df88fcbcce490cd81361912e67775b12.tar.gz
samba-ae049c49df88fcbcce490cd81361912e67775b12.tar.bz2
samba-ae049c49df88fcbcce490cd81361912e67775b12.zip
s4:libcli/wrepl: rewrite the low level request handling to use tevent_queue and tstream_context
metze
Diffstat (limited to 'source4/wrepl_server/wrepl_in_connection.c')
-rw-r--r--source4/wrepl_server/wrepl_in_connection.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/source4/wrepl_server/wrepl_in_connection.c b/source4/wrepl_server/wrepl_in_connection.c
index 6b60dd178f..ff0bb6c53d 100644
--- a/source4/wrepl_server/wrepl_in_connection.c
+++ b/source4/wrepl_server/wrepl_in_connection.c
@@ -349,7 +349,8 @@ static const struct stream_server_ops wreplsrv_stream_ops = {
called when we get a new connection
*/
NTSTATUS wreplsrv_in_connection_merge(struct wreplsrv_partner *partner,
- struct socket_context *sock,
+ uint32_t peer_assoc_ctx,
+ struct tstream_context **stream,
struct wreplsrv_in_connection **_wrepl_in)
{
struct wreplsrv_service *service = partner->service;
@@ -358,7 +359,6 @@ NTSTATUS wreplsrv_in_connection_merge(struct wreplsrv_partner *partner,
struct stream_connection *conn;
struct tevent_req *subreq;
NTSTATUS status;
- int rc;
/* within the wrepl task we want to be a single process, so
ask for the single process model ops and pass these to the
@@ -374,11 +374,12 @@ NTSTATUS wreplsrv_in_connection_merge(struct wreplsrv_partner *partner,
wrepl_in->service = service;
wrepl_in->partner = partner;
+ wrepl_in->tstream = talloc_move(wrepl_in, stream);
+ wrepl_in->assoc_ctx.peer_ctx = peer_assoc_ctx;
status = stream_new_connection_merge(service->task->event_ctx,
service->task->lp_ctx,
model_ops,
- sock,
&wreplsrv_stream_ops,
service->task->msg_ctx,
wrepl_in,
@@ -399,17 +400,6 @@ NTSTATUS wreplsrv_in_connection_merge(struct wreplsrv_partner *partner,
return NT_STATUS_NO_MEMORY;
}
- TALLOC_FREE(conn->event.fde);
-
- rc = tstream_bsd_existing_socket(wrepl_in,
- socket_get_fd(sock),
- &wrepl_in->tstream);
- if (rc < 0) {
- stream_terminate_connection(conn,
- "wreplsrv_in_connection_merge: out of memory");
- return NT_STATUS_NO_MEMORY;
- }
-
/*
* The wrepl pdu's has the length as 4 byte (initial_read_size),
* packet_full_request_u32 provides the pdu length then.