Some cgi work.
This commit is contained in:
parent
adf5449a6f
commit
80d31540d9
11
__jet.cpp
11
__jet.cpp
@ -7,13 +7,14 @@
|
|||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__jet::__jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, this) {
|
__jet::__jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, this) {
|
||||||
|
char *cookies;
|
||||||
if(keywordDefined("cgi") && (resolveKeyword("cgi") == "true")) {
|
if(keywordDefined("cgi") && (resolveKeyword("cgi") == "true")) {
|
||||||
global.cgi = true;
|
global.cgi = true;
|
||||||
char *cookies = getenv("HTTP_COOKIE");
|
|
||||||
if(cookies)
|
|
||||||
std::cout << cookies << std::endl;
|
|
||||||
|
|
||||||
if(keywordDefined("sessiondir")) {
|
if(keywordDefined("sessiondir")) {
|
||||||
|
coreutils::ZString cookies = getenv("HTTP_COOKIE");
|
||||||
|
storeVariable("cookies", cookies, "global");
|
||||||
|
|
||||||
global.session = true;
|
global.session = true;
|
||||||
// if request_has_cookie then
|
// if request_has_cookie then
|
||||||
// pull sessionfile from sessiondir.
|
// pull sessionfile from sessiondir.
|
||||||
@ -31,7 +32,7 @@ namespace jet {
|
|||||||
hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7], hash[8], hash[9],
|
hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7], hash[8], hash[9],
|
||||||
hash[10], hash[11], hash[12], hash[13], hash[14], hash[15], hash[16], hash[17], hash[18], hash[19]);
|
hash[10], hash[11], hash[12], hash[13], hash[14], hash[15], hash[16], hash[17], hash[18], hash[19]);
|
||||||
coreutils::ZString sessionCookie(hashname);
|
coreutils::ZString sessionCookie(hashname);
|
||||||
global.headers[keywords["Set-Cookie"]] << "session=" << sessionCookie;
|
global.headers["Set-Cookie"] << "session=" << sessionCookie;
|
||||||
if(keywordDefined("sessiontimeout")) {
|
if(keywordDefined("sessiontimeout")) {
|
||||||
time_t timeout = time(0) + keywords["sessiontimeout"].asInteger();
|
time_t timeout = time(0) + keywords["sessiontimeout"].asInteger();
|
||||||
}
|
}
|
||||||
@ -44,8 +45,6 @@ namespace jet {
|
|||||||
if(requestMethod == "POST") {
|
if(requestMethod == "POST") {
|
||||||
coreutils::ZString contentLength(getenv("CONTENT_LENGTH"));
|
coreutils::ZString contentLength(getenv("CONTENT_LENGTH"));
|
||||||
coreutils::ZString contentType(getenv("CONTENT_TYPE"));
|
coreutils::ZString contentType(getenv("CONTENT_TYPE"));
|
||||||
|
|
||||||
std::ofstream outFile("/tmp/output.txt");
|
|
||||||
|
|
||||||
coreutils::MString postdata;
|
coreutils::MString postdata;
|
||||||
postdata.read(0); // TODO: Need to limit the read characters to the CONTENT-LENGTH value;
|
postdata.read(0); // TODO: Need to limit the read characters to the CONTENT-LENGTH value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user