Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iotivity-lite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
41
Issues
41
List
Boards
Labels
Service Desk
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
IoTivity
iotivity-lite
Commits
8ec07b31
Commit
8ec07b31
authored
Jan 09, 2020
by
Kishen Maloor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send NON discovery responses as CONfirmable
Signed-off-by:
Kishen Maloor
<
kishen.maloor@intel.com
>
parent
e062d944
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
messaging/coap/engine.c
messaging/coap/engine.c
+23
-10
No files found.
messaging/coap/engine.c
View file @
8ec07b31
...
...
@@ -77,7 +77,7 @@ extern bool oc_ri_invoke_coap_entity_handler(
void
*
request
,
void
*
response
,
oc_blockwise_state_t
**
request_state
,
oc_blockwise_state_t
**
response_state
,
uint16_t
block2_size
,
oc_endpoint_t
*
endpoint
);
#else
/* OC_BLOCK_WISE */
#else
/* OC_BLOCK_WISE */
extern
bool
oc_ri_invoke_coap_entity_handler
(
void
*
request
,
void
*
response
,
uint8_t
*
buffer
,
oc_endpoint_t
*
endpoint
);
...
...
@@ -236,7 +236,8 @@ coap_receive(oc_message_t *msg)
OC_DBG
(
" QUERY: %.*s"
,
(
int
)
message
->
uri_query_len
,
message
->
uri_query
);
OC_DBG
(
" Payload: %.*s"
,
(
int
)
message
->
payload_len
,
message
->
payload
);
#endif
const
char
*
href
;
size_t
href_len
=
coap_get_header_uri_path
(
message
,
&
href
);
#ifdef OC_TCP
if
(
msg
->
endpoint
.
flags
&
TCP
)
{
coap_tcp_init_message
(
response
,
CONTENT_2_05
);
...
...
@@ -253,18 +254,21 @@ coap_receive(oc_message_t *msg)
history
[
idx
]
=
message
->
mid
;
history_dev
[
idx
]
=
(
uint8_t
)
msg
->
endpoint
.
device
;
idx
=
(
idx
+
1
)
%
OC_REQUEST_HISTORY_SIZE
;
coap_udp_init_message
(
response
,
COAP_TYPE_NON
,
CONTENT_2_05
,
coap_get_mid
());
if
(
href_len
==
7
&&
memcmp
(
href
,
"oic/res"
,
7
)
==
0
)
{
coap_udp_init_message
(
response
,
COAP_TYPE_CON
,
CONTENT_2_05
,
coap_get_mid
());
}
else
{
coap_udp_init_message
(
response
,
COAP_TYPE_NON
,
CONTENT_2_05
,
coap_get_mid
());
}
}
}
/* create transaction for response */
transaction
=
coap_new_transaction
(
messag
e
->
mid
,
&
msg
->
endpoint
);
transaction
=
coap_new_transaction
(
respons
e
->
mid
,
&
msg
->
endpoint
);
if
(
transaction
)
{
#ifdef OC_BLOCK_WISE
const
char
*
href
;
size_t
href_len
=
coap_get_header_uri_path
(
message
,
&
href
);
const
uint8_t
*
incoming_block
;
uint32_t
incoming_block_len
=
(
uint32_t
)
coap_get_payload
(
message
,
&
incoming_block
);
...
...
@@ -438,8 +442,17 @@ coap_receive(oc_message_t *msg)
href
,
href_len
,
&
msg
->
endpoint
,
message
->
code
,
message
->
uri_query
,
message
->
uri_query_len
,
OC_BLOCKWISE_SERVER
);
if
(
response_buffer
)
{
oc_blockwise_free_response_buffer
(
response_buffer
);
response_buffer
=
NULL
;
if
(
msg
->
endpoint
.
flags
&
MULTICAST
&&
response_buffer
->
next_block_offset
<
response_buffer
->
payload_size
)
{
OC_DBG
(
"Dropping duplicate block-wise transfer request due to "
"repeated multicast"
);
coap_status_code
=
CLEAR_TRANSACTION
;
goto
send_message
;
}
else
{
oc_blockwise_free_response_buffer
(
response_buffer
);
response_buffer
=
NULL
;
}
}
goto
request_handler
;
}
else
{
...
...
@@ -457,7 +470,7 @@ coap_receive(oc_message_t *msg)
if
(
oc_ri_invoke_coap_entity_handler
(
message
,
response
,
&
request_buffer
,
&
response_buffer
,
block2_size
,
&
msg
->
endpoint
))
{
#else
/* OC_BLOCK_WISE */
#else
/* OC_BLOCK_WISE */
if
(
oc_ri_invoke_coap_entity_handler
(
message
,
response
,
transaction
->
message
->
data
+
COAP_MAX_HEADER_SIZE
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment