MCPcopy Index your code
hub / github.com/apache/httpd / read_array

Function read_array

modules/cache/mod_cache_disk.c:712–746  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

710}
711
712static apr_status_t read_array(request_rec *r, apr_array_header_t* arr,
713 apr_file_t *file)
714{
715 char w[MAX_STRING_LEN];
716 apr_size_t p;
717 apr_status_t rv;
718
719 while (1) {
720 rv = apr_file_gets(w, MAX_STRING_LEN - 1, file);
721 if (rv != APR_SUCCESS) {
722 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00716)
723 "Premature end of vary array.");
724 return rv;
725 }
726
727 p = strlen(w);
728 if (p > 0 && w[p - 1] == '\n') {
729 if (p > 1 && w[p - 2] == CR) {
730 w[p - 2] = '\0';
731 }
732 else {
733 w[p - 1] = '\0';
734 }
735 }
736
737 /* If we've finished reading the array, break out of the loop. */
738 if (w[0] == '\0') {
739 break;
740 }
741
742 *((const char **) apr_array_push(arr)) = apr_pstrdup(r->pool, w);
743 }
744
745 return APR_SUCCESS;
746}
747
748static apr_status_t store_array(apr_file_t *fd, apr_array_header_t* arr)
749{

Callers 1

open_entityFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected