|
|
@@ -237,13 +237,35 @@ void CWSCodec::DeserializeBase(CMessage& msg, CTransStruct& ts, int& rpos, cJSON
|
|
|
cJSON_AddStringToObject(extendJs.get(), i->mName.c_str(), "");
|
|
|
}
|
|
|
}
|
|
|
+ else if (i->mType == "array_blob")
|
|
|
+ {
|
|
|
+ int array_size = 0;
|
|
|
+ ReadT(msg.getPayload(), array_size, &rpos);//array size
|
|
|
+ cJSON* tmpArray = cJSON_CreateArray(), * tmpArray2 = cJSON_CreateArray();
|
|
|
+ for (int c = 0; c < array_size; ++c) {
|
|
|
+ int tmpSize = 0;
|
|
|
+ ReadT(msg.getPayload(), tmpSize, &rpos);
|
|
|
+ if (0 != tmpSize)
|
|
|
+ {
|
|
|
+ void* binData = (char*)malloc(sizeof(char) * tmpSize);
|
|
|
+ ReadT(msg.getPayload(), binData, tmpSize, &rpos);
|
|
|
+ int base64Len = modp_b64_encode_len(tmpSize);
|
|
|
+ char* base64Data = (char*)malloc(sizeof(char) * base64Len);
|
|
|
+ modp_b64_encode(base64Data, (const char*)binData, tmpSize);
|
|
|
+ cJSON_AddItemToArray(tmpArray, cJSON_CreateString(base64Data));
|
|
|
+ cJSON_AddItemToArray(tmpArray2, cJSON_CreateString(base64Data));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!t_isRepeat) cJSON_AddItemToObject(ret, i->mName.c_str(), tmpArray);
|
|
|
+ cJSON_AddItemToObject(extendJs.get(), i->mName.c_str(), tmpArray2);
|
|
|
+ }
|
|
|
++i;
|
|
|
}
|
|
|
}
|
|
|
catch(...)
|
|
|
{
|
|
|
if (i != ts.mParamList.end())
|
|
|
- DbgEx("DeserializeBase error:%s, %s", i->mName, i->mType);
|
|
|
+ DbgEx("DeserializeBase error:%s, %s", i->mName.c_str(), i->mType.c_str());
|
|
|
}
|
|
|
cJSON_AddStringToObject(ret, PARAMLIST_HEAD, cJSON_PrintUnformatted(extendJs.get()));
|
|
|
//cJSON_AddItemToObject(ret, PARAMLIST_HEAD, extendJs.get());
|