summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/kdc/kdc.c3
-rw-r--r--source4/ldap_server/ldap_server.c3
-rw-r--r--source4/lib/stream/packet.c16
-rw-r--r--source4/lib/stream/packet.h3
-rw-r--r--source4/libcli/ldap/ldap_client.c3
-rw-r--r--source4/libcli/raw/clitransport.c3
-rw-r--r--source4/libcli/smb2/transport.c3
-rw-r--r--source4/librpc/rpc/dcerpc_sock.c3
-rw-r--r--source4/smb_server/smb_server.c3
9 files changed, 28 insertions, 12 deletions
diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c
index e633b5baa7..4e7865b5f9 100644
--- a/source4/kdc/kdc.c
+++ b/source4/kdc/kdc.c
@@ -360,7 +360,8 @@ static void kdc_tcp_accept(struct stream_connection *conn)
packet_set_full_request(kdcconn->packet, packet_full_request_u32);
packet_set_error_handler(kdcconn->packet, kdc_tcp_recv_error);
packet_set_event_context(kdcconn->packet, conn->event.ctx);
- packet_set_serialise(kdcconn->packet, conn->event.fde);
+ packet_set_fde(kdcconn->packet, conn->event.fde);
+ packet_set_serialise(kdcconn->packet);
}
static const struct stream_server_ops kdc_tcp_stream_ops = {
diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c
index 3465c8ad86..b74bec0b1b 100644
--- a/source4/ldap_server/ldap_server.c
+++ b/source4/ldap_server/ldap_server.c
@@ -319,7 +319,8 @@ static void ldapsrv_accept(struct stream_connection *c)
packet_set_full_request(conn->packet, ldapsrv_complete_packet);
packet_set_error_handler(conn->packet, ldapsrv_error_handler);
packet_set_event_context(conn->packet, c->event.ctx);
- packet_set_serialise(conn->packet, c->event.fde);
+ packet_set_fde(conn->packet, c->event.fde);
+ packet_set_serialise(conn->packet);
/* Connections start out anonymous */
if (!NT_STATUS_IS_OK(auth_anonymous_session_info(conn, &conn->session_info))) {
diff --git a/source4/lib/stream/packet.c b/source4/lib/stream/packet.c
index 23db44ef02..45ca1feb45 100644
--- a/source4/lib/stream/packet.c
+++ b/source4/lib/stream/packet.c
@@ -127,16 +127,24 @@ void packet_set_event_context(struct packet_context *pc, struct event_context *e
}
/*
- tell the packet layer to serialise requests, so we don't process two requests at once on
- one connection. You must have set the event_context
+ tell the packet layer the fde for the socket
*/
-void packet_set_serialise(struct packet_context *pc, struct fd_event *fde)
+void packet_set_fde(struct packet_context *pc, struct fd_event *fde)
{
- pc->serialise = True;
pc->fde = fde;
}
/*
+ tell the packet layer to serialise requests, so we don't process two
+ requests at once on one connection. You must have set the
+ event_context and fde
+*/
+void packet_set_serialise(struct packet_context *pc)
+{
+ pc->serialise = True;
+}
+
+/*
tell the packet layer how much to read when starting a new packet
this ensures it doesn't overread
*/
diff --git a/source4/lib/stream/packet.h b/source4/lib/stream/packet.h
index 4a8c26a809..79d4acacd0 100644
--- a/source4/lib/stream/packet.h
+++ b/source4/lib/stream/packet.h
@@ -38,7 +38,8 @@ void packet_set_full_request(struct packet_context *pc, packet_full_request_fn_t
void packet_set_tls(struct packet_context *pc, struct tls_context *tls);
void packet_set_socket(struct packet_context *pc, struct socket_context *sock);
void packet_set_event_context(struct packet_context *pc, struct event_context *ev);
-void packet_set_serialise(struct packet_context *pc, struct fd_event *fde);
+void packet_set_fde(struct packet_context *pc, struct fd_event *fde);
+void packet_set_serialise(struct packet_context *pc);
void packet_set_initial_read(struct packet_context *pc, uint32_t initial_read);
void packet_set_nofree(struct packet_context *pc);
void packet_recv(struct packet_context *pc);
diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c
index 503016e896..a5f647939f 100644
--- a/source4/libcli/ldap/ldap_client.c
+++ b/source4/libcli/ldap/ldap_client.c
@@ -398,7 +398,8 @@ static void ldap_connect_recv_conn(struct composite_context *ctx)
packet_set_full_request(conn->packet, ldap_complete_packet);
packet_set_error_handler(conn->packet, ldap_error_handler);
packet_set_event_context(conn->packet, conn->event.event_ctx);
- packet_set_serialise(conn->packet, conn->event.fde);
+ packet_set_fde(conn->packet, conn->event.fde);
+ packet_set_serialise(conn->packet);
composite_done(state->ctx);
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index fba6c36bbe..b60ea1dc02 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -121,7 +121,8 @@ struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock,
smbcli_transport_event_handler,
transport);
- packet_set_serialise(transport->packet, transport->socket->event.fde);
+ packet_set_fde(transport->packet, transport->socket->event.fde);
+ packet_set_serialise(transport->packet);
talloc_set_destructor(transport, transport_destructor);
diff --git a/source4/libcli/smb2/transport.c b/source4/libcli/smb2/transport.c
index e87c7a68c0..c6fc890e34 100644
--- a/source4/libcli/smb2/transport.c
+++ b/source4/libcli/smb2/transport.c
@@ -107,7 +107,8 @@ struct smb2_transport *smb2_transport_init(struct smbcli_socket *sock,
smb2_transport_event_handler,
transport);
- packet_set_serialise(transport->packet, transport->socket->event.fde);
+ packet_set_fde(transport->packet, transport->socket->event.fde);
+ packet_set_serialise(transport->packet);
talloc_set_destructor(transport, transport_destructor);
diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c
index 2ecf9f1530..838ddc628b 100644
--- a/source4/librpc/rpc/dcerpc_sock.c
+++ b/source4/librpc/rpc/dcerpc_sock.c
@@ -254,7 +254,8 @@ static NTSTATUS dcerpc_pipe_open_socket(struct dcerpc_connection *c,
packet_set_full_request(sock->packet, sock_complete_packet);
packet_set_error_handler(sock->packet, sock_error_handler);
packet_set_event_context(sock->packet, c->event_ctx);
- packet_set_serialise(sock->packet, sock->fde);
+ packet_set_fde(sock->packet, sock->fde);
+ packet_set_serialise(sock->packet);
packet_recv_disable(sock->packet);
packet_set_initial_read(sock->packet, 16);
diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c
index 1467beccac..8f6accb370 100644
--- a/source4/smb_server/smb_server.c
+++ b/source4/smb_server/smb_server.c
@@ -718,7 +718,8 @@ static void smbsrv_accept(struct stream_connection *conn)
packet_set_full_request(smb_conn->packet, packet_full_request_nbt);
packet_set_error_handler(smb_conn->packet, smbsrv_recv_error);
packet_set_event_context(smb_conn->packet, conn->event.ctx);
- packet_set_serialise(smb_conn->packet, conn->event.fde);
+ packet_set_fde(smb_conn->packet, conn->event.fde);
+ packet_set_serialise(smb_conn->packet);
smbsrv_vuid_init(smb_conn);