Skip to content

Commit 1dc5edf

Browse files
committed
fix parse chain throw exception bug
1 parent 2709fca commit 1dc5edf

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

khttpd

Submodule khttpd updated from 554be46 to c361bac

src/KAccess.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ void KAccess::setChainAction(kgl_jump_type& jump_type, KSafeJump& jump, const KS
741741
}
742742
if (!jump) {
743743
fprintf(stderr, "cann't get table name=[%s]\n", name.c_str());
744-
jump_type = JUMP_DENY;
744+
jump_type = JUMP_CONTINUE;
745745
throw KXmlException("cann't found table");
746746
}
747747
break;
@@ -751,7 +751,7 @@ void KAccess::setChainAction(kgl_jump_type& jump_type, KSafeJump& jump, const KS
751751
jump.reset(conf.gam->refsAcserver(name));
752752
if (!jump) {
753753
klog(KLOG_ERR, "cann't get server name=[%s]\n", name.c_str());
754-
jump_type = JUMP_DENY;
754+
jump_type = JUMP_CONTINUE;
755755
throw KXmlException("cann't found server");
756756
}
757757
break;
@@ -760,7 +760,7 @@ void KAccess::setChainAction(kgl_jump_type& jump_type, KSafeJump& jump, const KS
760760
jump.reset(writeBackManager.refsWriteBack(name));
761761
if (!jump) {
762762
klog(KLOG_ERR, "cann't get writeback name=[%s]\n", name.c_str());
763-
jump_type = JUMP_DENY;
763+
jump_type = JUMP_CONTINUE;
764764
throw KXmlException("cann't found writeback");
765765
}
766766
break;

src/KConfig.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,14 +434,12 @@ static void init_config() {
434434
conf.sysHost->browse = false;
435435
KSubVirtualHost* svh = new KSubVirtualHost(conf.sysHost);
436436
svh->set_doc_root(conf.sysHost->doc_root.c_str(), "/");
437-
#ifdef HTTP_PROXY
438437
//add mime type
439438
conf.sysHost->addMimeType("gif", "image/gif", kgl_compress_never, 0);
440439
conf.sysHost->addMimeType("css", "text/css", kgl_compress_on, 0);
441440
conf.sysHost->addMimeType("html", "text/html", kgl_compress_on, 0);
442441
conf.sysHost->addMimeType("js", "text/javascript", kgl_compress_on, 0);
443442
conf.sysHost->addMimeType("*", "text/plain", kgl_compress_unknow, 0);
444-
#endif
445443
conf.sysHost->hosts.push_back(svh);
446444
conf.sysHost->add_ref();
447445
init_manager_handler();

src/KHttpManage.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,17 +338,15 @@ bool KHttpManage::extends(unsigned item) {
338338
#else
339339
,NULL
340340
#endif
341-
341+
,klang["api"]
342342
#ifndef HTTP_PROXY
343-
,klang["api"],
344-
klang["cmd"]
343+
,klang["cmd"]
345344
#else
346-
,NULL,NULL
345+
,NULL
347346
#endif
348347
#ifdef ENABLE_KSAPI_FILTER
349348
,"dso"
350349
#endif
351-
352350
};
353351
if (item == 0) {
354352
item = atoi(getUrlValue("item").c_str());

src/KTable.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ void KTable::clear() {
2929
}
3030
KSafeChain KTable::parse_chain(const khttpd::KXmlNodeBody* xml) {
3131
KSafeChain chain(new KChain());
32-
chain->parse_config(access, xml);
32+
try {
33+
chain->parse_config(access, xml);
34+
} catch (std::exception e) {
35+
klog(KLOG_ERR, "parse chain error [%s]\n", e.what());
36+
}
3337
return chain;
3438
}
3539
void KTable::add_chain_form(KChain* chain, uint8_t accessType, KWStream& s) {

src/garbage_c.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ KTHREAD_FUNCTION time_thread(void* arg) {
210210
flushFlowFlag = false;
211211
}
212212
#endif
213-
#ifndef HTTP_PROXY
214213
spProcessManage.refresh(nowTime);
214+
#ifndef HTTP_PROXY
215215
conf.gam->refreshCmd(nowTime);
216216
#endif
217217
#ifdef ENABLE_ADPP

0 commit comments

Comments
 (0)