svn commit: samba r23735 - in branches: SAMBA_3_0/source/smbd
SAMBA_3_0_25/source/smbd SAMBA_3_0_26/source/smbd
jra at samba.org
jra at samba.org
Fri Jul 6 21:46:44 GMT 2007
Author: jra
Date: 2007-07-06 21:46:43 +0000 (Fri, 06 Jul 2007)
New Revision: 23735
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23735
Log:
Second part of the bugfix for #4763
This should coalesce identical adjacent notify records - making the "too large"
bug very rare indeed. Please test.
Jeremy.
Modified:
branches/SAMBA_3_0/source/smbd/notify.c
branches/SAMBA_3_0_25/source/smbd/notify.c
branches/SAMBA_3_0_26/source/smbd/notify.c
Changeset:
Modified: branches/SAMBA_3_0/source/smbd/notify.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/notify.c 2007-07-06 19:45:01 UTC (rev 23734)
+++ branches/SAMBA_3_0/source/smbd/notify.c 2007-07-06 21:46:43 UTC (rev 23735)
@@ -50,6 +50,17 @@
uint16 mid;
};
+static BOOL notify_change_record_identical(struct notify_change *c1,
+ struct notify_change *c2)
+{
+ /* Note this is deliberately case sensitive. */
+ if (c1->action == c2->action &&
+ strcmp(c1->name, c2->name) == 0) {
+ return True;
+ }
+ return False;
+}
+
static BOOL notify_marshall_changes(int num_changes,
struct notify_change *changes,
prs_struct *ps)
@@ -58,11 +69,20 @@
UNISTR uni_name;
for (i=0; i<num_changes; i++) {
- struct notify_change *c = &changes[i];
+ struct notify_change *c;
size_t namelen;
uint32 u32_tmp; /* Temp arg to prs_uint32 to avoid
* signed/unsigned issues */
+ /* Coalesce any identical records. */
+ while (i+1 < num_changes &&
+ notify_change_record_identical(&changes[i],
+ &changes[i+1])) {
+ i++;
+ }
+
+ c = &changes[i];
+
namelen = convert_string_allocate(
NULL, CH_UNIX, CH_UTF16LE, c->name, strlen(c->name)+1,
&uni_name.buffer, True);
Modified: branches/SAMBA_3_0_25/source/smbd/notify.c
===================================================================
--- branches/SAMBA_3_0_25/source/smbd/notify.c 2007-07-06 19:45:01 UTC (rev 23734)
+++ branches/SAMBA_3_0_25/source/smbd/notify.c 2007-07-06 21:46:43 UTC (rev 23735)
@@ -50,6 +50,17 @@
uint16 mid;
};
+static BOOL notify_change_record_identical(struct notify_change *c1,
+ struct notify_change *c2)
+{
+ /* Note this is deliberately case sensitive. */
+ if (c1->action == c2->action &&
+ strcmp(c1->name, c2->name) == 0) {
+ return True;
+ }
+ return False;
+}
+
static BOOL notify_marshall_changes(int num_changes,
struct notify_change *changes,
prs_struct *ps)
@@ -58,11 +69,20 @@
UNISTR uni_name;
for (i=0; i<num_changes; i++) {
- struct notify_change *c = &changes[i];
+ struct notify_change *c;
size_t namelen;
uint32 u32_tmp; /* Temp arg to prs_uint32 to avoid
* signed/unsigned issues */
+ /* Coalesce any identical records. */
+ while (i+1 < num_changes &&
+ notify_change_record_identical(&changes[i],
+ &changes[i+1])) {
+ i++;
+ }
+
+ c = &changes[i];
+
namelen = convert_string_allocate(
NULL, CH_UNIX, CH_UTF16LE, c->name, strlen(c->name)+1,
&uni_name.buffer, True);
Modified: branches/SAMBA_3_0_26/source/smbd/notify.c
===================================================================
--- branches/SAMBA_3_0_26/source/smbd/notify.c 2007-07-06 19:45:01 UTC (rev 23734)
+++ branches/SAMBA_3_0_26/source/smbd/notify.c 2007-07-06 21:46:43 UTC (rev 23735)
@@ -50,6 +50,17 @@
uint16 mid;
};
+static BOOL notify_change_record_identical(struct notify_change *c1,
+ struct notify_change *c2)
+{
+ /* Note this is deliberately case sensitive. */
+ if (c1->action == c2->action &&
+ strcmp(c1->name, c2->name) == 0) {
+ return True;
+ }
+ return False;
+}
+
static BOOL notify_marshall_changes(int num_changes,
struct notify_change *changes,
prs_struct *ps)
@@ -58,11 +69,20 @@
UNISTR uni_name;
for (i=0; i<num_changes; i++) {
- struct notify_change *c = &changes[i];
+ struct notify_change *c;
size_t namelen;
uint32 u32_tmp; /* Temp arg to prs_uint32 to avoid
* signed/unsigned issues */
+ /* Coalesce any identical records. */
+ while (i+1 < num_changes &&
+ notify_change_record_identical(&changes[i],
+ &changes[i+1])) {
+ i++;
+ }
+
+ c = &changes[i];
+
namelen = convert_string_allocate(
NULL, CH_UNIX, CH_UTF16LE, c->name, strlen(c->name)+1,
&uni_name.buffer, True);
More information about the samba-cvs
mailing list