- The address of test_buffer passed to tcp->recv function modified. - resolves the over-writing of test_buffer, when for a particular big chunk of data all the WIND messages are not arrived at the same time.
Fork of NSAPITests by
Revision 13:0e6a34eb52ee, committed 2016-09-06
- Comitter:
- mansiag
- Date:
- Tue Sep 06 10:42:11 2016 +0000
- Parent:
- 12:152ae238ddc1
- Commit message:
- Updating the address of test_buffer passed to tcp->recv function.
Changed in this revision
NSAPITests.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 152ae238ddc1 -r 0e6a34eb52ee NSAPITests.cpp --- a/NSAPITests.cpp Mon Jun 06 08:42:21 2016 +0000 +++ b/NSAPITests.cpp Tue Sep 06 10:42:11 2016 +0000 @@ -123,7 +123,7 @@ } for (total = 0; total < size;) { - int ret = tcp->recv(test_buffer, sizeof test_buffer); + int ret = tcp->recv(test_buffer+total, sizeof test_buffer); if (ret < 0) { printf("error: 'recv(buffer, %d)' failed during test with code %d\r\n", sizeof test_buffer, ret); @@ -188,7 +188,7 @@ for (total = 0; total < size;) { - ret = tcp->recv(test_buffer, sizeof test_buffer); + ret = tcp->recv(test_buffer+total, sizeof test_buffer); if (ret == NSAPI_ERROR_WOULD_BLOCK) { continue;