| 746 | } |
| 747 | |
| 748 | static apr_status_t store_array(apr_file_t *fd, apr_array_header_t* arr) |
| 749 | { |
| 750 | int i; |
| 751 | apr_status_t rv; |
| 752 | struct iovec iov[2]; |
| 753 | apr_size_t amt; |
| 754 | const char **elts; |
| 755 | |
| 756 | elts = (const char **) arr->elts; |
| 757 | |
| 758 | for (i = 0; i < arr->nelts; i++) { |
| 759 | iov[0].iov_base = (char*) elts[i]; |
| 760 | iov[0].iov_len = strlen(elts[i]); |
| 761 | iov[1].iov_base = CRLF; |
| 762 | iov[1].iov_len = sizeof(CRLF) - 1; |
| 763 | |
| 764 | rv = apr_file_writev_full(fd, (const struct iovec *) &iov, 2, &amt); |
| 765 | if (rv != APR_SUCCESS) { |
| 766 | return rv; |
| 767 | } |
| 768 | } |
| 769 | |
| 770 | iov[0].iov_base = CRLF; |
| 771 | iov[0].iov_len = sizeof(CRLF) - 1; |
| 772 | |
| 773 | return apr_file_writev_full(fd, (const struct iovec *) &iov, 1, &amt); |
| 774 | } |
| 775 | |
| 776 | static apr_status_t read_table(cache_handle_t *handle, request_rec *r, |
| 777 | apr_table_t *table, apr_file_t *file) |