diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-08 02:11:18 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-08 02:23:30 +0200 |
commit | 68ec1eb2e96a92d0a814309d60856151eb0d1581 (patch) | |
tree | 5ef0f9ff6388cd3045ac42e430305a4f2ca2af25 /unit | |
parent | b9fce4fe8622ffeb6d3d90b41f3b0a76e60b120b (diff) | |
download | neard-68ec1eb2e96a92d0a814309d60856151eb0d1581.tar.gz neard-68ec1eb2e96a92d0a814309d60856151eb0d1581.tar.bz2 neard-68ec1eb2e96a92d0a814309d60856151eb0d1581.zip |
snep: Fix SNEP fragmentation
The intial request is kept through the snep_data and
snep_core_process_request no longer relies on the last read frame to
build an answer but only on the snep_data pointer.
Without this fix, each fragment from a fragmented PUT was handled as
a complete SNEP frame (header included) which caused process_request
to get completely confused about how to handle fragments.
Now that snep_core_read is fixed, the fragmentation SNEP unit test can
be fixed as well.
Diffstat (limited to 'unit')
-rw-r--r-- | unit/test-snep-read.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/unit/test-snep-read.c b/unit/test-snep-read.c index cb02054..c1e5c77 100644 --- a/unit/test-snep-read.c +++ b/unit/test-snep-read.c @@ -368,11 +368,9 @@ static near_bool_t test_snep_read_send_fragment(size_t frag_len, nbytes = send(sockfd[client], data, frag_len, 0); g_assert(nbytes == frag_len); - /* - * TODO fragment has no SNEP header. snep_core_read will fail: - * ret = near_snep_core_read(sockfd[server], 0, 0, NULL, - * test_snep_dummy_req_get, test_snep_dummy_req_put); - */ + near_snep_core_read(sockfd[server], 0, 0, NULL, + test_snep_dummy_req_get, test_snep_dummy_req_put); + return TRUE; } |