]> granicus.if.org Git - apache/commitdiff
Commit 1 of 2 to:
authorBill Stoddard <stoddard@apache.org>
Wed, 20 Mar 2002 17:41:55 +0000 (17:41 +0000)
committerBill Stoddard <stoddard@apache.org>
Wed, 20 Mar 2002 17:41:55 +0000 (17:41 +0000)
1. rename ap_rset_content_type to ap_set_content_type
2. reverse the arguments on the call to aligh with ap_set_content_length

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

19 files changed:
modules/dav/main/mod_dav.c
modules/experimental/cache_storage.c
modules/experimental/mod_example.c
modules/filters/mod_include.c
modules/generators/mod_autoindex.c
modules/generators/mod_cgi.c
modules/generators/mod_cgid.c
modules/generators/mod_info.c
modules/generators/mod_status.c
modules/http/http_protocol.c
modules/http/http_request.c
modules/http/mod_mime.c
modules/mappers/mod_imap.c
modules/mappers/mod_negotiation.c
modules/mappers/mod_rewrite.c
modules/metadata/mod_cern_meta.c
modules/metadata/mod_mime_magic.c
modules/proxy/proxy_ftp.c
modules/proxy/proxy_http.c

index 3a0aaf725d678a340a9346225da86042061b80fe..bb78e806f08d104542f6f84ca7fc87a3b8df8020 100644 (file)
@@ -345,7 +345,7 @@ static int dav_error_response(request_rec *r, int status, const char *body)
     /* ### I really don't think this is needed; gotta test */
     r->status_line = ap_get_status_line(status);
 
-    ap_rset_content_type("text/html", r);
+    ap_set_content_type(r, "text/html");
 
     /* since we're returning DONE, ensure the request body is consumed. */
     (void) ap_discard_request_body(r);
@@ -382,7 +382,7 @@ static int dav_error_response_tag(request_rec *r,
     /* ### I really don't think this is needed; gotta test */
     r->status_line = ap_get_status_line(err->status);
 
-    ap_rset_content_type(DAV_XML_CONTENT_TYPE, r);
+    ap_set_content_type(r, DAV_XML_CONTENT_TYPE);
 
     /* since we're returning DONE, ensure the request body is consumed. */
     (void) ap_discard_request_body(r);
@@ -455,7 +455,7 @@ static void dav_send_multistatus(request_rec *r, int status,
 {
     /* Set the correct status and Content-Type */
     r->status = status;
-    ap_rset_content_type(DAV_XML_CONTENT_TYPE, r);
+    ap_set_content_type(r, DAV_XML_CONTENT_TYPE);
 
     /* Send the headers and actual multistatus response now... */
     ap_rputs(DAV_XML_HEADER DEBUG_CR
@@ -1693,7 +1693,7 @@ static int dav_method_options(request_rec *r)
 
     /* send the options response */
     r->status = HTTP_OK;
-    ap_rset_content_type(DAV_XML_CONTENT_TYPE, r);
+    ap_set_content_type(r, DAV_XML_CONTENT_TYPE);
 
     /* send the headers and response body */
     ap_rputs(DAV_XML_HEADER DEBUG_CR
@@ -2920,7 +2920,7 @@ static int dav_method_lock(request_rec *r)
     (*locks_hooks->close_lockdb)(lockdb);
 
     r->status = HTTP_OK;
-    ap_rset_content_type(DAV_XML_CONTENT_TYPE, r);
+    ap_set_content_type(r, DAV_XML_CONTENT_TYPE);
 
     ap_rputs(DAV_XML_HEADER DEBUG_CR "<D:prop xmlns:D=\"DAV:\">" DEBUG_CR, r);
     if (lock == NULL)
@@ -3878,7 +3878,7 @@ static int dav_method_report(request_rec *r)
 
     /* set up defaults for the report response */
     r->status = HTTP_OK;
-    ap_rset_content_type(DAV_XML_CONTENT_TYPE, r);
+    ap_set_content_type(r, DAV_XML_CONTENT_TYPE);
 
     /* run report hook */
     if ((err = (*vsn_hooks->deliver_report)(r, resource, doc,
@@ -4125,7 +4125,7 @@ static int dav_method_merge(request_rec *r)
        is going to do something different (i.e. an error), then it must
        return a dav_error, and we'll reset these values properly. */
     r->status = HTTP_OK;
-    ap_rset_content_type("text/xml", r);
+    ap_set_content_type(r, "text/xml");
 
     /* ### should we do any preliminary response generation? probably not,
        ### because we may have an error, thus demanding something else in
index 99860c3748b9030fac14f6b723df1998364b62b5..4f1df76524b90b04ce5b0619a985af0c07bc7259 100644 (file)
@@ -237,7 +237,7 @@ apr_status_t cache_read_entity_headers(cache_handle_t *h, request_rec *r)
         return rv;
     }
 
-    ap_rset_content_type(apr_pstrdup(r->pool, info->content_type), r);
+    ap_set_content_type(r, apr_pstrdup(r->pool, info->content_type));
     r->filename = apr_pstrdup(r->pool, info->filename );
 
     return APR_SUCCESS;
index c691e94da698dfe282f30a0ec61a6dad11744d4b..2fb992f3679678e21c6d81fc652bd1f925dc97e0 100644 (file)
@@ -552,7 +552,7 @@ static int x_handler(request_rec *r)
      * We also need to start a timer so the server can know if the connexion
      * is broken.
      */
-    ap_rset_content_type("text/html", r);
+    ap_set_content_type(r, "text/html");
     /*
      * If we're only supposed to send header information (HEAD request), we're
      * already there.
index c96d47bc10db85ef0b1723b4fa30e55b6f52bd47..13ca2fc07760459372bc560bc3420940dfdc467d 100644 (file)
@@ -3453,7 +3453,7 @@ static int include_fixup(request_rec *r)
     if (r->handler && (strcmp(r->handler, "server-parsed") == 0)) 
     {
         if (!r->content_type || !*r->content_type) {
-            ap_rset_content_type("text/html", r);
+            ap_set_content_type(r, "text/html");
         }
         r->handler = "default-handler";
     }
index ce9c8523b016cfcbe1a9e2f1e1ef3b48a804aee2..fc58e3ffd22e1c28f0472de8ea9a12c1535cf3d1 100644 (file)
@@ -1895,9 +1895,9 @@ static int index_directory(request_rec *r,
     }
 
 #if APR_HAS_UNICODE_FS 
-    ap_rset_content_type("text/html;charset=utf-8", r);
+    ap_set_content_type(r, "text/html;charset=utf-8");
 #else
-    ap_rset_content_type("text/html", r);
+    ap_set_content_type(r, "text/html");
 #endif
     if (autoindex_opts & TRACK_MODIFIED) {
         ap_update_mtime(r, r->finfo.mtime);
index a9eee2aaa66a223195081f2e05140333d5a8c315..9e291f5f9b798449c1e97218e7b9d3a637f8d416 100644 (file)
@@ -801,7 +801,7 @@ static int include_cgi(char *s, request_rec *r, ap_filter_t *next,
      * typing rules would have called it something else.
      */
 
-    ap_rset_content_type(CGI_MAGIC_TYPE, rr);
+    ap_set_content_type(rr, CGI_MAGIC_TYPE);
 
     /* Run it. */
 
index b3c0a3aca0921a2a8c7fa2a013f3d1f89f6c28c4..e38f00507a9d0db72b3482e24af138e2d20f56e1 100644 (file)
@@ -1229,7 +1229,7 @@ static int include_cgi(char *s, request_rec *r, ap_filter_t *next,
     /* Force sub_req to be treated as a CGI request, even if ordinary
      * typing rules would have called it something else.
      */
-    ap_rset_content_type(CGI_MAGIC_TYPE, rr);
+    ap_set_content_type(rr, CGI_MAGIC_TYPE);
 
     /* Run it. */
 
index 56d5edfc7529698edcbb9edf4d76fb80ac4f6b68..e7f3cb6d7c2baaff3b589a80f52f8ad70c80fdcc 100644 (file)
@@ -377,7 +377,7 @@ static int display_info(request_rec *r)
     if (r->method_number != M_GET)
        return DECLINED;
 
-    ap_rset_content_type("text/html", r);
+    ap_set_content_type(r, "text/html");
     if (r->header_only) {
         return 0;
     }
index c51ca99232c875fec00f4887ae39a5c0660cd6cb..1d11dba393800f2a1ec2d0b31d4130a67e9b6e89 100644 (file)
@@ -283,7 +283,7 @@ static int status_handler(request_rec *r)
     if (r->method_number != M_GET)
         return DECLINED;
 
-    ap_rset_content_type("text/html", r);
+    ap_set_content_type(r, "text/html");
 
     /*
      * Simple table-driven form data set parser that lets you alter the header
@@ -312,7 +312,7 @@ static int status_handler(request_rec *r)
                     no_table_report = 1;
                     break;
                 case STAT_OPT_AUTO:
-                    ap_rset_content_type("text/plain", r);
+                    ap_set_content_type(r, "text/plain");
                     short_report = 1;
                     break;
                 }
index cdee65be5eba61ce05acf2492504247fd10ab177..f80ec770aa53207f369d599c2ddfccfcd09d823f 100644 (file)
@@ -1145,7 +1145,7 @@ AP_DECLARE_NONSTD(int) ap_send_http_trace(request_rec *r)
         return rv;
     }
 
-    ap_rset_content_type("message/http", r);
+    ap_set_content_type(r, "message/http");
 
     /* Now we recreate the request, and echo it back */
 
@@ -1253,7 +1253,7 @@ static void fixup_vary(request_rec *r)
                        apr_array_pstrcat(r->pool, varies, ','));
     }
 }
-AP_DECLARE(void) ap_rset_content_type(const char *ct, request_rec *r)
+AP_DECLARE(void) ap_set_content_type(request_rec *r, const char *ct)
 {
     r->content_type = ct;
 
@@ -2050,7 +2050,7 @@ AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error)
         r->content_languages = NULL;
         r->content_encoding = NULL;
         r->clength = 0;
-        ap_rset_content_type("text/html; charset=iso-8859-1", r);
+        ap_set_content_type(r, "text/html; charset=iso-8859-1");
 
         if ((status == HTTP_METHOD_NOT_ALLOWED)
             || (status == HTTP_NOT_IMPLEMENTED)) {
@@ -2604,10 +2604,10 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_byterange_filter(ap_filter_t *f,
 
         if (num_ranges > 1) {
             ctx->orig_ct = r->content_type;
-            ap_rset_content_type(apr_pstrcat(r->pool, "multipart",
-                                             use_range_x(r) ? "/x-" : "/",
-                                             "byteranges; boundary=",
-                                             r->boundary, NULL), r);
+            ap_set_content_type(r, apr_pstrcat(r->pool, "multipart",
+                                               use_range_x(r) ? "/x-" : "/",
+                                               "byteranges; boundary=",
+                                               r->boundary, NULL));
         }
 
         /* create a brigade in case we never call ap_save_brigade() */
index f3a450c6730b6d6859540bd3af16e8c4bcbbf66b..50a7c68b27391aa1b6290cca1ec4a376dfb1f7f9 100644 (file)
@@ -386,7 +386,7 @@ AP_DECLARE(void) ap_internal_fast_redirect(request_rec *rr, request_rec *r)
     r->args = rr->args;
     r->finfo = rr->finfo;
     r->handler = rr->handler;
-    ap_rset_content_type(rr->content_type, r);
+    ap_set_content_type(r, rr->content_type);
     r->content_encoding = rr->content_encoding;
     r->content_languages = rr->content_languages;
     r->per_dir_config = rr->per_dir_config;
@@ -428,7 +428,7 @@ AP_DECLARE(void) ap_internal_redirect_handler(const char *new_uri, request_rec *
     int access_status;
     request_rec *new = internal_internal_redirect(new_uri, r);
     if (r->handler)
-        ap_rset_content_type(r->content_type, new);
+        ap_set_content_type(new, r->content_type);
     access_status = ap_process_request_internal(new);
     if (access_status == OK) {
         if ((access_status = ap_invoke_handler(new)) != 0) {
index c4cd832c1a81a69ab5c20867a5c72822a99ea652..a281078b42183ab9681d4d04b9145e81549aaec0 100644 (file)
@@ -744,7 +744,7 @@ static int find_ct(request_rec *r)
     int found_metadata = 0;
 
     if (r->finfo.filetype == APR_DIR) {
-        ap_rset_content_type(DIR_MAGIC_TYPE, r);
+        ap_set_content_type(r, DIR_MAGIC_TYPE);
         return OK;
     }
 
@@ -793,7 +793,7 @@ static int find_ct(request_rec *r)
         if (exinfo == NULL || !exinfo->forced_type) {
             if ((type = apr_hash_get(mime_type_extensions, ext,
                                      APR_HASH_KEY_STRING)) != NULL) {
-                ap_rset_content_type((char*) type, r);
+                ap_set_content_type(r, (char*) type);
                 found = 1;
             }
         }
@@ -801,7 +801,7 @@ static int find_ct(request_rec *r)
         if (exinfo != NULL) {
 
             if (exinfo->forced_type) {
-                ap_rset_content_type(exinfo->forced_type, r);
+                ap_set_content_type(r, exinfo->forced_type);
                 found = 1;
             }
 
@@ -885,29 +885,29 @@ static int find_ct(request_rec *r)
 
        if ((ctp = analyze_ct(r, r->content_type))) {
            param *pp = ctp->param;
-           ap_rset_content_type(apr_pstrcat(r->pool, ctp->type, "/",
-                                             ctp->subtype, NULL), r);
+           ap_set_content_type(r, apr_pstrcat(r->pool, ctp->type, "/",
+                                               ctp->subtype, NULL));
            while (pp != NULL) {
                if (charset && !strcmp(pp->attr, "charset")) {
                    if (!override) {
-                       ap_rset_content_type(apr_pstrcat(r->pool, r->content_type,
-                                                         "; charset=", charset,
-                                                         NULL), r);
+                       ap_set_content_type(r, apr_pstrcat(r->pool, r->content_type,
+                                                           "; charset=", charset,
+                                                           NULL));
                        override = 1;
                    }
                }
                else {
-                   ap_rset_content_type(apr_pstrcat(r->pool, r->content_type,
-                                                     "; ", pp->attr,
-                                                     "=", pp->val,
-                                                     NULL), r);
+                   ap_set_content_type(r, apr_pstrcat(r->pool, r->content_type,
+                                                       "; ", pp->attr,
+                                                       "=", pp->val,
+                                                       NULL));
                }
                pp = pp->next;
            }
            if (charset && !override) {
-               ap_rset_content_type(apr_pstrcat(r->pool, r->content_type,
-                                                 "; charset=", charset,
-                                                 NULL), r);
+               ap_set_content_type(r, apr_pstrcat(r->pool, r->content_type,
+                                                   "; charset=", charset,
+                                                   NULL));
            }
        }
     }
index 001f95b0002965862743e06a2f63484fcc13934e..7bde235867b19b5cd94f4d088a319f14fcb330bf 100644 (file)
@@ -521,7 +521,7 @@ static int imap_reply(request_rec *r, char *redirect)
 
 static void menu_header(request_rec *r, char *menu)
 {
-    ap_rset_content_type("text/html", r);
+    ap_set_content_type(r, "text/html");
 
     ap_rvputs(r, DOCTYPE_HTML_3_2, "<html><head>\n<title>Menu for ", r->uri,
            "</title>\n</head><body>\n", NULL);
index 4a19579d5f14c8d51057bf44bfdd76fc4f95c60b..c0d870bfaf8949a5fa720db0995256900f282186 100644 (file)
@@ -1115,7 +1115,7 @@ static int read_types_multi(negotiation_state *neg)
          * might be doing.
          */
         if (sub_req->handler && !sub_req->content_type) {
-            ap_rset_content_type(CGI_MAGIC_TYPE, sub_req);
+            ap_set_content_type(sub_req, CGI_MAGIC_TYPE);
         }
 
         /* 
index bc3b87de048230863c405dfa22ee83abfe0d4c44..0e877c1a1bda98bbd4d73ed7580292e15111c7cb 100644 (file)
@@ -1311,7 +1311,7 @@ static int hook_mimetype(request_rec *r)
     else {
         rewritelog(r, 1, "force filename %s to have MIME-type '%s'",
                    r->filename, t);
-        ap_rset_content_type(t, r);
+        ap_set_content_type(r, t);
         return OK;
     }
 }
@@ -1959,7 +1959,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p,
                  */
                 rewritelog(r, 1, "[per-dir %s] force %s to have MIME-type "
                            "'%s'", perdir, r->filename, p->forced_mimetype);
-                ap_rset_content_type(p->forced_mimetype, r);
+                ap_set_content_type(r, p->forced_mimetype);
             }
         }
         return 2;
index 8325759a2a5c3b0f79a1aacef0ea3267f3140d0c..3402308958e3ae32eb582bf1f70ff59fc3aaefeb 100644 (file)
@@ -293,7 +293,7 @@ static int scan_meta_file(request_rec *r, apr_file_t *f)
 
            tmp = apr_pstrdup(r->pool, l);
            ap_content_type_tolower(tmp);
-           ap_rset_content_type(tmp, r);
+           ap_set_content_type(r, tmp);
        }
        else if (!strcasecmp(w, "Status")) {
            sscanf(l, "%d", &r->status);
index 47a31b300278cdab4a9e258665ebb8abcfed8e96..10a692a0ad72426aca5203e2b1fd92293099b6dd 100644 (file)
@@ -833,7 +833,7 @@ static int magic_rsl_to_request(request_rec *r)
        /* XXX: this could be done at config time I'm sure... but I'm
         * confused by all this magic_rsl stuff. -djg */
        ap_content_type_tolower(tmp);
-       ap_rset_content_type(tmp, r);
+       ap_set_content_type(r, tmp);
     }
     if (state == rsl_encoding) {
         char *tmp;
@@ -2369,7 +2369,7 @@ static int revision_suffix(request_rec *r)
 
     /* extract content type/encoding/language from sub-request */
     if (sub->content_type) {
-       ap_rset_content_type(apr_pstrdup(r->pool, sub->content_type), r);
+       ap_set_content_type(r, apr_pstrdup(r->pool, sub->content_type));
 #if MIME_MAGIC_DEBUG
        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
                    MODNAME ": subrequest %s got %s",
index d80b4e5d1a30400e6831f070cfd2add9a4bac8bf..b62492d94e63974f5b7a2efcb420cad289cba415 100644 (file)
@@ -1710,7 +1710,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf,
 
     /* set content-type */
     if (dirlisting) {
-        ap_rset_content_type("text/html", r);
+        ap_set_content_type(r, "text/html");
     }
     else {
         if (r->content_type) {
@@ -1718,7 +1718,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf,
                      "proxy: FTP: Content-Type set to %s", r->content_type);
         }
         else {
-            ap_rset_content_type(ap_default_type(r), r);
+            ap_set_content_type(r, ap_default_type(r));
         }
         if (xfer_type != 'A' && size != NULL) {
             /* We "trust" the ftp server to really serve (size) bytes... */
index bf72da994b71e9e51e668bf4ea198a645354adb4..33a3705baa6738e10cb86483d5f1459fe3677630 100644 (file)
@@ -701,7 +701,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
                                                   "close");
                 ap_proxy_clear_connection(p, r->headers_out);
                 if ((buf = apr_table_get(r->headers_out, "Content-Type"))) {
-                    ap_rset_content_type(apr_pstrdup(p, buf), r);
+                    ap_set_content_type(r, apr_pstrdup(p, buf));
                 }            
                 ap_proxy_pre_http_request(origin,rp);
             }