Maybe there needs to be a flag in ns_write and friends to indicate that something has been written to the connection. If not, send out a 500 before closing the connection.
To me, this seems like a general error condition not specific to filters. I imagine (but don't know for a fact) that there are other unusual error cases that may cause AS to close a connection with nothing being sent. Jim > > >> Yes. I am arguing that the server should always return a 500 if it > >> reaches > >> the end of a connection with no other results. I don't know the > >> technical > >> feasibility of this but it does not seem like correct behavior to return > >> nothing to the user. > > > I think the problem is that a filter can return a complete response on its > own, possibly using ns_write rather than ns_return. If it does do, and > then fails (I have some filters that do some housekeeping after returning > the request to the visitor), then the server might erroneously issue a 500 > response after a perfectly well-formed (and possibly non-error, despite > the failure of the filter) response. My opinion is that the behavior of > the filters is reasonable; perhaps a better solution would be to enhance > the documentation to point out that this is a common error. > > It might be better to prevent the possibility of this from occurring, but > then I think we'd have to restrict some of the functionality of filters. > > You can accomplish a lot of what filters do with composition, so it may be > that filters aren't the most appropriate choice of mechanism for this > feature of your application. > > Pete. >