mirror of
https://github.com/samba-team/samba.git
synced 2025-02-25 17:57:42 +03:00
r15148: make wreplsrv_pull_names static
metze (This used to be commit ce3d4ec0f67ecf7a403fb7d46ed5f6dc0b2bc275)
This commit is contained in:
parent
c53c91963a
commit
0082a4ce97
@ -1377,24 +1377,25 @@ static NTSTATUS wreplsrv_apply_one_record(struct wreplsrv_partner *partner,
|
||||
return NT_STATUS_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
NTSTATUS wreplsrv_apply_records(struct wreplsrv_partner *partner, struct wreplsrv_pull_names_io *names_io)
|
||||
NTSTATUS wreplsrv_apply_records(struct wreplsrv_partner *partner,
|
||||
struct wrepl_wins_owner *owner,
|
||||
uint32_t num_names, struct wrepl_name *names)
|
||||
{
|
||||
NTSTATUS status;
|
||||
uint32_t i;
|
||||
|
||||
DEBUG(4,("apply records count[%u]:owner[%s]:min[%llu]:max[%llu]:partner[%s]\n",
|
||||
names_io->out.num_names, names_io->in.owner.address,
|
||||
(long long)names_io->in.owner.min_version,
|
||||
(long long)names_io->in.owner.max_version,
|
||||
num_names, owner->address,
|
||||
(long long)owner->min_version,
|
||||
(long long)owner->max_version,
|
||||
partner->address));
|
||||
|
||||
for (i=0; i < names_io->out.num_names; i++) {
|
||||
for (i=0; i < num_names; i++) {
|
||||
TALLOC_CTX *tmp_mem = talloc_new(partner);
|
||||
NT_STATUS_HAVE_NO_MEMORY(tmp_mem);
|
||||
|
||||
status = wreplsrv_apply_one_record(partner, tmp_mem,
|
||||
&names_io->in.owner,
|
||||
&names_io->out.names[i]);
|
||||
owner, &names[i]);
|
||||
talloc_free(tmp_mem);
|
||||
NT_STATUS_NOT_OK_RETURN(status);
|
||||
}
|
||||
@ -1402,8 +1403,8 @@ NTSTATUS wreplsrv_apply_records(struct wreplsrv_partner *partner, struct wreplsr
|
||||
status = wreplsrv_add_table(partner->service,
|
||||
partner->service,
|
||||
&partner->service->table,
|
||||
names_io->in.owner.address,
|
||||
names_io->in.owner.max_version);
|
||||
owner->address,
|
||||
owner->max_version);
|
||||
NT_STATUS_NOT_OK_RETURN(status);
|
||||
|
||||
return NT_STATUS_OK;
|
||||
|
@ -388,6 +388,18 @@ static NTSTATUS wreplsrv_pull_table_recv(struct composite_context *c, TALLOC_CTX
|
||||
return status;
|
||||
}
|
||||
|
||||
struct wreplsrv_pull_names_io {
|
||||
struct {
|
||||
struct wreplsrv_partner *partner;
|
||||
struct wreplsrv_out_connection *wreplconn;
|
||||
struct wrepl_wins_owner owner;
|
||||
} in;
|
||||
struct {
|
||||
uint32_t num_names;
|
||||
struct wrepl_name *names;
|
||||
} out;
|
||||
};
|
||||
|
||||
enum wreplsrv_pull_names_stage {
|
||||
WREPLSRV_PULL_NAMES_STAGE_WAIT_CONNECTION,
|
||||
WREPLSRV_PULL_NAMES_STAGE_WAIT_SEND_REPLY,
|
||||
@ -479,7 +491,7 @@ static void wreplsrv_pull_names_handler_req(struct wrepl_request *req)
|
||||
return;
|
||||
}
|
||||
|
||||
struct composite_context *wreplsrv_pull_names_send(TALLOC_CTX *mem_ctx, struct wreplsrv_pull_names_io *io)
|
||||
static struct composite_context *wreplsrv_pull_names_send(TALLOC_CTX *mem_ctx, struct wreplsrv_pull_names_io *io)
|
||||
{
|
||||
struct composite_context *c = NULL;
|
||||
struct wreplsrv_service *service = io->in.partner->service;
|
||||
@ -513,8 +525,8 @@ failed:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NTSTATUS wreplsrv_pull_names_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
|
||||
struct wreplsrv_pull_names_io *io)
|
||||
static NTSTATUS wreplsrv_pull_names_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
|
||||
struct wreplsrv_pull_names_io *io)
|
||||
{
|
||||
NTSTATUS status;
|
||||
|
||||
@ -671,7 +683,10 @@ static NTSTATUS wreplsrv_pull_cycle_apply_records(struct wreplsrv_pull_cycle_sta
|
||||
{
|
||||
NTSTATUS status;
|
||||
|
||||
status = wreplsrv_apply_records(state->io->in.partner, &state->names_io);
|
||||
status = wreplsrv_apply_records(state->io->in.partner,
|
||||
&state->names_io.in.owner,
|
||||
state->names_io.out.num_names,
|
||||
state->names_io.out.names);
|
||||
NT_STATUS_NOT_OK_RETURN(status);
|
||||
|
||||
talloc_free(state->names_io.out.names);
|
||||
|
@ -20,18 +20,6 @@
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
struct wreplsrv_pull_names_io {
|
||||
struct {
|
||||
struct wreplsrv_partner *partner;
|
||||
struct wreplsrv_out_connection *wreplconn;
|
||||
struct wrepl_wins_owner owner;
|
||||
} in;
|
||||
struct {
|
||||
uint32_t num_names;
|
||||
struct wrepl_name *names;
|
||||
} out;
|
||||
};
|
||||
|
||||
struct wreplsrv_pull_cycle_io {
|
||||
struct {
|
||||
struct wreplsrv_partner *partner;
|
||||
|
@ -309,5 +309,6 @@ struct wreplsrv_service {
|
||||
};
|
||||
|
||||
struct socket_context;
|
||||
struct wrepl_name;
|
||||
#include "wrepl_server/wrepl_out_helpers.h"
|
||||
#include "wrepl_server/wrepl_server_proto.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user