libfuncs is collection of code (list, queue, circular buffer, io, logging, etc.). https://georgi.unixsol.org/programs/libfuncs/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

http_response.h 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * HTTP responses header file
  3. * Copyright (C) 2006-2009 Unix Solutions Ltd.
  4. *
  5. * Released under MIT license.
  6. * See LICENSE-MIT.txt for license terms.
  7. */
  8. #ifndef HTTP_RESPONSE_H
  9. # define HTTP_RESPONSE_H
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. void set_http_response_server_ident(char *server, char *version);
  14. void send_http_response(int clientsock, const char * response);
  15. void send_header_textplain(int clientsock);
  16. void send_http_error(int clientsock, const char *code, const char *message);
  17. void send_http_ok(int clientsock, const char *message);
  18. void send_http_ok_msg(int clientsock, const char *fmt, ...) __attribute__ ((format(printf, 2, 3)));
  19. void send_200_ok(int clientsock);
  20. void send_302_redirect(int clientsock, const char * url);
  21. void send_400_bad_request(int clientsock, const char *msg);
  22. void send_403_forbidden_msg(int clientsock, const char *msg);
  23. void send_403_forbidden(int clientsock);
  24. void send_404_not_found(int clientsock);
  25. void send_409_conflict(int clientsock, const char * msg);
  26. void send_500_internal_server_error(int clientsock, const char * msg);
  27. void send_501_not_implemented(int clientsock);
  28. void send_504_gateway_timeout(int clientsock);
  29. #ifdef __cplusplus
  30. }
  31. #endif
  32. #endif