From fdfa2adcb1f6771c1c2d45dd65f48b299d2b712b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 11 Jan 2005 02:18:42 +0000 Subject: 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) --- source4/smbd/service.c | 5 ++++- source4/smbd/service.h | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'source4/smbd') diff --git a/source4/smbd/service.c b/source4/smbd/service.c index d55f1ab0d4c..fac0e175a15 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 5bb43a74fa5..20bf6e9b8fd 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 */ -- cgit