| 847 | } |
| 848 | |
| 849 | static bool should_shutdown(struct conn *c) |
| 850 | { |
| 851 | int i; |
| 852 | |
| 853 | if (!pending_shutdown(c)) |
| 854 | return false; |
| 855 | if (is_sink) |
| 856 | return true; |
| 857 | if (!bidi) |
| 858 | return c->cd[0].in_bytes == c->cd[1].out_bytes; |
| 859 | |
| 860 | for (i = 0; i < 2; i++) { |
| 861 | if (c->cd[0].rcv != c->cd[1].snd) |
| 862 | return false; |
| 863 | if (c->cd[1].rcv != c->cd[0].snd) |
| 864 | return false; |
| 865 | } |
| 866 | |
| 867 | return true; |
| 868 | } |
| 869 | |
| 870 | /* |
| 871 | * Close this connection - send a ring message to the connection with intent |
no test coverage detected