summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-11-10 18:50:26 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-11-10 18:50:26 +0800
commit2734f57bd9dac7f1c886507664832cd302a77879 (patch)
tree994f8f331d415cb398cd8adbfe38e20391eba51f
parente38f74c019f275da487ac455ae74933e5268a145 (diff)
downloadpttbbs-2734f57bd9dac7f1c886507664832cd302a77879.tar
pttbbs-2734f57bd9dac7f1c886507664832cd302a77879.tar.gz
pttbbs-2734f57bd9dac7f1c886507664832cd302a77879.tar.bz2
pttbbs-2734f57bd9dac7f1c886507664832cd302a77879.tar.lz
pttbbs-2734f57bd9dac7f1c886507664832cd302a77879.tar.xz
pttbbs-2734f57bd9dac7f1c886507664832cd302a77879.tar.zst
pttbbs-2734f57bd9dac7f1c886507664832cd302a77879.zip
make limits configurable
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5241 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/psb.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/pttbbs/mbbsd/psb.c b/pttbbs/mbbsd/psb.c
index 36bc8ec6..d49b55db 100644
--- a/pttbbs/mbbsd/psb.c
+++ b/pttbbs/mbbsd/psb.c
@@ -200,7 +200,9 @@ psb_main(PSB_CTX *psbctx)
///////////////////////////////////////////////////////////////////////////
// Time Capsule: Edit History
+#ifndef PVEH_LIMIT_NUMBER
#define PVEH_LIMIT_NUMBER (199)
+#endif
typedef struct {
const char *subject;
@@ -372,8 +374,9 @@ psb_view_edit_history(const char *base, const char *subject,
///////////////////////////////////////////////////////////////////////////
// Time Capsule: Recycle Bin
-#define PVRB_LIMIT_NUMBER (10300)
-// #define PVRB_LIMIT_NUMBER (103000)
+#ifndef PVRB_LIMIT_NUMBER
+#define PVRB_LIMIT_NUMBER (103000/10)
+#endif
typedef struct {
const char *dirbase;
@@ -552,8 +555,11 @@ psb_recycle_bin(const char *base, const char *title) {
///////////////////////////////////////////////////////////////////////////
// Admin Edit
-// still 偷懶...
+// Since admin edit is usually rarely used, no need to write dynamic allocation
+// for it.
+#ifndef MAX_PAE_ENTRIES
#define MAX_PAE_ENTRIES (256)
+#endif
typedef struct {
char *descs[MAX_PAE_ENTRIES];
@@ -688,6 +694,8 @@ psb_admin_edit() {
paectx.descs[ctx.total] = strdup(v);
ctx.total++;
}
+ if (ctx.total >= MAX_PAE_ENTRIES)
+ vmsg("注意: 您的系統設定已超過或接近預設上限,請洽系統站長加大設定");
psb_main(&ctx);