/library/server/fcgi/implementation/fake/fcgi_imp.e

http://github.com/jocelyn/EiffelWebReloaded · Specman e · 104 lines · 70 code · 19 blank · 15 comment · 5 complexity · 3530e66d7ed016a317e322402f091c7f MD5 · raw file

  1. note
  2. description: "Implementation for the FCGI_I interface"
  3. legal: "See notice at end of class."
  4. status: "See notice at end of class."
  5. date: "$Date$"
  6. revision: "$Revision$"
  7. class FCGI_IMP
  8. inherit
  9. FCGI_I
  10. feature -- Access
  11. environ: POINTER
  12. -- Get the (char**) environ variable from the DLL.
  13. external
  14. "C inline use %"fcgi_stdio.h%""
  15. alias
  16. "return (char**) environ;"
  17. end
  18. feature -- FCGI connection
  19. fcgi_listen: INTEGER
  20. -- Listen to the FCGI input stream
  21. -- Return 0 for successful calls, -1 otherwise.
  22. do
  23. -- Set state on first call to prevent looping indefinitely
  24. if fcgi_has_run then
  25. Result := -1
  26. else --if not is_interactive then
  27. fcgi_has_run := True
  28. end
  29. end
  30. fcgi_has_run: BOOLEAN
  31. -- For emulation only; Has fcgi_listen been called?
  32. fcgi_finish
  33. -- Finish current request from HTTP server started from
  34. -- the most recent call to `fcgi_accept'.
  35. do
  36. end
  37. set_fcgi_exit_status (v: INTEGER)
  38. do
  39. end
  40. feature -- FCGI output
  41. put_string (a_str: STRING)
  42. -- Put `a_str' on the FastCGI stdout.
  43. do
  44. io.put_string (a_str)
  45. end
  46. -- fcgi_printf (fmt: STRING; args: FINITE[ANY])
  47. -- -- Put args, formatted per 'fmt' on the FastCGI stdout.
  48. -- do
  49. -- apf.printf (fmt, args)
  50. -- end
  51. feature -- FCGI Input
  52. read_from_stdin (n: INTEGER)
  53. -- Read up to n bytes from stdin and store in input buffer
  54. do
  55. end
  56. copy_from_stdin (n: INTEGER; tf: FILE)
  57. -- Read up to n bytes from stdin and write to given file
  58. do
  59. end
  60. feature -- Status
  61. buffer_contents: STRING
  62. do
  63. if attached private_input_buffer as buf then
  64. Result := buf
  65. else
  66. Result := ""
  67. end
  68. end
  69. buffer_capacity: INTEGER
  70. do
  71. if attached private_input_buffer as bug then
  72. Result := buf.capacity
  73. end
  74. end
  75. note
  76. copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
  77. license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
  78. source: "[
  79. Eiffel Software
  80. 5949 Hollister Ave., Goleta, CA 93117 USA
  81. Telephone 805-685-1006, Fax 805-685-6869
  82. Website http://www.eiffel.com
  83. Customer support http://support.eiffel.com
  84. ]"
  85. end