Fixed various issues with libfcgi on Linux, mainly related to stdout,stderr,stdin, feof and related.

Added `reset' to the libfcgi input stream so that it is possible to reset previous errors.
This commit is contained in:
2013-12-03 10:45:52 +01:00
parent 4f15745647
commit 07ec0d001f
8 changed files with 116 additions and 28 deletions

View File

@@ -68,10 +68,28 @@ feature {FCGI_IMP} -- Internal
feof (v: POINTER): INTEGER
-- FCGI_feof()
-- 0 means EOF not detected.
external
"C inline use %"fcgi_stdio.h%""
alias
"FCGI_feof"
"return FCGI_feof($v);"
end
ferror (v: POINTER): INTEGER
-- FCGI_ferror()
-- 0 means no error.
external
"C inline use %"fcgi_stdio.h%""
alias
"return FCGI_ferror($v);"
end
clearerr (v: POINTER)
-- FCGI_clearerr().
external
"C inline use %"fcgi_stdio.h%""
alias
"FCGI_clearerr($v)"
end
feature {NONE} -- Input
@@ -108,27 +126,27 @@ feature -- Error
feature -- Access
stdout: POINTER
-- FCGI_stdout() return pointer on output FCGI_FILE
-- FCGI_stdout return pointer on output FCGI_FILE
external
"C inline use %"fcgi_stdio.h%""
alias
"FCGI_stdout"
"return FCGI_stdout;"
end
stdin: POINTER
-- FCGI_stdin() return pointer on input FCGI_FILE
-- FCGI_stdin return pointer on input FCGI_FILE
external
"C inline use %"fcgi_stdio.h%""
alias
"FCGI_stdin"
"return FCGI_stdin;"
end
stderr: POINTER
-- FCGI_stderr() return pointer on error FCGI_FILE
-- FCGI_stderr return pointer on error FCGI_FILE
external
"C inline use %"fcgi_stdio.h%""
alias
"FCGI_stderr"
"return FCGI_stderr;"
end
note

View File

@@ -32,7 +32,12 @@ feature -- Access
fcgi_end_of_input: BOOLEAN
do
Result := fcgi.feof (fcgi.stdin) = 0
Result := fcgi.feof (fcgi.stdin) /= 0 --| in fact, True if feof (..) = EOF
end
fcgi_clearerr
do
fcgi.clearerr (fcgi.stdin)
end
feature -- FCGI Connection
@@ -52,7 +57,7 @@ feature -- FCGI Connection
eif_environ = (char**) environ;
]"
end
fcgi_finish
-- Finish current request from HTTP server started from
-- the most recent call to `fcgi_accept'.
@@ -175,7 +180,7 @@ feature -- I/O Routines
--RFO end
note
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
copyright: "Copyright (c) 1984-2013, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software