(Continue) writing the encrypted_peer_out array */
| 500 | |
| 501 | /* (Continue) writing the encrypted_peer_out array */ |
| 502 | static struct io_plan *write_encrypted_to_peer(struct peer *peer) |
| 503 | { |
| 504 | size_t avail = membuf_num_elems(&peer->encrypted_peer_out); |
| 505 | /* With padding: always a full uniform-size chunk. |
| 506 | * Without: flush whatever we have (caller ensures non-zero). */ |
| 507 | size_t write_size = use_uniform_writes(peer) ? UNIFORM_MESSAGE_SIZE : avail; |
| 508 | |
| 509 | assert(avail >= write_size && write_size > 0); |
| 510 | return io_write_partial(peer->to_peer, |
| 511 | membuf_elems(&peer->encrypted_peer_out), |
| 512 | write_size, |
| 513 | &peer->encrypted_peer_out_sent, |
| 514 | write_to_peer, peer); |
| 515 | } |
| 516 | |
| 517 | /* Close the connection if this fails */ |
| 518 | static bool encrypt_append(struct peer *peer, const u8 *msg TAKES) |
no test coverage detected