Fix broken observe requests and GETs being treated as OBSERVEs
authorMandeep Shetty <mandeep.shetty@intel.com>
Thu, 17 Sep 2015 23:47:21 +0000 (16:47 -0700)
committerSachin Agrawal <sachin.agrawal@intel.com>
Sun, 20 Sep 2015 05:01:26 +0000 (05:01 +0000)
commitfab88743f806a746a3c0406e57b5c31b87941ec8
tree2a34042ecb7261b0263626b1d4689e4f0e050509
parent6848338aebbe9c639e4e2bb01065e5ccff34092b
Fix broken observe requests and GETs being treated as OBSERVEs

args to some functions were validated for NULL to return error codes even though
NULLs were legal for the args.
For eg. it is legal for options to be NULL.

These incorrect validations caused early returns and observation actions
were not set to OC_OBSERVE_NO_OPTION which is 2. The field in the struct
instead defaulted to OC_OBSERVE_REGISTER = 0 due to default inits.

Fixed both by removing or replacing the incorrect validations with more
appropriate ones.

Change-Id: Ia7453227a668bb26971b2b7d84381f64151b88f9
Signed-off-by: Mandeep Shetty <mandeep.shetty@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2659
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Sachin Agrawal <sachin.agrawal@intel.com>
resource/csdk/stack/src/ocobserve.c
resource/csdk/stack/src/ocstack.c