| 1601 | } |
| 1602 | |
| 1603 | static void read_closed(pn_transport_t *transport, unsigned int layer, ssize_t error) |
| 1604 | { |
| 1605 | pni_ssl_t *ssl = transport->ssl; |
| 1606 | if (ssl->app_input_closed) |
| 1607 | return; |
| 1608 | if (ssl->state == RUNNING && !error) { |
| 1609 | // Signal end of stream |
| 1610 | ssl->app_input_closed = transport->io_layers[layer+1]->process_input(transport, layer+1, ssl->app_inbytes.start, 0); |
| 1611 | } |
| 1612 | if (!ssl->app_input_closed) |
| 1613 | ssl->app_input_closed = error ? error : PN_ERR; |
| 1614 | |
| 1615 | if (ssl->app_output_closed) { |
| 1616 | // both sides of app closed, and no more app output pending: |
| 1617 | ssl->state = SHUTTING_DOWN; |
| 1618 | if (ssl->network_out_pending == 0 && !ssl->queued_shutdown) { |
| 1619 | start_ssl_shutdown(transport); |
| 1620 | } |
| 1621 | } |
| 1622 | } |
| 1623 | |
| 1624 | |
| 1625 | // Read up to "available" bytes from the network, decrypt it and pass plaintext to application. |
no test coverage detected