View | Details | Raw Unified | Return to bug 13986
Collapse All | Expand All

(-)orig-httpd-2.0.43/include/http_core.h (-2 / +2 lines)
Lines 146-162 Link Here
146
 * @param r The current request
146
 * @param r The current request
147
 * @return the overrides bitmask
147
 * @return the overrides bitmask
148
 * @deffunc int ap_allow_overrides(request_rec *r)
148
 * @deffunc int ap_allow_overrides(request_rec *r)
149
 */
149
 */
150
AP_DECLARE(int) ap_allow_overrides(request_rec *r);
150
AP_DECLARE(int) ap_allow_overrides(request_rec *r);
151
151
152
/**
152
/**
153
 * Retrieve the value of the DefaultType directive, or text/plain if not set
153
 * Retrieve the value of the DefaultType directive
154
 * @param r The current request
154
 * @param r The current request
155
 * @return The default type
155
 * @return The default type or NULL if not set
156
 * @deffunc const char *ap_default_type(request_rec *r)
156
 * @deffunc const char *ap_default_type(request_rec *r)
157
 */
157
 */
158
AP_DECLARE(const char *) ap_default_type(request_rec *r);     
158
AP_DECLARE(const char *) ap_default_type(request_rec *r);     
159
159
160
/**
160
/**
161
 * Retrieve the document root for this server
161
 * Retrieve the document root for this server
162
 * @param r The current request
162
 * @param r The current request
(-)orig-httpd-2.0.43/include/http_protocol.h (+1 lines)
Lines 161-174 Link Here
161
 */
161
 */
162
AP_DECLARE(apr_time_t) ap_rationalize_mtime(request_rec *r, apr_time_t mtime);
162
AP_DECLARE(apr_time_t) ap_rationalize_mtime(request_rec *r, apr_time_t mtime);
163
163
164
/**
164
/**
165
 * Build the content-type that should be sent to the client from the
165
 * Build the content-type that should be sent to the client from the
166
 * content-type specified.  The following rules are followed:
166
 * content-type specified.  The following rules are followed:
167
 *    - if type is NULL, type is set to ap_default_type(r)
167
 *    - if type is NULL, type is set to ap_default_type(r)
168
 *    - if type is still NULL, return NULL
168
 *    - if charset adding is disabled, stop processing and return type.
169
 *    - if charset adding is disabled, stop processing and return type.
169
 *    - then, if there are no parameters on type, add the default charset
170
 *    - then, if there are no parameters on type, add the default charset
170
 *    - return type
171
 *    - return type
171
 * @param r The current request
172
 * @param r The current request
172
 * @return The content-type
173
 * @return The content-type
173
 * @deffunc const char *ap_make_content_type(request_rec *r, const char *type);
174
 * @deffunc const char *ap_make_content_type(request_rec *r, const char *type);
174
 */ 
175
 */ 
(-)orig-httpd-2.0.43/include/httpd.h (-10 lines)
Lines 240-263 Link Here
240
/* ------------------ stuff that modules are allowed to look at ----------- */
240
/* ------------------ stuff that modules are allowed to look at ----------- */
241
241
242
/** Define this to be what your HTML directory content files are called */
242
/** Define this to be what your HTML directory content files are called */
243
#ifndef AP_DEFAULT_INDEX
243
#ifndef AP_DEFAULT_INDEX
244
#define AP_DEFAULT_INDEX "index.html"
244
#define AP_DEFAULT_INDEX "index.html"
245
#endif
245
#endif
246
246
247
248
/** 
249
 * Define this to be what type you'd like returned for files with unknown 
250
 * suffixes.  
251
 * @warning MUST be all lower case. 
252
 */
253
#ifndef DEFAULT_CONTENT_TYPE
254
#define DEFAULT_CONTENT_TYPE "text/plain"
255
#endif
256
257
/** The name of the MIME types file */
247
/** The name of the MIME types file */
258
#ifndef AP_TYPES_CONFIG_FILE
248
#ifndef AP_TYPES_CONFIG_FILE
259
#define AP_TYPES_CONFIG_FILE "conf/mime.types"
249
#define AP_TYPES_CONFIG_FILE "conf/mime.types"
260
#endif
250
#endif
261
251
262
/*
252
/*
263
 * Define the HTML doctype strings centrally.
253
 * Define the HTML doctype strings centrally.
(-)orig-httpd-2.0.43/modules/experimental/mod_charset_lite.c (-5 / +6 lines)
Lines 273-315 Link Here
273
    if (!strncmp(r->filename, "redirect:", 9)) return DECLINED; 
273
    if (!strncmp(r->filename, "redirect:", 9)) return DECLINED; 
274
    if (!strncmp(r->filename, "gone:", 5)) return DECLINED; 
274
    if (!strncmp(r->filename, "gone:", 5)) return DECLINED; 
275
    if (!strncmp(r->filename, "passthrough:", 12)) return DECLINED; 
275
    if (!strncmp(r->filename, "passthrough:", 12)) return DECLINED; 
276
    if (!strncmp(r->filename, "forbidden:", 10)) return DECLINED; 
276
    if (!strncmp(r->filename, "forbidden:", 10)) return DECLINED; 
277
    
277
    
278
    mime_type = r->content_type ? r->content_type : ap_default_type(r);
278
    mime_type = r->content_type ? r->content_type : ap_default_type(r);
279
279
280
    /* If mime type isn't text or message, bail out.
280
    /* If mime type isn't set or is not text or message, bail out.
281
     */
281
     */
282
282
283
/* XXX When we handle translation of the request body, watch out here as
283
/* XXX When we handle translation of the request body, watch out here as
284
 *     1.3 allowed additional mime types: multipart and 
284
 *     1.3 allowed additional mime types: multipart and 
285
 *     application/x-www-form-urlencoded
285
 *     application/x-www-form-urlencoded
286
 */
286
 */
287
             
287
             
288
    if (strncasecmp(mime_type, "text/", 5) &&
288
    if (!mime_type ||
289
	(strncasecmp(mime_type, "text/", 5) &&
289
#if APR_CHARSET_EBCDIC
290
#if APR_CHARSET_EBCDIC
290
        /* On an EBCDIC machine, be willing to translate mod_autoindex-
291
        /* On an EBCDIC machine, be willing to translate mod_autoindex-
291
         * generated output.  Otherwise, it doesn't look too cool.
292
         * generated output.  Otherwise, it doesn't look too cool.
292
         *
293
         *
293
         * XXX This isn't a perfect fix because this doesn't trigger us
294
         * XXX This isn't a perfect fix because this doesn't trigger us
294
         * to convert from the charset of the source code to ASCII.  The
295
         * to convert from the charset of the source code to ASCII.  The
295
         * general solution seems to be to allow a generator to set an
296
         * general solution seems to be to allow a generator to set an
296
         * indicator in the r specifying that the body is coded in the
297
         * indicator in the r specifying that the body is coded in the
297
         * implementation character set (i.e., the charset of the source
298
         * implementation character set (i.e., the charset of the source
298
         * code).  This would get several different types of documents
299
         * code).  This would get several different types of documents
299
         * translated properly: mod_autoindex output, mod_status output,
300
         * translated properly: mod_autoindex output, mod_status output,
300
         * mod_info output, hard-coded error documents, etc.
301
         * mod_info output, hard-coded error documents, etc.
301
         */
302
         */
302
        strcmp(mime_type, DIR_MAGIC_TYPE) &&
303
	 strcmp(mime_type, DIR_MAGIC_TYPE) &&
303
#endif
304
#endif
304
        strncasecmp(mime_type, "message/", 8)) {
305
	 strncasecmp(mime_type, "message/", 8))) {
305
        if (dc->debug >= DBGLVL_GORY) {
306
        if (dc->debug >= DBGLVL_GORY) {
306
            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
307
            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
307
                          "mime type is %s; no translation selected",
308
                          "mime type is %s; no translation selected",
308
                          mime_type);
309
                          mime_type ? mime_type : "not present");
309
        }
310
        }
310
        return DECLINED;
311
        return DECLINED;
311
    }
312
    }
312
313
313
    if (dc->debug >= DBGLVL_GORY) {
314
    if (dc->debug >= DBGLVL_GORY) {
314
        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
315
        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
315
                      "charset_source: %s charset_default: %s",
316
                      "charset_source: %s charset_default: %s",
(-)orig-httpd-2.0.43/modules/experimental/mod_disk_cache.c (-5 / +9 lines)
Lines 467-483 Link Here
467
        r->headers_out = apr_table_make(r->pool, 20);
467
        r->headers_out = apr_table_make(r->pool, 20);
468
    }
468
    }
469
    
469
    
470
    /*
470
    /*
471
     * Call routine to read the header lines/status line 
471
     * Call routine to read the header lines/status line 
472
     */
472
     */
473
    ap_scan_script_header_err(r, dobj->hfd, NULL);
473
    ap_scan_script_header_err(r, dobj->hfd, NULL);
474
 
474
475
    apr_table_setn(r->headers_out, "Content-Type", 
475
    const char * content_type = ap_make_content_type(r, r->content_type);
476
                   ap_make_content_type(r, r->content_type));
476
    if (content_type) {
477
        apr_table_setn(r->headers_out, "Content-Type", content_type);
478
    }
477
479
478
    rv = apr_file_gets(&urlbuff[0], urllen, dobj->hfd);           /* Read status  */
480
    rv = apr_file_gets(&urlbuff[0], urllen, dobj->hfd);           /* Read status  */
479
    if (rv != APR_SUCCESS) {
481
    if (rv != APR_SUCCESS) {
480
        /* XXX log message */
482
        /* XXX log message */
481
	return rv;
483
	return rv;
482
    }
484
    }
483
485
Lines 579-594 Link Here
579
            }
581
            }
580
            buf = apr_pstrcat(r->pool, CRLF, NULL);
582
            buf = apr_pstrcat(r->pool, CRLF, NULL);
581
            amt = strlen(buf);
583
            amt = strlen(buf);
582
            apr_file_write(hfd, buf, &amt);
584
            apr_file_write(hfd, buf, &amt);
583
            
585
            
584
            /* This case only occurs when the content is generated locally */
586
            /* This case only occurs when the content is generated locally */
585
            if (!apr_table_get(r->headers_out, "Content-Type") && r->content_type) {
587
            if (!apr_table_get(r->headers_out, "Content-Type") && r->content_type) {
586
                apr_table_setn(r->headers_out, "Content-Type", 
588
                const char * content_type = ap_make_content_type(r, r->content_type);
587
                               ap_make_content_type(r, r->content_type));
589
                if (content_type) {
590
                   apr_table_setn(r->headers_out, "Content-Type", content_type);
591
                }
588
            }
592
            }
589
        }
593
        }
590
        sprintf(statusbuf,"%d", r->status);
594
        sprintf(statusbuf,"%d", r->status);
591
        buf = apr_pstrcat(r->pool, statusbuf, CRLF, NULL);
595
        buf = apr_pstrcat(r->pool, statusbuf, CRLF, NULL);
592
        amt = strlen(buf);
596
        amt = strlen(buf);
593
        apr_file_write(hfd, buf, &amt);
597
        apr_file_write(hfd, buf, &amt);
594
598
(-)orig-httpd-2.0.43/modules/http/http_protocol.c (-5 / +18 lines)
Lines 1113-1126 Link Here
1113
#if APR_CHARSET_EBCDIC
1113
#if APR_CHARSET_EBCDIC
1114
    char *headfield;
1114
    char *headfield;
1115
    apr_size_t len;
1115
    apr_size_t len;
1116
    apr_size_t name_len;
1116
    apr_size_t name_len;
1117
    apr_size_t val_len;
1117
    apr_size_t val_len;
1118
    char *next;
1118
    char *next;
1119
1119
1120
    if (!fieldval) {
1121
      /* Header not set to anything useful; just skip it */
1122
      return 1;
1123
    }
1124
1120
    name_len = strlen(fieldname);
1125
    name_len = strlen(fieldname);
1121
    val_len = strlen(fieldval);
1126
    val_len = strlen(fieldval);
1122
    len = name_len + val_len + 4; /* 4 for ": " plus CRLF */
1127
    len = name_len + val_len + 4; /* 4 for ": " plus CRLF */
1123
    headfield = (char *)apr_palloc(h->pool, len + 1);
1128
    headfield = (char *)apr_palloc(h->pool, len + 1);
1124
    memcpy(headfield, fieldname, name_len);
1129
    memcpy(headfield, fieldname, name_len);
1125
    next = headfield + name_len;
1130
    next = headfield + name_len;
1126
    *next++ = ':';
1131
    *next++ = ':';
Lines 1131-1144 Link Here
1131
    *next++ = LF;
1136
    *next++ = LF;
1132
    *next = 0;
1137
    *next = 0;
1133
    ap_xlate_proto_to_ascii(headfield, len);
1138
    ap_xlate_proto_to_ascii(headfield, len);
1134
    apr_brigade_write(h->bb, NULL, NULL, headfield, len);
1139
    apr_brigade_write(h->bb, NULL, NULL, headfield, len);
1135
#else
1140
#else
1136
    struct iovec vec[4];
1141
    struct iovec vec[4];
1137
    struct iovec *v = vec;
1142
    struct iovec *v = vec;
1143
    if (!fieldval) {
1144
      /* Header not set to anything useful; just skip it */
1145
      return 1;
1146
    }
1147
1138
    v->iov_base = (void *)fieldname;
1148
    v->iov_base = (void *)fieldname;
1139
    v->iov_len = strlen(fieldname);
1149
    v->iov_len = strlen(fieldname);
1140
    v++;
1150
    v++;
1141
    v->iov_base = ": ";
1151
    v->iov_base = ": ";
1142
    v->iov_len = sizeof(": ") - 1;
1152
    v->iov_len = sizeof(": ") - 1;
1143
    v++;
1153
    v++;
1144
    v->iov_base = (void *)fieldval;
1154
    v->iov_base = (void *)fieldval;
Lines 1495-1509 Link Here
1495
    conn_rec *c = r->connection;
1505
    conn_rec *c = r->connection;
1496
    const char *clheader;
1506
    const char *clheader;
1497
    const char *protocol;
1507
    const char *protocol;
1498
    apr_bucket *e;
1508
    apr_bucket *e;
1499
    apr_bucket_brigade *b2;
1509
    apr_bucket_brigade *b2;
1500
    header_struct h;
1510
    header_struct h;
1501
    header_filter_ctx *ctx = f->ctx;
1511
    header_filter_ctx *ctx = f->ctx;
1502
1512
    const char * content_type;
1513
    
1503
    AP_DEBUG_ASSERT(!r->main);
1514
    AP_DEBUG_ASSERT(!r->main);
1504
1515
1505
    if (r->header_only) {
1516
    if (r->header_only) {
1506
        if (!ctx) {
1517
        if (!ctx) {
1507
            ctx = f->ctx = apr_pcalloc(r->pool, sizeof(header_filter_ctx));
1518
            ctx = f->ctx = apr_pcalloc(r->pool, sizeof(header_filter_ctx));
1508
        }
1519
        }
1509
        else if (ctx->headers_sent) {
1520
        else if (ctx->headers_sent) {
Lines 1567-1582 Link Here
1567
    ap_set_keepalive(r);
1578
    ap_set_keepalive(r);
1568
1579
1569
    if (r->chunked) {
1580
    if (r->chunked) {
1570
        apr_table_mergen(r->headers_out, "Transfer-Encoding", "chunked");
1581
        apr_table_mergen(r->headers_out, "Transfer-Encoding", "chunked");
1571
        apr_table_unset(r->headers_out, "Content-Length");
1582
        apr_table_unset(r->headers_out, "Content-Length");
1572
    }
1583
    }
1573
1584
1574
    apr_table_setn(r->headers_out, "Content-Type", 
1585
    content_type = ap_make_content_type(r, r->content_type);
1575
                   ap_make_content_type(r, r->content_type));
1586
    if (content_type) {
1587
      apr_table_setn(r->headers_out, "Content-Type", content_type);
1588
    }
1576
1589
1577
    if (r->content_encoding) {
1590
    if (r->content_encoding) {
1578
        apr_table_setn(r->headers_out, "Content-Encoding",
1591
        apr_table_setn(r->headers_out, "Content-Encoding",
1579
                       r->content_encoding);
1592
                       r->content_encoding);
1580
    }
1593
    }
1581
1594
1582
    if (!apr_is_empty_array(r->content_languages)) {
1595
    if (!apr_is_empty_array(r->content_languages)) {
Lines 2843-2858 Link Here
2843
            ap_set_content_type(r, apr_pstrcat(r->pool, "multipart",
2856
            ap_set_content_type(r, apr_pstrcat(r->pool, "multipart",
2844
                                               use_range_x(r) ? "/x-" : "/",
2857
                                               use_range_x(r) ? "/x-" : "/",
2845
                                               "byteranges; boundary=",
2858
                                               "byteranges; boundary=",
2846
                                               ctx->boundary, NULL));
2859
                                               ctx->boundary, NULL));
2847
2860
2848
            ctx->bound_head = apr_pstrcat(r->pool,
2861
            ctx->bound_head = apr_pstrcat(r->pool,
2849
                                    CRLF "--", ctx->boundary,
2862
                                    CRLF "--", ctx->boundary,
2850
                                    CRLF "Content-type: ",
2863
                                    orig_ct ? CRLF "Content-type: " : "",
2851
                                    orig_ct,
2864
                                    orig_ct ? orig_ct : "",
2852
                                    CRLF "Content-range: bytes ",
2865
                                    CRLF "Content-range: bytes ",
2853
                                    NULL);
2866
                                    NULL);
2854
            ap_xlate_proto_to_ascii(ctx->bound_head, strlen(ctx->bound_head));
2867
            ap_xlate_proto_to_ascii(ctx->bound_head, strlen(ctx->bound_head));
2855
        }
2868
        }
2856
    }
2869
    }
2857
2870
2858
    /* We can't actually deal with byte-ranges until we have the whole brigade
2871
    /* We can't actually deal with byte-ranges until we have the whole brigade
(-)orig-httpd-2.0.43/modules/mappers/mod_negotiation.c (-2 / +6 lines)
Lines 1179-1192 Link Here
1179
1179
1180
        /* 
1180
        /* 
1181
         * ###: be warned, the _default_ content type is already
1181
         * ###: be warned, the _default_ content type is already
1182
         * picked up here!  If we failed the subrequest, or don't 
1182
         * picked up here!  If we failed the subrequest, or don't 
1183
         * know what we are serving, then continue.
1183
         * know what we are serving, then continue.
1184
         */
1184
         */
1185
        if (sub_req->status != HTTP_OK || (!sub_req->content_type)) {
1185
        if (sub_req->status != HTTP_OK || (!sub_req->content_type)) {
1186
	  /* XXX This seems to be a problem if default types are
1187
             allowed to be null... */
1186
            ap_destroy_sub_req(sub_req);
1188
            ap_destroy_sub_req(sub_req);
1187
            continue;
1189
            continue;
1188
        }
1190
        }
1189
1191
1190
        /* If it's a map file, we use that instead of the map
1192
        /* If it's a map file, we use that instead of the map
1191
         * we're building...
1193
         * we're building...
1192
         */
1194
         */
Lines 1210-1225 Link Here
1210
        if (sub_req->content_encoding) {
1212
        if (sub_req->content_encoding) {
1211
            mime_info.content_encoding = sub_req->content_encoding;
1213
            mime_info.content_encoding = sub_req->content_encoding;
1212
        }
1214
        }
1213
        if (sub_req->content_languages) {
1215
        if (sub_req->content_languages) {
1214
            mime_info.content_languages = sub_req->content_languages;
1216
            mime_info.content_languages = sub_req->content_languages;
1215
        }
1217
        }
1216
1218
1217
        get_entry(neg->pool, &accept_info, sub_req->content_type);
1219
        if (sub_req->content_type) {
1218
        set_mime_fields(&mime_info, &accept_info);
1220
	  get_entry(neg->pool, &accept_info, sub_req->content_type);
1221
	  set_mime_fields(&mime_info, &accept_info);
1222
	}
1219
1223
1220
        new_var = apr_array_push(neg->avail_vars);
1224
        new_var = apr_array_push(neg->avail_vars);
1221
        memcpy(new_var, (void *) &mime_info, sizeof(var_rec));
1225
        memcpy(new_var, (void *) &mime_info, sizeof(var_rec));
1222
1226
1223
        neg->count_multiviews_variants++;
1227
        neg->count_multiviews_variants++;
1224
1228
1225
        clean_var_rec(&mime_info);
1229
        clean_var_rec(&mime_info);
(-)orig-httpd-2.0.43/modules/metadata/mod_expires.c (+2 lines)
Lines 447-460 Link Here
447
     * with a NULL key will SEGV us
447
     * with a NULL key will SEGV us
448
     *
448
     *
449
     * I still don't know *why* r->content_type would ever be NULL, this
449
     * I still don't know *why* r->content_type would ever be NULL, this
450
     * is possibly a result of fixups being called in many different
450
     * is possibly a result of fixups being called in many different
451
     * places.  Fixups is probably the wrong place to be doing all this
451
     * places.  Fixups is probably the wrong place to be doing all this
452
     * work...  Bah.
452
     * work...  Bah.
453
     *
453
     *
454
     * XXX r->content_type could be null if there is no DefaultType directive.
455
     *
454
     * Changed as of 08.Jun.96 don't DECLINE, look for an ExpiresDefault.
456
     * Changed as of 08.Jun.96 don't DECLINE, look for an ExpiresDefault.
455
     */
457
     */
456
    if (r->content_type == NULL)
458
    if (r->content_type == NULL)
457
        code = NULL;
459
        code = NULL;
458
    else
460
    else
459
        code = (char *) apr_table_get(conf->expiresbytype, 
461
        code = (char *) apr_table_get(conf->expiresbytype, 
460
		ap_field_noparam(r->pool, r->content_type));
462
		ap_field_noparam(r->pool, r->content_type));
(-)orig-httpd-2.0.43/modules/metadata/mod_mime_magic.c (-2 / +1 lines)
Lines 842-857 Link Here
842
	/* XXX: this could be done at config time I'm sure... but I'm
842
	/* XXX: this could be done at config time I'm sure... but I'm
843
	 * confused by all this magic_rsl stuff. -djg */
843
	 * confused by all this magic_rsl stuff. -djg */
844
	ap_str_tolower(tmp);
844
	ap_str_tolower(tmp);
845
	r->content_encoding = tmp;
845
	r->content_encoding = tmp;
846
    }
846
    }
847
847
848
    /* detect memory allocation or other errors */
848
    /* detect memory allocation or other errors */
849
    if (!r->content_type ||
849
    if (state == rsl_encoding && !r->content_encoding) {
850
	(state == rsl_encoding && !r->content_encoding)) {
851
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
850
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
852
                      MODNAME ": unexpected state %d; could be caused by bad "
851
                      MODNAME ": unexpected state %d; could be caused by bad "
853
                      "data in magic file",
852
                      "data in magic file",
854
                      state);
853
                      state);
855
	return HTTP_INTERNAL_SERVER_ERROR;
854
	return HTTP_INTERNAL_SERVER_ERROR;
856
    }
855
    }
857
856
(-)orig-httpd-2.0.43/modules/proxy/proxy_ftp.c (-1 / +2 lines)
Lines 1731-1745 Link Here
1731
            apr_table_setn(r->headers_out, "Content-Length", size);
1731
            apr_table_setn(r->headers_out, "Content-Length", size);
1732
            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
1732
            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
1733
                         "proxy: FTP: Content-Length set to %s", size);
1733
                         "proxy: FTP: Content-Length set to %s", size);
1734
        }
1734
        }
1735
    }
1735
    }
1736
    apr_table_setn(r->headers_out, "Content-Type", r->content_type);
1736
    apr_table_setn(r->headers_out, "Content-Type", r->content_type);
1737
    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
1737
    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
1738
                 "proxy: FTP: Content-Type set to %s", r->content_type);
1738
                 "proxy: FTP: Content-Type set to %s",
1739
		 r->content_type ? r->content_type : "nothing");
1739
1740
1740
#if defined(USE_MDTM) && (defined(HAVE_TIMEGM) || defined(HAVE_GMTOFF))
1741
#if defined(USE_MDTM) && (defined(HAVE_TIMEGM) || defined(HAVE_GMTOFF))
1741
    if (mtime != 0L) {
1742
    if (mtime != 0L) {
1742
        char datestr[APR_RFC822_DATE_LEN];
1743
        char datestr[APR_RFC822_DATE_LEN];
1743
        apr_rfc822_date(datestr, mtime);
1744
        apr_rfc822_date(datestr, mtime);
1744
        apr_table_set(r->headers_out, "Last-Modified", datestr);
1745
        apr_table_set(r->headers_out, "Last-Modified", datestr);
1745
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
1746
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
(-)orig-httpd-2.0.43/server/config.c (-2 / +4 lines)
Lines 378-392 Link Here
378
    result = ap_invoke_filter_init(r->output_filters);
378
    result = ap_invoke_filter_init(r->output_filters);
379
    if (result != OK) {
379
    if (result != OK) {
380
        return result;
380
        return result;
381
    }
381
    }
382
382
383
    if (!r->handler) {
383
    if (!r->handler) {
384
        handler = r->content_type ? r->content_type : ap_default_type(r);
384
        handler = r->content_type ? r->content_type : ap_default_type(r);
385
        if ((p=ap_strchr_c(handler, ';')) != NULL) {
385
        if (handler && (p=ap_strchr_c(handler, ';')) != NULL) {
386
            char *new_handler = (char *)apr_pmemdup(r->pool, handler,
386
            char *new_handler = (char *)apr_pmemdup(r->pool, handler,
387
                                                    p - handler + 1);
387
                                                    p - handler + 1);
388
            char *p2 = new_handler + (p - handler);
388
            char *p2 = new_handler + (p - handler);
389
            handler = new_handler;
389
            handler = new_handler;
390
390
391
            /* MIME type arguments */
391
            /* MIME type arguments */
392
            while (p2 > handler && p2[-1] == ' ')
392
            while (p2 > handler && p2[-1] == ' ')
Lines 394-408 Link Here
394
394
395
            *p2='\0';
395
            *p2='\0';
396
        }
396
        }
397
397
398
        r->handler = handler;
398
        r->handler = handler;
399
    }
399
    }
400
400
401
    result = ap_run_handler(r);
401
    if (r->handler) {
402
      result = ap_run_handler(r);
403
    }
402
404
403
    r->handler = old_handler;
405
    r->handler = old_handler;
404
406
405
    if (result == DECLINED && r->handler && r->filename) {
407
    if (result == DECLINED && r->handler && r->filename) {
406
        ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
408
        ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
407
            "handler \"%s\" not found for: %s", r->handler, r->filename);
409
            "handler \"%s\" not found for: %s", r->handler, r->filename);
408
    }
410
    }
(-)orig-httpd-2.0.43/server/core.c (-1 / +1 lines)
Lines 657-671 Link Here
657
    core_dir_config *conf;
657
    core_dir_config *conf;
658
658
659
    conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
659
    conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
660
                                                   &core_module);
660
                                                   &core_module);
661
661
662
    return conf->ap_default_type
662
    return conf->ap_default_type
663
               ? conf->ap_default_type
663
               ? conf->ap_default_type
664
               : DEFAULT_CONTENT_TYPE;
664
               : NULL;
665
}
665
}
666
666
667
AP_DECLARE(const char *) ap_document_root(request_rec *r) /* Don't use this! */
667
AP_DECLARE(const char *) ap_document_root(request_rec *r) /* Don't use this! */
668
{
668
{
669
    core_server_config *conf;
669
    core_server_config *conf;
670
670
671
    conf = (core_server_config *)ap_get_module_config(r->server->module_config,
671
    conf = (core_server_config *)ap_get_module_config(r->server->module_config,
(-)orig-httpd-2.0.43/server/protocol.c (+5 lines)
Lines 133-160 Link Here
133
    charset_pattern = apr_strmatch_precompile(pool, "charset=", 0);
133
    charset_pattern = apr_strmatch_precompile(pool, "charset=", 0);
134
}
134
}
135
135
136
/*
136
/*
137
 * Builds the content-type that should be sent to the client from the
137
 * Builds the content-type that should be sent to the client from the
138
 * content-type specified.  The following rules are followed:
138
 * content-type specified.  The following rules are followed:
139
 *    - if type is NULL, type is set to ap_default_type(r)
139
 *    - if type is NULL, type is set to ap_default_type(r)
140
 *    - if type is still NULL, return NULL
140
 *    - if charset adding is disabled, stop processing and return type.
141
 *    - if charset adding is disabled, stop processing and return type.
141
 *    - then, if there are no parameters on type, add the default charset
142
 *    - then, if there are no parameters on type, add the default charset
142
 *    - return type
143
 *    - return type
143
 */
144
 */
144
AP_DECLARE(const char *)ap_make_content_type(request_rec *r, const char *type)
145
AP_DECLARE(const char *)ap_make_content_type(request_rec *r, const char *type)
145
{
146
{
146
    const apr_strmatch_pattern **pcset;
147
    const apr_strmatch_pattern **pcset;
147
    core_dir_config *conf =
148
    core_dir_config *conf =
148
        (core_dir_config *)ap_get_module_config(r->per_dir_config,
149
        (core_dir_config *)ap_get_module_config(r->per_dir_config,
149
                                                &core_module);
150
                                                &core_module);
150
    apr_size_t type_len;
151
    apr_size_t type_len;
151
152
152
    if (!type) {
153
    if (!type) {
153
        type = ap_default_type(r);
154
        type = ap_default_type(r);
155
    }
156
157
    if (!type) {
158
        return NULL;
154
    }
159
    }
155
160
156
    if (conf->add_default_charset != ADD_DEFAULT_CHARSET_ON) {
161
    if (conf->add_default_charset != ADD_DEFAULT_CHARSET_ON) {
157
        return type;
162
        return type;
158
    }
163
    }
159
164
160
    type_len = strlen(type);
165
    type_len = strlen(type);

Return to bug 13986