* Callback when nghttp2 wants to send bytes back to the client. */
| 185 | * Callback when nghttp2 wants to send bytes back to the client. |
| 186 | */ |
| 187 | static ssize_t send_cb(nghttp2_session *ngh2, |
| 188 | const uint8_t *data, size_t length, |
| 189 | int flags, void *userp) |
| 190 | { |
| 191 | h2_session *session = (h2_session *)userp; |
| 192 | apr_status_t rv; |
| 193 | (void)ngh2; |
| 194 | (void)flags; |
| 195 | |
| 196 | if (h2_c1_io_needs_flush(&session->io)) { |
| 197 | return NGHTTP2_ERR_WOULDBLOCK; |
| 198 | } |
| 199 | |
| 200 | rv = h2_c1_io_add_data(&session->io, (const char *)data, length); |
| 201 | if (APR_SUCCESS == rv) { |
| 202 | return length; |
| 203 | } |
| 204 | else if (APR_STATUS_IS_EAGAIN(rv)) { |
| 205 | return NGHTTP2_ERR_WOULDBLOCK; |
| 206 | } |
| 207 | else { |
| 208 | ap_log_cerror(APLOG_MARK, APLOG_DEBUG, rv, session->c1, |
| 209 | APLOGNO(03062) "h2_session: send error"); |
| 210 | return h2_session_status_from_apr_status(rv); |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | static int on_invalid_frame_recv_cb(nghttp2_session *ngh2, |
| 215 | const nghttp2_frame *frame, |
nothing calls this directly
no test coverage detected