summaryrefslogtreecommitdiff
path: root/source4/lib/stream
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-11-14 02:45:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:46:16 -0500
commit763d862fee5c8d73088e93da0c5a2857eb77afc3 (patch)
treed76057dfe74906d8b47e8fe949f5c49c0b4dfaaa /source4/lib/stream
parentcbb7a47cf269dd741ae43be22cc27bf9035ac59e (diff)
downloadsamba-763d862fee5c8d73088e93da0c5a2857eb77afc3.tar.gz
samba-763d862fee5c8d73088e93da0c5a2857eb77afc3.tar.bz2
samba-763d862fee5c8d73088e93da0c5a2857eb77afc3.zip
r11712: avoid changing the fde flags unless really needed
(This used to be commit 48e6424b0cce38f7d8f212d1e891ff8bbd5fec34)
Diffstat (limited to 'source4/lib/stream')
-rw-r--r--source4/lib/stream/packet.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source4/lib/stream/packet.c b/source4/lib/stream/packet.c
index 14933ff963..23db44ef02 100644
--- a/source4/lib/stream/packet.c
+++ b/source4/lib/stream/packet.c
@@ -43,7 +43,7 @@ struct packet_context {
void *private;
struct fd_event *fde;
BOOL serialise;
- BOOL processing;
+ int processing;
BOOL recv_disable;
BOOL nofree;
@@ -209,6 +209,8 @@ void packet_recv(struct packet_context *pc)
DATA_BLOB blob;
if (pc->processing) {
+ EVENT_FD_NOT_READABLE(pc->fde);
+ pc->processing++;
return;
}
@@ -329,15 +331,16 @@ next_partial:
pc->packet_size = 0;
if (pc->serialise) {
- EVENT_FD_NOT_READABLE(pc->fde);
- pc->processing = True;
+ pc->processing = 1;
}
status = pc->callback(pc->private, blob);
- if (pc->serialise) {
- EVENT_FD_READABLE(pc->fde);
- pc->processing = False;
+ if (pc->processing) {
+ if (pc->processing > 1) {
+ EVENT_FD_READABLE(pc->fde);
+ }
+ pc->processing = 0;
}
if (!NT_STATUS_IS_OK(status)) {