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

(-)a/modules/http/http_protocol.c (+70 lines)
Lines 1101-1106 AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error) Link Here
1101
    int idx = ap_index_of_response(status);
1101
    int idx = ap_index_of_response(status);
1102
    char *custom_response;
1102
    char *custom_response;
1103
    const char *location = apr_table_get(r->headers_out, "Location");
1103
    const char *location = apr_table_get(r->headers_out, "Location");
1104
	/* solo */
1105
	server_rec * ss = r->server;
1106
1107
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1108
				 "ap_send_error_response: start");
1109
	/* */
1104
1110
1105
    /* At this point, we are starting the response over, so we have to reset
1111
    /* At this point, we are starting the response over, so we have to reset
1106
     * this value.
1112
     * this value.
Lines 1121-1126 AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error) Link Here
1121
     * former.
1127
     * former.
1122
     */
1128
     */
1123
    if (location == NULL) {
1129
    if (location == NULL) {
1130
		/* solo */
1131
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1132
					 "ap_send_error_response: (location == NULL) is TRUE.");
1133
		/* */
1124
        location = apr_table_get(r->err_headers_out, "Location");
1134
        location = apr_table_get(r->err_headers_out, "Location");
1125
    }
1135
    }
1126
    /* We need to special-case the handling of 204 and 304 responses,
1136
    /* We need to special-case the handling of 204 and 304 responses,
Lines 1128-1143 AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error) Link Here
1128
     * message body.  Note that being assbackwards here is not an option.
1138
     * message body.  Note that being assbackwards here is not an option.
1129
     */
1139
     */
1130
    if (status == HTTP_NOT_MODIFIED) {
1140
    if (status == HTTP_NOT_MODIFIED) {
1141
		/* solo */
1142
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1143
					 "ap_send_error_response: (status == HTTP_NOT_MODIFIED) is TRUE.");
1144
		/* */
1131
        ap_finalize_request_protocol(r);
1145
        ap_finalize_request_protocol(r);
1132
        return;
1146
        return;
1133
    }
1147
    }
1134
1148
1135
    if (status == HTTP_NO_CONTENT) {
1149
    if (status == HTTP_NO_CONTENT) {
1150
		/* solo */
1151
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1152
					 "ap_send_error_response: (status == HTTP_NOT_CONTENT) is TRUE.");
1153
		/* */
1136
        ap_finalize_request_protocol(r);
1154
        ap_finalize_request_protocol(r);
1137
        return;
1155
        return;
1138
    }
1156
    }
1139
1157
1140
    if (!r->assbackwards) {
1158
    if (!r->assbackwards) {
1159
		/* solo */
1160
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1161
					 "ap_send_error_response: (!r->assbackwards) is TRUE.");
1162
		/* */
1141
        apr_table_t *tmp = r->headers_out;
1163
        apr_table_t *tmp = r->headers_out;
1142
1164
1143
        /* For all HTTP/1.x responses for which we generate the message,
1165
        /* For all HTTP/1.x responses for which we generate the message,
Lines 1150-1159 AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error) Link Here
1150
        apr_table_clear(r->err_headers_out);
1172
        apr_table_clear(r->err_headers_out);
1151
1173
1152
        if (ap_is_HTTP_REDIRECT(status) || (status == HTTP_CREATED)) {
1174
        if (ap_is_HTTP_REDIRECT(status) || (status == HTTP_CREATED)) {
1175
			/* solo */
1176
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1177
						 "ap_send_error_response: (ap_is_HTTP_REDIRECT(status) || (status == HTTP_CREATED)) is TRUE.");
1178
			/* */
1153
            if ((location != NULL) && *location) {
1179
            if ((location != NULL) && *location) {
1180
				/* solo */
1181
				ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1182
							 "ap_send_error_response: ((location != NULL) && *location) is TRUE.");
1183
				/* */
1154
                apr_table_setn(r->headers_out, "Location", location);
1184
                apr_table_setn(r->headers_out, "Location", location);
1155
            }
1185
            }
1156
            else {
1186
            else {
1187
				/* solo */
1188
				ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1189
							 "ap_send_error_response: ((location != NULL) && *location) is FALSE.");
1190
				/* */
1157
                location = "";   /* avoids coredump when printing, below */
1191
                location = "";   /* avoids coredump when printing, below */
1158
            }
1192
            }
1159
        }
1193
        }
Lines 1164-1169 AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error) Link Here
1164
1198
1165
        if (apr_table_get(r->subprocess_env,
1199
        if (apr_table_get(r->subprocess_env,
1166
                          "suppress-error-charset") != NULL) {
1200
                          "suppress-error-charset") != NULL) {
1201
			/* solo */
1202
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1203
						 "ap_send_error_response: (apr_table_get(r->subprocess_env, \"suppress-error-charset\") != NULL) is TRUE.");
1204
			/* */
1167
            core_request_config *request_conf =
1205
            core_request_config *request_conf =
1168
                        ap_get_module_config(r->request_config, &core_module);
1206
                        ap_get_module_config(r->request_config, &core_module);
1169
            request_conf->suppress_charset = 1; /* avoid adding default
1207
            request_conf->suppress_charset = 1; /* avoid adding default
Lines 1172-1192 AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error) Link Here
1172
            ap_set_content_type(r, "text/html");
1210
            ap_set_content_type(r, "text/html");
1173
        }
1211
        }
1174
        else {
1212
        else {
1213
			/* solo */
1214
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1215
						 "ap_send_error_response: (apr_table_get(r->subprocess_env, \"suppress-error-charset\") != NULL) is FALSE.");
1216
			/* */
1175
            ap_set_content_type(r, "text/html; charset=iso-8859-1");
1217
            ap_set_content_type(r, "text/html; charset=iso-8859-1");
1176
        }
1218
        }
1177
1219
1178
        if ((status == HTTP_METHOD_NOT_ALLOWED)
1220
        if ((status == HTTP_METHOD_NOT_ALLOWED)
1179
            || (status == HTTP_NOT_IMPLEMENTED)) {
1221
            || (status == HTTP_NOT_IMPLEMENTED)) {
1222
			/* solo */
1223
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1224
						 "ap_send_error_response: ((status == HTTP_METHOD_NOT_ALLOWED) || (status == HTTP_NOT_IMPLEMENTED)) is TRUE.");
1225
			/* */
1180
            apr_table_setn(r->headers_out, "Allow", make_allow(r));
1226
            apr_table_setn(r->headers_out, "Allow", make_allow(r));
1181
        }
1227
        }
1182
1228
1183
        if (r->header_only) {
1229
        if (r->header_only) {
1230
			/* solo */
1231
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1232
						 "ap_send_error_response: (r->header_only) is TRUE.");
1233
			/* */
1184
            ap_finalize_request_protocol(r);
1234
            ap_finalize_request_protocol(r);
1185
            return;
1235
            return;
1186
        }
1236
        }
1187
    }
1237
    }
1188
1238
1189
    if ((custom_response = ap_response_code_string(r, idx))) {
1239
    if ((custom_response = ap_response_code_string(r, idx))) {
1240
		/* solo */
1241
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1242
					 "ap_send_error_response: (custom_response = ap_response_code_string(r, idx)) is TRUE.");
1243
		/* */
1190
        /*
1244
        /*
1191
         * We have a custom response output. This should only be
1245
         * We have a custom response output. This should only be
1192
         * a text-string to write back. But if the ErrorDocument
1246
         * a text-string to write back. But if the ErrorDocument
Lines 1204-1209 AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error) Link Here
1204
         * it hasn't happened yet; we may never know if it fails.
1258
         * it hasn't happened yet; we may never know if it fails.
1205
         */
1259
         */
1206
        if (custom_response[0] == '\"') {
1260
        if (custom_response[0] == '\"') {
1261
			/* solo */
1262
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1263
						 "ap_send_error_response: (custom_response[0] == '\"') is TRUE.");
1264
			/* */
1207
            ap_rputs(custom_response + 1, r);
1265
            ap_rputs(custom_response + 1, r);
1208
            ap_finalize_request_protocol(r);
1266
            ap_finalize_request_protocol(r);
1209
            return;
1267
            return;
Lines 1223-1228 AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error) Link Here
1223
            && apr_isdigit(r->status_line[2])
1281
            && apr_isdigit(r->status_line[2])
1224
            && apr_isspace(r->status_line[3])
1282
            && apr_isspace(r->status_line[3])
1225
            && apr_isalnum(r->status_line[4])) {
1283
            && apr_isalnum(r->status_line[4])) {
1284
			/* solo */
1285
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1286
						 "ap_send_error_response: (r->status_line != NULL && strlen(r->status_line) > 4 && ...) is TRUE.");
1287
			/* */
1226
            title = r->status_line;
1288
            title = r->status_line;
1227
        }
1289
        }
1228
1290
Lines 1244-1249 AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error) Link Here
1244
                                 NULL);
1306
                                 NULL);
1245
1307
1246
        if (recursive_error) {
1308
        if (recursive_error) {
1309
			/* solo */
1310
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1311
						 "ap_send_error_response: (recursive_error) is TRUE.");
1312
			/* */
1247
            ap_rvputs_proto_in_ascii(r, "<p>Additionally, a ",
1313
            ap_rvputs_proto_in_ascii(r, "<p>Additionally, a ",
1248
                      status_lines[ap_index_of_response(recursive_error)],
1314
                      status_lines[ap_index_of_response(recursive_error)],
1249
                      "\nerror was encountered while trying to use an "
1315
                      "\nerror was encountered while trying to use an "
Lines 1253-1258 AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error) Link Here
1253
        ap_rvputs_proto_in_ascii(r, "</body></html>\n", NULL);
1319
        ap_rvputs_proto_in_ascii(r, "</body></html>\n", NULL);
1254
    }
1320
    }
1255
    ap_finalize_request_protocol(r);
1321
    ap_finalize_request_protocol(r);
1322
	/* solo */
1323
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
1324
				 "ap_send_error_response: END.");
1325
	/* */
1256
}
1326
}
1257
1327
1258
/*
1328
/*

Return to bug 11559