Commit 3a5a4c2
authored
Fixes Payload#hasMetadata to strictly flow the flag in frame
This PR ensures that Payload#hasMetadata will have identically value as it was encoded in frame decoded to Payload.
Also, this PR ensures that during the encoding the current behavior of Payload#metadata \ Payload#sliceMetadata which always return a buffer (even though them hasMetadata is false) will not brake encoding process and the result flag in the encoded frame will be mirroring exactly what `Payload#hasMetadata` returned
* fixes behaviour of flight-weights when it gets unreadable buffers
ensures that ByteBufPayload is not accessible anymore when it has been released
Signed-off-by: Oleh Dokuka <[email protected]>
* partial
Signed-off-by: Oleh Dokuka <[email protected]>
* fixes incorrect request propagation
Initially that issue was hidden because both sides uses limitRate which does prefetch 256 elements in advance so it is almost impossible to track underflow in request
Signed-off-by: Oleh Dokuka <[email protected]>
* provides refactoring related to ensuring that hasMetadata is propagated correctly
Right now there was observed a few issues related to that
Payload with no metadata was incorrectly incoded so it results to hasMetadata true on the received side
Also, optimized the API of Flyweights to ensure that we have common things in one place
Signed-off-by: Oleh Dokuka <[email protected]>
* fixes failing tests related to changes of initialRequestN
Signed-off-by: Oleh Dokuka <[email protected]>
* fixes compilation errors
Signed-off-by: Oleh Dokuka <[email protected]>
* uncomment assertions related to proper metadata propagation
Signed-off-by: Oleh Dokuka <[email protected]>
* moves payload releasing to codecs
Signed-off-by: Oleh Dokuka <[email protected]>1 parent cd67e54 commit 3a5a4c2
36 files changed
Lines changed: 872 additions & 589 deletions
File tree
- rsocket-core/src
- main/java/io/rsocket
- core
- fragmentation
- frame
- decoder
- util
- test/java/io/rsocket
- core
- fragmentation
- frame
- util
- rsocket-test/src/main/java/io/rsocket/test
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
Lines changed: 13 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 215 | + | |
| 216 | + | |
222 | 217 | | |
223 | 218 | | |
224 | 219 | | |
| |||
245 | 240 | | |
246 | 241 | | |
247 | 242 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
| 243 | + | |
| 244 | + | |
255 | 245 | | |
256 | 246 | | |
257 | 247 | | |
| |||
302 | 292 | | |
303 | 293 | | |
304 | 294 | | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | 295 | | |
314 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
315 | 299 | | |
316 | 300 | | |
317 | 301 | | |
| |||
400 | 384 | | |
401 | 385 | | |
402 | 386 | | |
403 | | - | |
| 387 | + | |
404 | 388 | | |
405 | 389 | | |
406 | | - | |
407 | 390 | | |
408 | 391 | | |
409 | 392 | | |
| |||
444 | 427 | | |
445 | 428 | | |
446 | 429 | | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
| 430 | + | |
| 431 | + | |
455 | 432 | | |
456 | 433 | | |
457 | | - | |
458 | | - | |
459 | 434 | | |
460 | 435 | | |
461 | 436 | | |
| |||
497 | 472 | | |
498 | 473 | | |
499 | 474 | | |
500 | | - | |
501 | | - | |
| 475 | + | |
502 | 476 | | |
503 | 477 | | |
504 | 478 | | |
| |||
604 | 578 | | |
605 | 579 | | |
606 | 580 | | |
607 | | - | |
608 | | - | |
| 581 | + | |
| 582 | + | |
609 | 583 | | |
610 | 584 | | |
611 | 585 | | |
| |||
Lines changed: 12 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
| 304 | + | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
412 | 405 | | |
413 | 406 | | |
414 | 407 | | |
| |||
437 | 430 | | |
438 | 431 | | |
439 | 432 | | |
440 | | - | |
| 433 | + | |
441 | 434 | | |
442 | 435 | | |
443 | 436 | | |
444 | 437 | | |
445 | 438 | | |
446 | 439 | | |
447 | | - | |
| 440 | + | |
448 | 441 | | |
449 | 442 | | |
450 | 443 | | |
| |||
469 | 462 | | |
470 | 463 | | |
471 | 464 | | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
| 465 | + | |
| 466 | + | |
482 | 467 | | |
483 | 468 | | |
484 | 469 | | |
| |||
523 | 508 | | |
524 | 509 | | |
525 | 510 | | |
526 | | - | |
| 511 | + | |
527 | 512 | | |
528 | 513 | | |
529 | 514 | | |
| |||
602 | 587 | | |
603 | 588 | | |
604 | 589 | | |
605 | | - | |
606 | | - | |
| 590 | + | |
| 591 | + | |
607 | 592 | | |
608 | 593 | | |
609 | 594 | | |
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
| 169 | + | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
265 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
266 | 272 | | |
267 | | - | |
| 273 | + | |
268 | 274 | | |
269 | 275 | | |
270 | 276 | | |
| |||
Lines changed: 21 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | 33 | | |
43 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
44 | 39 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 40 | + | |
| 41 | + | |
49 | 42 | | |
50 | | - | |
51 | 43 | | |
52 | | - | |
53 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
65 | 62 | | |
66 | 63 | | |
67 | 64 | | |
| |||
76 | 73 | | |
77 | 74 | | |
78 | 75 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | 76 | | |
Lines changed: 10 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | | - | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
| 25 | + | |
24 | 26 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 27 | + | |
| 28 | + | |
32 | 29 | | |
33 | 30 | | |
34 | 31 | | |
| |||
56 | 53 | | |
57 | 54 | | |
58 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 16 | + | |
| 17 | + | |
23 | 18 | | |
24 | 19 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
0 commit comments