You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2019/03/22 13:03:20 UTC

[mynewt-core] branch master updated: net/oic; if resource handler fails a request, don't honor observer option.

This is an automated email from the ASF dual-hosted git repository.

marko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new e5de654  net/oic; if resource handler fails a request, don't honor observer option.
     new ce99c37  Merge pull request #1716 from mkiiskila/reject_obs_on_fail
e5de654 is described below

commit e5de65426e5ba3ad9770046d6033f736b6b3c980
Author: Marko Kiiskila <ma...@apache.org>
AuthorDate: Fri Mar 22 14:16:53 2019 +0200

    net/oic; if resource handler fails a request, don't honor observer option.
---
 net/oic/src/api/oc_ri.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/oic/src/api/oc_ri.c b/net/oic/src/api/oc_ri.c
index 6bbd1bd..2265f22 100644
--- a/net/oic/src/api/oc_ri.c
+++ b/net/oic/src/api/oc_ri.c
@@ -577,8 +577,7 @@ oc_ri_invoke_coap_entity_handler(struct coap_packet_rx *request,
     response_buffer.response_length = 0;
     response_buffer.code = oc_status_code(OC_STATUS_METHOD_NOT_ALLOWED);
     success = false;
-  }
-  else if (!authorized) {
+  } else if (!authorized) {
     OC_LOG(ERROR, "ocri: Subject not authorized\n");
     /* If the requestor (subject) does not have access granted via an
      * access control entry in the ACL, then it is not authorized to
@@ -587,6 +586,8 @@ oc_ri_invoke_coap_entity_handler(struct coap_packet_rx *request,
     response_buffer.response_length = 0;
     response_buffer.code = oc_status_code(OC_STATUS_FORBIDDEN);
     success = false;
+  } else if (response_buffer.code >= BAD_REQUEST_4_00) {
+    success = false;
   }
 
 #ifdef OC_SERVER