瀏覽代碼

Added check for the duplicate option

Sergey Lyubka 13 年之前
父節點
當前提交
f085e68baf
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      mongoose.c

+ 3 - 0
mongoose.c

@@ -4181,6 +4181,9 @@ struct mg_context *mg_start(mg_callback_t user_callback, void *user_data,
       free_context(ctx);
       return NULL;
     }
+    if (ctx->config[i] != NULL) {
+      cry(fc(ctx), "%s: duplicate option", name);
+    }
     ctx->config[i] = mg_strdup(value);
     DEBUG_TRACE(("[%s] -> [%s]", name, value));
   }