#include "__jet.h" #include "Exception.h" #include namespace jet { __jet::__jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { if(variableDefined("cgi")) resolveKeyword("cgi"); if(variables["cgi"] == "true") { coreutils::ZString requestMethod(getenv("REQUEST_METHOD")); if(requestMethod == "POST") { coreutils::ZString contentLength(getenv("CONTENT_LENGTH")); coreutils::ZString contentType(getenv("CONTENT_TYPE")); coreutils::MString postdata; postdata.read(0); std::cout << postdata << std::endl; coreutils::IMFRequest request(postdata); coreutils::IMFMessage message(postdata); if(contentType == "multipart/form-data") std::cout << "output multipart variables to global" << std::endl; else if(contentType == "application/x-www-form-urlencoded") std::cout << "output urlencoded variables to global" << std::endl; } } try { processContainer(container); } catch(coreutils::Exception e) { std::cout << container.parsed() << std::endl; std::cout << "***** " << e.text << std::endl; std::cout << container.unparsed() << std::endl; throw e; } } }