64 bit fcgi fix attempt

This commit is contained in:
Adam D. Ruppe 2012-12-20 08:37:04 -05:00
parent 6cbe5625cd
commit b6cf1009c1
1 changed files with 7 additions and 3 deletions

10
cgi.d
View File

@ -1185,7 +1185,7 @@ class Cgi {
/// Sets the location header, which the browser will redirect the user to automatically. /// Sets the location header, which the browser will redirect the user to automatically.
/// Note setResponseLocation() must be called *before* you write() any data to the output. /// Note setResponseLocation() must be called *before* you write() any data to the output.
/// The optional important argument is used if it's a default suggestion rather than something to insist upon. /// The optional important argument is used if it's a default suggestion rather than something to insist upon.
void setResponseLocation(string uri, bool important = true) { void setResponseLocation(string uri, bool important = true, string status = null) {
if(!important && isCurrentResponseLocationImportant) if(!important && isCurrentResponseLocationImportant)
return; // important redirects always override unimportant ones return; // important redirects always override unimportant ones
@ -1197,7 +1197,11 @@ class Cgi {
} }
assert(!outputtedResponseData); assert(!outputtedResponseData);
responseStatus = "302 Found"; if(status is null)
responseStatus = "302 Found";
else
responseStatus = status;
responseLocation = uri.strip; responseLocation = uri.strip;
isCurrentResponseLocationImportant = important; isCurrentResponseLocationImportant = important;
} }
@ -2296,7 +2300,7 @@ version(fastcgi) {
c_int FCGX_Accept(FCGX_Stream** stdin, FCGX_Stream** stdout, FCGX_Stream** stderr, FCGX_ParamArray* envp); c_int FCGX_Accept(FCGX_Stream** stdin, FCGX_Stream** stdout, FCGX_Stream** stderr, FCGX_ParamArray* envp);
c_int FCGX_GetChar(FCGX_Stream* stream); c_int FCGX_GetChar(FCGX_Stream* stream);
c_int FCGX_PutStr(const ubyte* str, c_int n, FCGX_Stream* stream); c_int FCGX_PutStr(const ubyte* str, c_int n, FCGX_Stream* stream);
c_int FCGX_HasSeenEOF(FCGX_Stream* stream); int FCGX_HasSeenEOF(FCGX_Stream* stream);
c_int FCGX_FFlush(FCGX_Stream *stream); c_int FCGX_FFlush(FCGX_Stream *stream);
} }
} }