void CWedApp::OnAppAbout() { CAboutDlg aboutDlg; // Declare the variables needed #ifdef _DEBUG static CMemoryState oldMemState3, newMemState3, diffMemState3; #endif #ifdef _DEBUG oldMemState3.Checkpoint(); #endif aboutDlg.DoModal(); #ifdef _DEBUG newMemState3.Checkpoint(); if( diffMemState3.Difference( oldMemState3, newMemState3 ) ) { oldMemState3.DumpAllObjectsSince(); //P2N("CDialog Memory leaked!\r\n"); //TRACE( "CDialog Memory leaked!\n" ); } #endif }
static int psx_handler(request_rec *r) { #ifdef _DWINMEM static CMemoryState myMs; myMs.Checkpoint(); #endif #ifdef APACHE2 if (!r->handler || (strcmp("smx-parsed",r->handler))) return DECLINED; #endif qEnvApache *renv = get_psx_req_env(r); qEnvApacheServer *senv = get_psx_srv_env(r); if (!renv) return DECLINED; if (r->status == HTTP_MOVED_TEMPORARILY) { renv->Done(); return r->status; } if (r->filename && *r->filename) { qStr *pIn = NULL; qStrBuf *badUrl = NULL; r->status = HTTP_OK; FILE *fp=NULL; qStrFileI inT; if (r->filename && *r->filename && (fp = fopen(r->filename,"rb"))) { inT.SetFile(fp, true); pIn = &inT; } else { if (senv->GetBadMacro() && *senv->GetBadMacro()) { badUrl = new qStrBuf(senv->GetBadMacro()); pIn = badUrl; } else { renv->Done(); return HTTP_NOT_FOUND; } } #ifdef APACHE2 renv->GetCtx()->MapObj((const char **)&r->user, "client-authname"); #else renv->GetCtx()->MapObj((const char **)&r->connection->user, "client-authname"); #endif if (r->prev && r->prev->unparsed_uri) { renv->GetCtx()->MapObj((const char **)&r->prev->unparsed_uri, "redirect-url"); } else { renv->GetCtx()->MapObj(CStr::Null, "redirect-url"); } bool noMagic = senv->GetNoMagic(); int code = 0; qStr *out = renv; qStrBuf wrapTmp; if (senv->GetWrapMacro()) { out = &wrapTmp; } if (senv->GetPageMacro() && !badUrl && fp) { bool ok = noMagic; if (!ok) { char c=fgetc(fp); ok = (c == '%'); ungetc(c, fp); } if (ok) { qStrBuf pageTmp(senv->GetPageMacro()); qStrBuf outTmp; renv->GetCtx()->ParseTry(&pageTmp, &outTmp); outTmp.Trim(); if (!outTmp.IsEmpty()) renv->PutS(outTmp); } } try { if (badUrl || noMagic) renv->GetCtx()->ParseTry(pIn, renv); else { if (!renv->GetCtx()->ParseMagic(pIn, renv, false)) { code = DECLINED; } } } catch (...) { try { renv->PutS("Unexpected error."); renv->Done(); r->status = 500; return 500; } catch (...) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, AP2STATUS r, "PSX : Unexpected error, recovery impossible, possible memory leak."); r->status = 500; return 500; } } if (senv->GetWrapMacro()) { renv->GetCtx()->MapObj(&wrapTmp, "page"); qStrBuf pageTmp(senv->GetWrapMacro()); renv->GetCtx()->ParseTry(&pageTmp, renv); } if (badUrl) delete badUrl; if (code == DECLINED) return code; code = r->status; if (badUrl || renv->GetContentLength() > 0 || code > 200) { code = renv->FinishReq(false); } else { code = HTTP_NOT_FOUND; } renv->Done(); #ifdef _DWINMEM myMs.DumpAllObjectsSince(); #endif return code; } else renv->Done(); return DECLINED; }