cacheControl = CC_COOKIE;
}
+#if 0
ustring AppEnv::scriptName () {
return getenvString (kSCRIPT_FILENAME);
}
+#endif
void AppEnv::dump (std::ostream& out) {
out << arg0 << "\n";
case CC_NOCACHE:
out << " no-cache\n";
break;
+ default:;
}
switch (frameOpt) {
case FOPT_NONE:
virtual void readOption (int argc, char** argv, MotorEnv* env);
virtual void setDefault ();
- virtual ustring scriptName ();
+// virtual ustring scriptName ();
virtual void dump (std::ostream& out);
virtual void setErrorLog (const ustring& path, bool fappend = false);
};
if (e && e->isCons ()) {
while (e) {
- if (a = e->car ()) {
+ if ((a = e->car ())) {
ustring u;
if (c > 0)
u.append (uAmp);
if (e && e->isCons ()) {
while (e) {
- if (a = e->car ()) {
+ if ((a = e->car ())) {
if (c > 0)
out.append (uAmp);
out.append (percentEncode (cv (to_string (a->car ()))));
if (e && e->isCons ()) {
while (e) {
- if (a = e->car ()) {
+ if ((a = e->car ())) {
if (c > 0)
ans += uAmp.length ();
ans += percentEncode (cv (to_string (a->car ()))).length ();
e = params ();
if (e && e->isCons ()) {
while (e) {
- if (a = e->car ()) {
+ if ((a = e->car ())) {
name = to_string (a->car ());
val = to_string (a->cdr ());
ans += writeFileFormPart_text (out, name, val);
e = fileparams_store ();
if (e && e->isCons ()) {
while (e) {
- if (a = e->car ()) {
+ if ((a = e->car ())) {
name = to_string (a->car ());
val = to_string (a->cdr ());
path = mlenv->env->path_store_file (val);
e = fileparams_storage ();
if (e && e->isCons ()) {
while (e) {
- if (a = e->car ()) {
+ if ((a = e->car ())) {
name = to_string (a->car ());
val = to_string (a->cdr ());
path = mlenv->env->path_storage_file (val);
e = fileparams_static ();
if (e && e->isCons ()) {
while (e) {
- if (a = e->car ()) {
+ if ((a = e->car ())) {
name = to_string (a->car ());
val = to_string (a->cdr ());
path = mlenv->env->path_static_file (val);
int HTTPSend::readReplyHead (TcpClient& client, TcpBuf& buf) {
ustring line;
- bool rc;
uiterator b, e, m1, m2;
if (status != HTTP_QUERY)
ustring::size_type p2 = line.find (' ', p1 + 1);
responseCode = strtoul (line.substr (p1 + 1, p2));
}
- while (rc = buf.getln (client, line)) {
+ while (buf.getln (client, line)) {
if (line.empty ())
break;
// ヘッダ内の制御文字は削除されるが,ヘッダ名の大小文字は保存される。
delete sym;
sym = NULL;
break;
+ default:;
}
type = MC_DELETED;
}
mlPool->setStartTime ();
};
virtual bool qtimeup () {
- mlPool->qtimeup (log);
+ return mlPool->qtimeup (log);
};
virtual void resetProg () {
mlPool->resetProg ();
mlPool->inclIncCount ();
};
virtual bool inclIncCount_nothrow () {
- mlPool->inclIncCount_nothrow ();
+ return mlPool->inclIncCount_nothrow ();
};
virtual void declIncCount () {
mlPool->declIncCount ();
output = out;
wikioutput = NULL;
log = &std::cerr;
- setRequestEnv ();
+// setRequestEnv ();
mlPool = new MlPool;
mlFTable = new MlFTable;
mlenv = new MlEnv (mlPool, mlFTable);
errflag = false;
responseDone = false;
currentPath = NULL;
+ scriptName = getenvString (kSCRIPT_NAME);
+ documentRoot = getenvString (kDOCUMENT_ROOT);
+ scriptFilename = getenvString (kSCRIPT_FILENAME);
}
MotorEnv::~MotorEnv () {
delete mlFTable;
}
+#if 0
void MotorEnv::setRequestEnv () {
scriptName = getenvString (kSCRIPT_NAME);
}
+#endif
void MotorEnv::setErrorFlag () {
// mlenv->breakProg ();
bool MotorEnv::getErrorVar (const ustring& name) {
if (mlenv->validName (name))
return errorvar.getVar (name);
+ return false;
}
void MotorEnv::motorItem (const ustring& name) {
bool MotorEnv::path_resource (const ustring& name, ustring& ans) {
ustring r;
- ustring root = getenvString (kDOCUMENT_ROOT);
ustring top;
#ifdef cDocTop
top.assign (CharConst (cDocTop));
}
#else
- top = root;
+ top = documentRoot;
#endif
if (isAbsolutePath (name)) {
} else {
/* name is a relative path. */
if (currentPath == NULL) {
- r = getenvString (kSCRIPT_FILENAME);
+ r = scriptFilename;
} else {
r = *currentPath;
}
#ifdef DEBUG
// std::cerr << "searchName:" << r << "\n";
#endif /* DEBUG */
- if (root.length () > 0 && r.length () > 0) {
- r = root + uSlash + r + uSlash + name;
+ if (documentRoot.length () > 0 && r.length () > 0) {
+ r = documentRoot + uSlash + r + uSlash + name;
shapePath (r);
if (matchHead (r, top) && checkAbsoluteResourceName (r) && isPlainFile (r)) {
ans = r;
case CGIForm::M_NONE:
htmlFile = appenv->getHtml;
break;
+ default:;
}
errorHtmlFile = appenv->errorHtml;
mimetype = appenv->mimetype;
form->read_post (appenv->postlimit);
}
break;
+ default:;
}
}
}
void MotorEnv::doML (const ustring& file) {
ustring b;
- ustring f;
bool rc;
bool dash;
return;
if (file == uDash) {
- f = appenv->scriptName ();
- if (f.size () == 0)
+ if (scriptFilename.size () == 0)
return;
- rc = readFile (f, b);
+ rc = readFile (scriptFilename, b);
dash = true;
} else {
+ ustring f;
if (! path_resource (file, f))
return;
rc = readFile (f, b);
dash = false;
}
if (rc) {
+ ustring f;
MotorSexp ml (mlenv);
AutoBackupPtr<ustring> autoStr (¤tPath, &f);
ustring f;
if (file == uDash) {
- f = appenv->scriptName ();
- if (f.size () == 0)
+ if (scriptFilename.size () == 0)
return;
- doMotorFile (f, true, type, out);
+ doMotorFile (scriptFilename, true, type, out);
} else if (path_resource (file, f)) {
if (f.size () == 0)
return;
WikiMotorOutputString* wikioutput;
HTTPResponse http;
- ustring scriptName;
ustring datastore;
ustring htmlFile;
ustring errorHtmlFile;
bool responseDone;
std::ostream* log;
ustring* currentPath;
+ ustring scriptName;
+ ustring documentRoot;
+ ustring scriptFilename;
MotorEnv (AppEnv* ae, CGIFormFile* fm, HTMLMotor* m, MotorOutput* out);
virtual ~MotorEnv ();
- virtual void setRequestEnv ();
+// virtual void setRequestEnv ();
virtual void setErrorFlag ();
virtual void setErrorVar (const ustring& name);
virtual bool getErrorVar (const ustring& name);
} else {
outNbsp ();
}
+ return this;
}
MotorOutput* MotorOutput::outamp_c3 (const ustring& t) {
outamp (c3 (t));
+ return this;
}
/* ============================================================ */
static char hexchar (int c) {
if (0 <= c && c <= 9)
return '0' + c;
- else if (10 <= c <= 15)
+ else if (10 <= c && c <= 15)
return 'a' - 10 + c;
else
return '0';
static char hexchar_c (int c) {
if (0 <= c && c <= 9)
return '0' + c;
- else if (10 <= c <= 15)
+ else if (10 <= c && c <= 15)
return 'A' - 10 + c;
else
return '0';
if (sslmode) {
return SSL_write(ssl.get (), iov->iov_base, iov->iov_len);
} else {
- TcpClient::write2 (iov, iovcnt);
+ return TcpClient::write2 (iov, iovcnt);
}
}
if (sslmode) {
return SSL_read (ssl.get (), buf, nbytes);
} else {
- TcpClient::read2 (buf, nbytes);
+ return TcpClient::read2 (buf, nbytes);
}
}
TcpBuf buf;
ustring line;
int responseCode = 0;
- int rc;
umatch m;
static uregex re_crlf ("\\r\\n");
ustring::size_type p1 = line.find (' ', 0);
ustring::size_type p2 = line.find (' ', p1 + 1);
responseCode = strtoul (line.substr (p1 + 1, p2));
- while (rc = buf.getln2 (*this, line)) {
+ while (buf.getln2 (*this, line)) {
// XXX
if (line.empty ())
break;
const HostSpec* ephost;
SSL_autoptr ssl;
SSL_CTX_autoptr ssl_ctx;
- SSL_METHOD* ssl_meth;
+ const SSL_METHOD* ssl_meth;
bool fnoverify;
bool sslmode;
if (cookie && cookie->isCons ()) {
while (cookie) {
- if (a = cookie->car ()) {
+ if ((a = cookie->car ())) {
if (a->isCons ()) {
http->cookie.push_back (HTTPSend::mapelem (to_string (a->car ()), to_string (a->cdr ())));
} else {
if (headerquery && headerquery->isCons ()) {
while (headerquery) {
- if (a = headerquery->car ()) {
+ if ((a = headerquery->car ())) {
if (a->isCons ()) {
http->header_req.push_back (HTTPSend::mapelem (to_string (a->car ()), to_string (a->cdr ())));
} else {
e = query ();
if (e && e->isCons ()) {
while (e) {
- if (a = e->car ()) {
+ if ((a = e->car ())) {
if (c > 0)
ans.append (uAmp);
ans.append (percentEncode (to_string (a->car ())));
}
csr.skip (n - 2);
}
+ return false;
}
static bool pngSize (ustring* data, size_t& x, size_t& y) {
ustring b;
bool rc;
-// if (fforce || ! mlenv->includedFile.get (f)) {
if (fforce || ! mlenv->includedFile (f)) {
-// mlenv->includedFile.set (f);
mlenv->setIncludedFile (f);
rc = readFile (f, b);
if (rc) {
std::cerr << "\n";
#endif /* DEBUG */
autoIncl.inc ();
-// mlenv->inclIncCount ();
if (ml.top.isCons ()) {
ans = progn (&ml.top, mlenv);
if (mlenv->breaksym ()) {
rest = NULL;
}
}
-// mlenv->declIncCount ();
} else {
throw (file + uErrorNotFound);
}
case MNode::MC_CONS:
v = newMNode_quote (v);
break;
+ default:;
}
}
return v;
case HAlignRight:
out->out_raw (CharConst (" align=\"right\""));
break;
+ default:;
}
wiki->outputName (out, CharConst ("width"), width);
wiki->outputName (out, CharConst ("height"), height);
case VAlignBottom:
out->out_raw (CharConst (" valign=\"bottom\""));
break;
+ default:;
}
wiki->outputFlag (out, CharConst ("nowrap"), fnowrap);
break;
if (fx && (wf = wiki->env->wikienv->wikiCmd.getVar (name))) { // Wiki Command
call_defun_wikicmd (name, wf, objv2, wl, wiki);
- } else if (mf = wiki->env->wikienv->wikiMacro.getVar (name)) { // Wiki Macro. macroは誰でも実行できる。
+ } else if ((mf = wiki->env->wikienv->wikiMacro.getVar (name))) { // Wiki Macro. macroは誰でも実行できる。
// std::cerr << "macro:" << name << "\n";
call_defun_macro (name, mf, objv2, wl, wiki);
} else { // 処理なし
wiki->cur->close ();
wiki->cur = NULL;
return CloseTrue;
+ default:;
}
}
+ default:;
}
}
// no opening point.
return true;
case WikiBlock::CloseFalse:
return false;
+ default:;
}
}
return false;
void WikiFormat::compileLines (WikiLineScanner& scanner, bool (*fn)(WikiLine& spp, WikiLineScanner& scanner, WikiFormat* wiki, void* par), void* par) {
WikiLine* wl;
- while (wl = scanner.next ()) {
+ while ((wl = scanner.next ())) {
if (fn && fn (*scanner.cur (), scanner, this, par)) {
break;
} else {
virtual bool checkClose (uiterator b, uiterator e);
virtual void compileLine (WikiLineScanner& scanner);
- virtual void compileLines (WikiLineScanner& scanner, bool (*fn)(WikiLine& spp, WikiLineScanner& scanner, WikiFormat* wiki, void* par) = false, void* par = false);
+ virtual void compileLines (WikiLineScanner& scanner, bool (*fn)(WikiLine& spp, WikiLineScanner& scanner, WikiFormat* wiki, void* par) = NULL, void* par = NULL);
virtual void pushBlockRaw (uiterator b, uiterator e);
virtual void push_block (boost::ptr_vector<WikiBlock>* b) {
bstack.push_back (cur);
WikiMotorObjVec v;
bool ans = splitChar_keyword (ch, name, v);
value = v.textOut (wiki);
+ return ans;
}
bool WikiMotorObjVec::splitChar (WikiFormat* wiki, ustring::value_type ch, ustring& name, ustring& value) {
sp.shiftCursor ();
}
return;
+ default:;
}
} else if ((wd = wiki->env->wikienv->wikiFunc2.getVar (name))) {
WikiMotorObjFuncM2* obj = new WikiMotorObjFuncM2 (name, wd);