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

(-)httpd-2.2.2.orig/include/http_core.h (-2 / +3 lines)
Lines 507-514 Link Here
507
#ifdef RLIMIT_NPROC
507
#ifdef RLIMIT_NPROC
508
    struct rlimit *limit_nproc;
508
    struct rlimit *limit_nproc;
509
#endif
509
#endif
510
    apr_off_t limit_req_body;      /* limit on bytes in request msg body */
510
    apr_off_t limit_req_body;       /* limit on bytes in request msg body */
511
    long limit_xml_body;           /* limit on bytes in XML request msg body */
511
    apr_off_t limit_resp_file_size; /* largest file we are willing to send */
512
    long limit_xml_body;            /* limit on bytes in XML request msg body */
512
513
513
    /* logging options */
514
    /* logging options */
514
515
(-)httpd-2.2.2.orig/server/core.c (-1 / +31 lines)
Lines 135-140 Link Here
135
135
136
    conf->limit_req_body = AP_LIMIT_REQ_BODY_UNSET;
136
    conf->limit_req_body = AP_LIMIT_REQ_BODY_UNSET;
137
    conf->limit_xml_body = AP_LIMIT_UNSET;
137
    conf->limit_xml_body = AP_LIMIT_UNSET;
138
    conf->limit_resp_file_size = AP_MAX_SENDFILE;
138
    conf->sec_file = apr_array_make(a, 2, sizeof(ap_conf_vector_t *));
139
    conf->sec_file = apr_array_make(a, 2, sizeof(ap_conf_vector_t *));
139
140
140
    conf->server_signature = srv_sig_unset;
141
    conf->server_signature = srv_sig_unset;
Lines 2885-2890 Link Here
2885
    return NULL;
2886
    return NULL;
2886
}
2887
}
2887
2888
2889
static const char *set_limit_resp_file_size(cmd_parms *cmd, void *conf_,
2890
                                      const char *arg)
2891
{
2892
    core_dir_config *conf = conf_;
2893
    const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT);
2894
    char *errp;
2895
2896
    if (err != NULL) {
2897
        return err;
2898
    }
2899
2900
    if (APR_SUCCESS != apr_strtoff(&conf->limit_resp_file_size, arg, &errp, 10)) {
2901
        return "LimitResponseFileSize argument is not parsable.";
2902
    }
2903
    if (*errp || conf->limit_resp_file_size < 0) {
2904
        return "LimitResponseFileSize requires a non-negative integer.";
2905
    }
2906
2907
    return NULL;
2908
}
2909
2888
static const char *set_limit_xml_req_body(cmd_parms *cmd, void *conf_,
2910
static const char *set_limit_xml_req_body(cmd_parms *cmd, void *conf_,
2889
                                          const char *arg)
2911
                                          const char *arg)
2890
{
2912
{
Lines 3327-3332 Link Here
3327
AP_INIT_TAKE1("LimitRequestBody", set_limit_req_body,
3349
AP_INIT_TAKE1("LimitRequestBody", set_limit_req_body,
3328
  (void*)APR_OFFSETOF(core_dir_config, limit_req_body), OR_ALL,
3350
  (void*)APR_OFFSETOF(core_dir_config, limit_req_body), OR_ALL,
3329
  "Limit (in bytes) on maximum size of request message body"),
3351
  "Limit (in bytes) on maximum size of request message body"),
3352
AP_INIT_TAKE1("LimitResponseFileSize", set_limit_resp_file_size,
3353
  (void*)APR_OFFSETOF(core_dir_config, limit_resp_file_size), OR_ALL,
3354
  "Limit (in bytes) on maximum size of a static file to be sent as a response"),
3330
AP_INIT_TAKE1("LimitXMLRequestBody", set_limit_xml_req_body, NULL, OR_ALL,
3355
AP_INIT_TAKE1("LimitXMLRequestBody", set_limit_xml_req_body, NULL, OR_ALL,
3331
              "Limit (in bytes) on maximum size of an XML-based request "
3356
              "Limit (in bytes) on maximum size of an XML-based request "
3332
              "body"),
3357
              "body"),
Lines 3646-3651 Link Here
3646
            return HTTP_FORBIDDEN;
3671
            return HTTP_FORBIDDEN;
3647
        }
3672
        }
3648
3673
3674
        if(d->limit_resp_file_size && d->limit_resp_file_size < r->finfo.size) {
3675
            ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r,
3676
                "file size is larger than LimitResponseFileSize: %s", r->filename);
3677
            return HTTP_INTERNAL_SERVER_ERROR;
3678
        }
3679
        
3649
        ap_update_mtime(r, r->finfo.mtime);
3680
        ap_update_mtime(r, r->finfo.mtime);
3650
        ap_set_last_modified(r);
3681
        ap_set_last_modified(r);
3651
        ap_set_etag(r);
3682
        ap_set_etag(r);
Lines 3976-3979 Link Here
3976
    core_cmds,                    /* command apr_table_t */
4007
    core_cmds,                    /* command apr_table_t */
3977
    register_hooks                /* register hooks */
4008
    register_hooks                /* register hooks */
3978
};
4009
};
3979

Return to bug 39807