Tests about a simple python3 fastcgi runner using libfcgi and the Python-C API.
python
c
wsgi
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.

conf.h 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (C) 2019 Weber Yann
  3. *
  4. * This file is part of PyFCGI.
  5. *
  6. * PyFCGI is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * any later version.
  10. *
  11. * PyFCGI is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Affero General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Affero General Public License
  17. * along with PyFCGI. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef __CONF_H___
  20. #define __CONF_H___
  21. #include "config.h"
  22. /**@defgroup conf_internal PYFCGI configuration handling
  23. */
  24. /**@defgroup conf_glob PYFCGI global (for all process) configurations
  25. * @see struct_pyfcgi_conf_s
  26. * @ingroup conf_internal */
  27. #include "logger.h"
  28. /**@defgroup ret_status Function & process return status
  29. */
  30. #define PYFCGI_ERR 16
  31. /**@ingroup ret_status */
  32. #define PYFCGI_WORKER_FAIL 32
  33. /**@ingroup ret_status */
  34. #define PYFCGI_MASTER_FAIL 64
  35. /**@ingroup ret_status */
  36. #define PYFCGI_FATAL 128
  37. /**@brief Friendly name for @ref struct pyfcgi_conf_s
  38. * @see struct pyfcgi_conf_s */
  39. typedef struct pyfcgi_conf_s pyfcgi_conf_t;
  40. typedef struct pyfcgi_conf_logger_s pyfcgi_conf_logger_t;
  41. typedef struct pyfcgi_context_s pyfcgi_context_t;
  42. struct pyfcgi_context_s {
  43. pid_t pid;
  44. pid_t ppid;
  45. };
  46. /**@brief Structure containing configuration
  47. * @ingroup conf_internal
  48. * The structure is used for the global @ref pyfcgi_conf variable.
  49. * @see pyfcgi_conf_t
  50. */
  51. struct pyfcgi_conf_s
  52. {
  53. /**@brief Entrypoint module name
  54. * @ingroup conf_glob */
  55. char *py_entrymod;
  56. /**@brief Entrypoint function name
  57. * @ingroup conf_glob */
  58. char *py_entryfun;
  59. /**@brief Minimum count worker in pool
  60. * @ingroup conf_glob */
  61. int min_wrk;
  62. /**@brief Maximum count workers in pool
  63. * @ingroup conf_glob */
  64. int max_wrk;
  65. /**@brief Maximum request before a worker restarts (0 for no restart)
  66. * @ingroup conf_glob */
  67. int max_reqs;
  68. /**@brief Logger configuration
  69. * @ingroupe conf_glob */
  70. pyfcgi_conf_logger_t logs;
  71. /**@brief Context informations */
  72. pyfcgi_context_t context;
  73. };
  74. /**@brief Configuration globals, inherited from parent to childs */
  75. pyfcgi_conf_t PyFCGI_conf;
  76. #endif