connection_call_handlers.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. This file is part of libmicrohttpd
  3. Copyright (C) 2007-2018 Daniel Pittman and Christian Grothoff
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  15. */
  16. /**
  17. * @file lib/connection_call_handlers.h
  18. * @brief function to call event handlers based on event mask
  19. * @author Christian Grothoff
  20. */
  21. #ifndef CONNECTION_CALL_HANDLERS_H
  22. #define CONNECTION_CALL_HANDLERS_H
  23. /**
  24. * Call the handlers for a connection in the appropriate order based
  25. * on the readiness as detected by the event loop.
  26. *
  27. * @param con connection to handle
  28. * @param read_ready set if the socket is ready for reading
  29. * @param write_ready set if the socket is ready for writing
  30. * @param force_close set if a hard error was detected on the socket;
  31. * if this information is not available, simply pass #MHD_NO
  32. * @return #MHD_YES to continue normally,
  33. * #MHD_NO if a serious error was encountered and the
  34. * connection is to be closed.
  35. */
  36. int
  37. MHD_connection_call_handlers_ (struct MHD_Connection *con,
  38. bool read_ready,
  39. bool write_ready,
  40. bool force_close)
  41. MHD_NONNULL (1);
  42. /**
  43. * This function was created to handle per-request processing that
  44. * has to happen even if the socket cannot be read or written to.
  45. * @remark To be called only from thread that process request's
  46. * recv(), send() and response.
  47. *
  48. * @param request the request to handle
  49. * @return true if we should continue to process the
  50. * request (not dead yet), false if it died
  51. */
  52. bool
  53. MHD_request_handle_idle_ (struct MHD_Request *request)
  54. MHD_NONNULL (1);
  55. #endif