BugID:19119935:[coap] remove the current limit
@@ -462,44 +462,20 @@ static int CoAPRequestMessage_handle(CoAPContext *context, NetworkAddr *remote,
COAP_DEBUG("Request path is %s", path);
/* CoAP request receive flowControl */
- uint64_t time_curr = 0;
- int64_t time_delta = 0;
- int isOverThre = 0;
- static uint64_t time_prev = 0;
- static int count = 0;
-
- time_curr = HAL_UptimeMs();
- if (time_curr < time_prev) {
- time_curr = time_prev;
- }
- time_delta = time_curr - time_prev;
-
- if (time_delta < (uint64_t)PACKET_INTERVAL_THRE_MS) {
- if (++count > PACKET_TRIGGER_NUM) {
- count = PACKET_TRIGGER_NUM;
- isOverThre = 1;
- }
- } else {
- time_prev = time_curr;
-
- count -= (time_delta - PACKET_INTERVAL_THRE_MS) / PACKET_INTERVAL_THRE_MS;
- count = (count < 0) ? 0 : count;
- }
-
resource = CoAPResourceByPath_get(ctx, (char *)path);
if (NULL != resource) {
if (NULL != resource->callback) {
- if ((((resource->permission) & (1 << ((message->header.code) - 1))) > 0) && !isOverThre) {
+ if (((resource->permission) & (1 << ((message->header.code) - 1))) > 0) {
if (message->header.type == COAP_MESSAGE_TYPE_CON) {
CoAPRequestMessage_ack_send(ctx, remote, message->header.msgid);
}
resource->callback(ctx, (char *)path, remote, message);
} else {
- COAP_FLOW("The resource %s isn't allowed", resource->path);
+ COAP_FLOW("The resource %s isn't allowed", path);
ret = CoAPErrRespMessage_send(ctx, remote, message, COAP_MSG_CODE_405_METHOD_NOT_ALLOWED);
}
} else {
- COAP_FLOW("The resource %s handler isn't exist", resource->path);
+ COAP_FLOW("The resource %s handler isn't exist", path);
ret = CoAPErrRespMessage_send(ctx, remote, message, COAP_MSG_CODE_405_METHOD_NOT_ALLOWED);
}
} else {
