diff --git a/src/common.c b/src/common.c index f33d3a8..c670cac 100644 --- a/src/common.c +++ b/src/common.c @@ -47,6 +47,7 @@ static char flv_header[] = "FLV\x1\x1\0\0\0\x9\0\0\0\x9"; typedef struct tagGroupStorePaths { char group_name[FDFS_GROUP_NAME_MAX_LEN + 1]; int group_name_len; + bool check_token; int storage_server_port; FDFSStorePaths store_paths; } GroupStorePaths; @@ -112,6 +113,10 @@ static int fdfs_load_groups_store_paths(IniContext *pItemContext) return ENOENT; } + group_store_paths[i].check_token = iniGetBoolValue(section_name, \ + "check_token", \ + pItemContext, false); + group_store_paths[i].storage_server_port = iniGetIntValue( \ section_name, "storage_server_port", pItemContext, \ FDFS_STORAGE_SERVER_DEF_PORT); @@ -791,6 +796,7 @@ int fdfs_http_request_handler(struct fdfs_http_context *pContext) FDFSFileInfo file_info; bool bFileExists; bool bSameGroup; //if in my group + bool checkToken = g_http_params.anti_steal_token; bool bTrunkFile; FDFSTrunkFullInfo trunkInfo; @@ -887,6 +893,7 @@ int fdfs_http_request_handler(struct fdfs_http_context *pContext) the_storage_port = group_store_paths[i]. \ storage_server_port; bSameGroup = true; + checkToken = group_store_paths[i].check_token; pStorePaths = &group_store_paths[i].store_paths; break; } @@ -914,7 +921,7 @@ int fdfs_http_request_handler(struct fdfs_http_context *pContext) return HTTP_BADREQUEST; } - if (g_http_params.anti_steal_token) + if (g_http_params.anti_steal_token && checkToken) { char *token; char *ts; diff --git a/src/mod_fastdfs.conf b/src/mod_fastdfs.conf index 548108d..b971151 100644 --- a/src/mod_fastdfs.conf +++ b/src/mod_fastdfs.conf @@ -117,6 +117,7 @@ group_count = 0 # when support multi-group on this storage server, uncomment following section #[group1] #group_name=group1 +#check_token=false #storage_server_port=23000 #store_path_count=2 #store_path0=/home/yuqing/fastdfs @@ -127,6 +128,7 @@ group_count = 0 # when support multi-group, uncomment following section as neccessary #[group2] #group_name=group2 +#check_token=false #storage_server_port=23000 #store_path_count=1 #store_path0=/home/yuqing/fastdfs