summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-01-08 18:02:51 +0100
committerGünther Deschner <gd@samba.org>2009-01-08 19:37:29 +0100
commitc0f1309010b79be67557af5ffbd1c429a3f3d99a (patch)
treefe2feab19d106f53a016192b1422944fb5f4e15d
parentc07ea13d3077f73ad6cb28e9689b120bca6eac74 (diff)
downloadsamba-c0f1309010b79be67557af5ffbd1c429a3f3d99a.tar.gz
samba-c0f1309010b79be67557af5ffbd1c429a3f3d99a.tar.bz2
samba-c0f1309010b79be67557af5ffbd1c429a3f3d99a.zip
s3-eventlog: trying to avoid to pass around full ndr structures in rpc_server.
Jerry, please check. Guenther
-rw-r--r--source3/rpc_server/srv_eventlog_nt.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/source3/rpc_server/srv_eventlog_nt.c b/source3/rpc_server/srv_eventlog_nt.c
index d12b490d21..35853c2990 100644
--- a/source3/rpc_server/srv_eventlog_nt.c
+++ b/source3/rpc_server/srv_eventlog_nt.c
@@ -581,15 +581,17 @@ static Eventlog_entry *read_package_entry( TALLOC_CTX *mem_ctx,
/********************************************************************
********************************************************************/
-static bool add_record_to_resp( EVENTLOG_R_READ_EVENTLOG * r_u,
+static bool add_record_to_resp( Eventlog_entry *entry,
+ uint32_t *num_records,
+ uint32_t *num_bytes_in_resp,
Eventlog_entry * ee_new )
{
Eventlog_entry *insert_point;
- insert_point = r_u->entry;
+ insert_point = entry;
if ( NULL == insert_point ) {
- r_u->entry = ee_new;
+ entry = ee_new;
ee_new->next = NULL;
} else {
while ( ( NULL != insert_point->next ) ) {
@@ -598,8 +600,8 @@ static bool add_record_to_resp( EVENTLOG_R_READ_EVENTLOG * r_u,
ee_new->next = NULL;
insert_point->next = ee_new;
}
- r_u->num_records++;
- r_u->num_bytes_in_resp += ee_new->record.length;
+ (*num_records)++;
+ *num_bytes_in_resp += ee_new->record.length;
return True;
}
@@ -780,7 +782,10 @@ NTSTATUS _eventlog_read_eventlog( pipes_struct * p,
break;
}
- add_record_to_resp( r_u, ee_new );
+ add_record_to_resp( r_u->entry,
+ &r_u->num_records, &r_u->num_bytes_in_resp,
+ ee_new );
+
bytes_left -= ee_new->record.length;
TALLOC_FREE(entry);
num_records_read = r_u->num_records - num_records_read;