r1520: only call write handler or read handler, not both. This copes with the
authorAndrew Tridgell <tridge@samba.org>
Thu, 15 Jul 2004 10:16:40 +0000 (10:16 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:57:39 +0000 (12:57 -0500)
connection being removed between calls.
(This used to be commit 446306f054b27e903c50e1d96d23041e3a8e5705)

source4/smbd/service.c

index c90792e45259af4c3d6fa7ba7017875aa9932cf1..270eeb4f222f8da849fc7e25395dbf471b3a8210 100644 (file)
@@ -249,7 +249,9 @@ void server_destroy_connection(struct server_connection *srv_conn)
        close(srv_conn->event.fde->fd);
 
        event_remove_fd(srv_conn->event.ctx, srv_conn->event.fde);
+       srv_conn->event.fde = NULL;
        event_remove_timed(srv_conn->event.ctx, srv_conn->event.idle);
+       srv_conn->event.idle = NULL;
 
        talloc_destroy(srv_conn->mem_ctx);
 }
@@ -262,6 +264,7 @@ void server_io_handler(struct event_context *ev, struct fd_event *fde, time_t t,
 
        if (flags & EVENT_FD_WRITE) {
                conn->service->ops->send_handler(conn, t, flags);
+               return;
        }
 
        if (flags & EVENT_FD_READ) {