svn commit: samba r15084 - in branches/SAMBA_3_0/source: lib
nsswitch smbd
jra at samba.org
jra at samba.org
Fri Apr 14 03:55:43 GMT 2006
Author: jra
Date: 2006-04-14 03:55:42 +0000 (Fri, 14 Apr 2006)
New Revision: 15084
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15084
Log:
Try and squeeze more out of the non-read/write code path.
Jeremy.
Modified:
branches/SAMBA_3_0/source/lib/events.c
branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c
branches/SAMBA_3_0/source/smbd/process.c
Changeset:
Modified: branches/SAMBA_3_0/source/lib/events.c
===================================================================
--- branches/SAMBA_3_0/source/lib/events.c 2006-04-13 22:22:54 UTC (rev 15083)
+++ branches/SAMBA_3_0/source/lib/events.c 2006-04-14 03:55:42 UTC (rev 15084)
@@ -103,16 +103,12 @@
return;
}
-struct timeval *get_timed_events_timeout(struct timeval *to_ret, time_t default_to)
+struct timeval *get_timed_events_timeout(struct timeval *to_ret)
{
struct timeval now;
if (timed_events == NULL) {
- if (default_to == (time_t)-1) {
- return NULL;
- }
- *to_ret = timeval_set(default_to, 0);
- return to_ret;
+ return NULL;
}
now = timeval_current();
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c 2006-04-13 22:22:54 UTC (rev 15083)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c 2006-04-14 03:55:42 UTC (rev 15084)
@@ -684,9 +684,10 @@
GetTimeOfDay(&now);
- tp = get_timed_events_timeout(&t, (time_t)-1);
+ tp = get_timed_events_timeout(&t);
if (tp) {
- DEBUG(11,("select will use timeout of %d seconds\n", (int)tp->tv_sec));
+ DEBUG(11,("select will use timeout of %u.%u seconds\n",
+ (unsigned int)tp->tv_sec, (unsigned int)tp->tv_usec ));
}
/* Handle messages */
Modified: branches/SAMBA_3_0/source/smbd/process.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/process.c 2006-04-13 22:22:54 UTC (rev 15083)
+++ branches/SAMBA_3_0/source/smbd/process.c 2006-04-14 03:55:42 UTC (rev 15084)
@@ -357,7 +357,7 @@
{
fd_set fds;
int selrtn;
- struct timeval to = timeval_set(SMBD_SELECT_TIMEOUT, 0);
+ struct timeval to;
int maxfd = 0;
smb_read_error = 0;
@@ -367,6 +367,9 @@
if (timeout >= 0) {
to.tv_sec = timeout / 1000;
to.tv_usec = (timeout % 1000) * 1000;
+ } else {
+ to.tv_sec = SMBD_SELECT_TIMEOUT;
+ to.tv_usec = 0;
}
/*
@@ -441,14 +444,20 @@
goto again;
}
+ /*
+ * Are there any timed events waiting ? If so, ensure we don't
+ * select for longer than it would take to wait for them.
+ */
+
{
struct timeval tmp;
- struct timeval *tp = get_timed_events_timeout(&tmp,SMBD_SELECT_TIMEOUT);
+ struct timeval *tp = get_timed_events_timeout(&tmp);
if (tp) {
to = timeval_min(&to, tp);
if (timeval_is_zero(&to)) {
- return True;
+ /* Process a timed event now... */
+ run_events();
}
}
}
More information about the samba-cvs
mailing list