]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Eliminate use of FILE * & ap_get_os_file() in mod_asis by APRizing
authorBrian Havard <bjh@apache.org>
Sun, 31 Oct 1999 09:26:03 +0000 (09:26 +0000)
committerBrian Havard <bjh@apache.org>
Sun, 31 Oct 1999 09:26:03 +0000 (09:26 +0000)
ap_scan_script_header_err().

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84078 13f79535-47bb-0310-9956-ffa450edef68

include/util_script.h
modules/generators/mod_asis.c
server/util_script.c

index 6ef075aa9e9f9d6b5f07ee42c886e4cefcaaa00a..36c1067b052148df00da898dc0e03c3ac2439e2f 100644 (file)
@@ -74,7 +74,7 @@ API_EXPORT(char **) ap_create_environment(ap_context_t *p, ap_table_t *t);
 API_EXPORT(int) ap_find_path_info(const char *uri, const char *path_info);
 API_EXPORT(void) ap_add_cgi_vars(request_rec *r);
 API_EXPORT(void) ap_add_common_vars(request_rec *r);
-API_EXPORT(int) ap_scan_script_header_err(request_rec *r, FILE *f, char *buffer);
+API_EXPORT(int) ap_scan_script_header_err(request_rec *r, ap_file_t *f, char *buffer);
 API_EXPORT(int) ap_scan_script_header_err_buff(request_rec *r, BUFF *f,
                                                char *buffer);
 API_EXPORT(int) ap_scan_script_header_err_core(request_rec *r, char *buffer,
index 8357f4869871869f4ed50ae7bab8a68237e0f48f..c7ea640f5a7c3ae2a4999c630bb35b0424ba8526 100644 (file)
@@ -68,8 +68,6 @@ static int asis_handler(request_rec *r)
     ap_file_t *f;
     ap_status_t status;
     const char *location;
-    FILE *thefile;         /* XXX leave these alone until we convert */
-    int thefd;             /* everything to use apr_file_t's. */ 
 
     r->allowed |= (1 << M_GET);
     if (r->method_number != M_GET)
@@ -87,10 +85,7 @@ static int asis_handler(request_rec *r)
        return FORBIDDEN;
     }
 
-    ap_get_os_file(&thefd, f); 
-    thefile = fdopen(thefd, "r");
-    
-    ap_scan_script_header_err(r, thefile, NULL);
+    ap_scan_script_header_err(r, f, NULL);
     location = ap_table_get(r->headers_out, "Location");
 
     if (location && location[0] == '/' &&
@@ -113,8 +108,6 @@ static int asis_handler(request_rec *r)
 
     ap_send_http_header(r);
     if (!r->header_only) {
-        ap_off_t zero = 0;
-       ap_seek(f, APR_CUR, &zero);
        ap_send_fd(f, r);
     }
 
index 187d9015e706297ec81886178b3bc4fcdaf2d56a..7f1f4d57caefc89f37751173c275d29cc20831a9 100644 (file)
@@ -605,10 +605,10 @@ API_EXPORT(int) ap_scan_script_header_err_core(request_rec *r, char *buffer,
 
 static int getsfunc_FILE(char *buf, int len, void *f)
 {
-    return fgets(buf, len, (FILE *) f) != NULL;
+    return ap_fgets(buf, len, (ap_file_t *) f) == APR_SUCCESS;
 }
 
-API_EXPORT(int) ap_scan_script_header_err(request_rec *r, FILE *f,
+API_EXPORT(int) ap_scan_script_header_err(request_rec *r, ap_file_t *f,
                                          char *buffer)
 {
     return ap_scan_script_header_err_core(r, buffer, getsfunc_FILE, f);