@@ -1,8 +1,8 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 - * Jonathan Schleifer + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 + * Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -60,10 +60,29 @@ * connections will still be handled and you can start accepting new * connections again by calling @ref OFHTTPServer::start again. */ - (bool)server: (OFHTTPServer*)server didReceiveExceptionOnListeningSocket: (OFException*)exception; + +/*! + * @brief This method is called when a client socket encountered an exception. + * + * This can happen when the OFHTTPServer tries to properly close the + * connection. If no headers have been sent yet, it will send headers, and if + * chunked transfer encoding was used, it will send a chunk of size 0. However, + * if the other end already closed the connection before that, this will raise + * an exception. + * + * @param server The HTTP server which encountered an exception + * @param response The response for which the exception occurred + * @param request The request for the response for which the exception occurred + * @param exception The exception which occurred + */ +- (void)server: (OFHTTPServer*)server + didReceiveExceptionForResponse: (OFHTTPResponse*)response + request: (OFHTTPRequest*)request + exception: (OFException*)exception; @end /*! * @class OFHTTPServer OFHTTPServer.h ObjFW/OFHTTPServer.h *