1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

r11713: separate out the setting of the fde in the packet context from the

enabling of packet serialisation
This commit is contained in:
Andrew Tridgell 2005-11-14 03:45:57 +00:00 committed by Gerald (Jerry) Carter
parent 48e6424b0c
commit 6a47cd65a8
9 changed files with 28 additions and 12 deletions

View File

@ -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 = {

View File

@ -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))) {

View File

@ -127,13 +127,21 @@ 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->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;
pc->fde = fde;
}
/*

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);