diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-08 02:23:46 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-08 02:23:46 +0200 |
commit | 66e78c45b555d54324f05adf6d51cbfe42c51bd4 (patch) | |
tree | be969f23a2756aa6d3b35b61d3e4eb659cb77f2c | |
parent | 68ec1eb2e96a92d0a814309d60856151eb0d1581 (diff) | |
download | neard-66e78c45b555d54324f05adf6d51cbfe42c51bd4.tar.gz neard-66e78c45b555d54324f05adf6d51cbfe42c51bd4.tar.bz2 neard-66e78c45b555d54324f05adf6d51cbfe42c51bd4.zip |
snep: Fix fragmented GET
When receiving a CONTINUE while nfc_data_length is set to 0, it must
be a CONTINUE for a fragmented GET. The headers are thus read in order
to modify snep_data->request and then process the right request.
This fixes the GET fragmented unit test.
-rw-r--r-- | src/snep.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -566,6 +566,18 @@ near_bool_t near_snep_core_read(int client_fd, return TRUE; } + /* + * This is a fragmentation SNEP operation since we have pending + * frames. But the ndef length and the current data length are + * identical. So this is a CONTINUE for a fragmented GET, and + * we should just process a CONTINUE frame and send the fragments + * back to the client. This will be done from snep_core_process_request(). + */ + if (snep_data != NULL) { + snep_data->request = frame.request; + goto process_request; + } + /* This is a new request from the client */ snep_data = g_try_malloc0(sizeof(struct p2p_snep_data)); if (snep_data == NULL) |