diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-01-11 02:18:42 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:08:40 -0500 |
commit | fdfa2adcb1f6771c1c2d45dd65f48b299d2b712b (patch) | |
tree | 4fbf0e9bb51979c3903f2a1b8e8f830586594349 /source4 | |
parent | a36f456adf2ae7988ed265b36c2353af288263be (diff) | |
download | samba-fdfa2adcb1f6771c1c2d45dd65f48b299d2b712b.tar.gz samba-fdfa2adcb1f6771c1c2d45dd65f48b299d2b712b.tar.bz2 samba-fdfa2adcb1f6771c1c2d45dd65f48b299d2b712b.zip |
r4667: Don't follow a NULL pointer for an idle event handler.
Fix up some header comments.
Andrew Bartlett
(This used to be commit 62005a3924e2af52c7173098b0b38eca14e03609)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/smbd/service.c | 5 | ||||
-rw-r--r-- | source4/smbd/service.h | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/source4/smbd/service.c b/source4/smbd/service.c index d55f1ab0d4..fac0e175a1 100644 --- a/source4/smbd/service.c +++ b/source4/smbd/service.c @@ -294,7 +294,10 @@ void server_idle_handler(struct event_context *ev, struct timed_event *idle, conn->event.idle->next_event = timeval_sum(&t, &conn->event.idle_time); - conn->service->ops->idle_handler(conn, t); + /* Not all services provide an idle handler */ + if (conn->service->ops->idle_handler) { + conn->service->ops->idle_handler(conn, t); + } } /* return the operations structure for a named backend of the specified type diff --git a/source4/smbd/service.h b/source4/smbd/service.h index 5bb43a74fa..20bf6e9b8f 100644 --- a/source4/smbd/service.h +++ b/source4/smbd/service.h @@ -47,13 +47,11 @@ struct server_service_ops { /* function to accept new connection */ void (*accept_connection)(struct server_connection *); - /* function to accept new connection */ void (*recv_handler)(struct server_connection *, struct timeval, uint16_t); - /* function to accept new connection */ void (*send_handler)(struct server_connection *, struct timeval, uint16_t); - /* function to accept new connection */ + /* function to be called when the server is idle */ void (*idle_handler)(struct server_connection *, struct timeval); /* function to close a connection */ |