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; status='%d'", status);
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
/*
(-)a/modules/ssl/mod_ssl.c (+12 lines)
Lines 344-355 int ssl_init_ssl_connection(conn_rec *c) Link Here
344
    char *vhost_md5;
344
    char *vhost_md5;
345
    modssl_ctx_t *mctx;
345
    modssl_ctx_t *mctx;
346
346
347
	/* solo */
348
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, c,
349
				 "ssl_init_ssl_connection: START");
350
	/* */
347
    /*
351
    /*
348
     * Seed the Pseudo Random Number Generator (PRNG)
352
     * Seed the Pseudo Random Number Generator (PRNG)
349
     */
353
     */
350
    ssl_rand_seed(c->base_server, c->pool, SSL_RSCTX_CONNECT, "");
354
    ssl_rand_seed(c->base_server, c->pool, SSL_RSCTX_CONNECT, "");
351
355
352
    if (!sslconn) {
356
    if (!sslconn) {
357
		/* solo */
358
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, c,
359
					 "ssl_init_ssl_connection: (!sslconn) is TRUE");
360
		/* */
353
        sslconn = ssl_init_connection_ctx(c);
361
        sslconn = ssl_init_connection_ctx(c);
354
    }
362
    }
355
363
Lines 401-406 int ssl_init_ssl_connection(conn_rec *c) Link Here
401
409
402
    ssl_io_filter_init(c, ssl);
410
    ssl_io_filter_init(c, ssl);
403
411
412
	/* solo */
413
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, c,
414
				 "ssl_init_ssl_connection: END, return APR_SUCCESS");
415
	/* */
404
    return APR_SUCCESS;
416
    return APR_SUCCESS;
405
}
417
}
406
418
(-)a/modules/ssl/ssl_engine_io.c (-1 / +7 lines)
Lines 832-838 static apr_status_t ssl_filter_write(ap_filter_t *f, Link Here
832
 * request, and tack on an EOS bucket.
832
 * request, and tack on an EOS bucket.
833
 */
833
 */
834
#define HTTP_ON_HTTPS_PORT \
834
#define HTTP_ON_HTTPS_PORT \
835
    "GET /" CRLF
835
    "GET / HTTP/1.1" CRLF
836
836
837
#define HTTP_ON_HTTPS_PORT_BUCKET(alloc) \
837
#define HTTP_ON_HTTPS_PORT_BUCKET(alloc) \
838
    apr_bucket_immortal_create(HTTP_ON_HTTPS_PORT, \
838
    apr_bucket_immortal_create(HTTP_ON_HTTPS_PORT, \
Lines 868-873 static apr_status_t ssl_io_filter_error(ap_filter_t *f, Link Here
868
868
869
            /* fake the request line */
869
            /* fake the request line */
870
            bucket = HTTP_ON_HTTPS_PORT_BUCKET(f->c->bucket_alloc);
870
            bucket = HTTP_ON_HTTPS_PORT_BUCKET(f->c->bucket_alloc);
871
			/* solo */
872
            ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, f->c,
873
                         "ssl_io_filter_error: f->c->bucket_alloc='%s'", f->c->bucket_alloc);
874
            ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, f->c,
875
                         "ssl_io_filter_error: bucket->data='%s'", bucket->data);
876
			/* */
871
            break;
877
            break;
872
878
873
      default:
879
      default:
(-)a/server/protocol.c (+174 lines)
Lines 216-221 AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, Link Here
216
    apr_size_t bytes_handled = 0, current_alloc = 0;
216
    apr_size_t bytes_handled = 0, current_alloc = 0;
217
    char *pos, *last_char = *s;
217
    char *pos, *last_char = *s;
218
    int do_alloc = (*s == NULL), saw_eos = 0;
218
    int do_alloc = (*s == NULL), saw_eos = 0;
219
	/* solo */
220
	server_rec * ss = r->server;
221
222
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
223
				 "ap_rgetline_core: START");
224
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
225
				 "ap_rgetline_core: START, r->the_request='%s'", r->the_request);
226
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
227
				 "ap_rgetline_core: START, r->input_filters='%s'", r->input_filters);
228
	/* */
219
229
220
    /*
230
    /*
221
     * Initialize last_char as otherwise a random value will be compared
231
     * Initialize last_char as otherwise a random value will be compared
Lines 228-235 AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, Link Here
228
238
229
    for (;;) {
239
    for (;;) {
230
        apr_brigade_cleanup(bb);
240
        apr_brigade_cleanup(bb);
241
		/* solo */
242
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
243
					 "ap_rgetline_core: Post apr_brigade_cleanup(bb);");
244
		/* */
231
        rv = ap_get_brigade(r->input_filters, bb, AP_MODE_GETLINE,
245
        rv = ap_get_brigade(r->input_filters, bb, AP_MODE_GETLINE,
232
                            APR_BLOCK_READ, 0);
246
                            APR_BLOCK_READ, 0);
247
		/* solo */
248
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
249
					 "ap_rgetline_core: Post ap_get_brigade(r->input_filters, bb, ...); r->the_request='%s'", r->the_request);
250
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
251
					 "ap_rgetline_core: Post ap_get_brigade(r->input_filters, bb, ...); r->input_filters='%s'", r->input_filters);
252
		/* */
233
        if (rv != APR_SUCCESS) {
253
        if (rv != APR_SUCCESS) {
234
            return rv;
254
            return rv;
235
        }
255
        }
Lines 246-251 AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, Link Here
246
            const char *str;
266
            const char *str;
247
            apr_size_t len;
267
            apr_size_t len;
248
268
269
			/* solo */
270
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
271
						 "ap_rgetline_core: for (e = APR_BRIGADE_FIRST(bb);...;e = APR_BUCKET_NEXT(e)), *s='%s'", *s);
272
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
273
						 "ap_rgetline_core: for (e = APR_BRIGADE_FIRST(bb);...;e = APR_BUCKET_NEXT(e)), r->the_request='%s'", r->the_request);
274
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
275
						 "ap_rgetline_core: for (e = APR_BRIGADE_FIRST(bb);...;e = APR_BUCKET_NEXT(e)), r->pool='%s'", r->pool);
276
			/* */
249
            /* If we see an EOS, don't bother doing anything more. */
277
            /* If we see an EOS, don't bother doing anything more. */
250
            if (APR_BUCKET_IS_EOS(e)) {
278
            if (APR_BUCKET_IS_EOS(e)) {
251
                saw_eos = 1;
279
                saw_eos = 1;
Lines 256-261 AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, Link Here
256
            if (rv != APR_SUCCESS) {
284
            if (rv != APR_SUCCESS) {
257
                return rv;
285
                return rv;
258
            }
286
            }
287
			/* solo */
288
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
289
						 "ap_rgetline_core: apr_bucket_read(e, &str, &len, APR_BLOCK_READ); str='%s'", str);
290
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
291
						 "ap_rgetline_core: apr_bucket_read(e, &str, &len, APR_BLOCK_READ); len='%d'", len);
292
			/* */
259
293
260
            if (len == 0) {
294
            if (len == 0) {
261
                /* no use attempting a zero-byte alloc (hurts when
295
                /* no use attempting a zero-byte alloc (hurts when
Lines 269-279 AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, Link Here
269
            if (n < bytes_handled + len) {
303
            if (n < bytes_handled + len) {
270
                *read = bytes_handled;
304
                *read = bytes_handled;
271
                if (*s) {
305
                if (*s) {
306
					/* solo */
307
					ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
308
								 "ap_rgetline_core: (*s) is TRUE, *s='%s'", *s);
309
					ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
310
								 "ap_rgetline_core: (*s) is TRUE, r->the_request='%s'", r->the_request);
311
					/* */
272
                    /* ensure this string is NUL terminated */
312
                    /* ensure this string is NUL terminated */
273
                    if (bytes_handled > 0) {
313
                    if (bytes_handled > 0) {
274
                        (*s)[bytes_handled-1] = '\0';
314
                        (*s)[bytes_handled-1] = '\0';
275
                    }
315
                    }
276
                    else {
316
                    else {
317
					/* solo */
318
					ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
319
								 "ap_rgetline_core: (*s) is FALSE, *s='%s'", *s);
320
					ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
321
								 "ap_rgetline_core: (*s) is FALSE, r->the_request='%s'", r->the_request);
322
					/* */
277
                        (*s)[0] = '\0';
323
                        (*s)[0] = '\0';
278
                    }
324
                    }
279
                }
325
                }
Lines 282-296 AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, Link Here
282
328
283
            /* Do we have to handle the allocation ourselves? */
329
            /* Do we have to handle the allocation ourselves? */
284
            if (do_alloc) {
330
            if (do_alloc) {
331
				/* solo */
332
				ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
333
							 "ap_rgetline_core: (do_alloc) is TRUE, r->the_request='%s'", r->the_request);
334
				/* */
285
                /* We'll assume the common case where one bucket is enough. */
335
                /* We'll assume the common case where one bucket is enough. */
286
                if (!*s) {
336
                if (!*s) {
337
					/* solo */
338
					ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
339
								 "ap_rgetline_core: (!*s) is TRUE, *s='%s'", *s);
340
					ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
341
								 "ap_rgetline_core: (!*s) is TRUE, r->the_request='%s'", r->the_request);
342
					ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
343
								 "ap_rgetline_core: (!*s) is TRUE, r->pool='%s'", r->pool);
344
					/* */
287
                    current_alloc = len;
345
                    current_alloc = len;
288
                    if (current_alloc < MIN_LINE_ALLOC) {
346
                    if (current_alloc < MIN_LINE_ALLOC) {
347
						/* solo */
348
						ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
349
									 "ap_rgetline_core: (current_alloc < MIN_LINE_ALLOC) is TRUE, r->the_request='%s'", r->the_request);
350
						/* */
289
                        current_alloc = MIN_LINE_ALLOC;
351
                        current_alloc = MIN_LINE_ALLOC;
290
                    }
352
                    }
291
                    *s = apr_palloc(r->pool, current_alloc);
353
                    *s = apr_palloc(r->pool, current_alloc);
292
                }
354
                }
293
                else if (bytes_handled + len > current_alloc) {
355
                else if (bytes_handled + len > current_alloc) {
356
					/* solo */
357
					ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
358
								 "ap_rgetline_core: (*s) is FALSE, (bytes_handled + len > current_alloc) is TRUE, *s='%s'", *s);
359
					ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
360
								 "ap_rgetline_core: (*s) is FALSE, (bytes_handled + len > current_alloc) is TRUE, r->the_request='%s'", r->the_request);
361
					/* */
294
                    /* Increase the buffer size */
362
                    /* Increase the buffer size */
295
                    apr_size_t new_size = current_alloc * 2;
363
                    apr_size_t new_size = current_alloc * 2;
296
                    char *new_buffer;
364
                    char *new_buffer;
Lines 305-312 AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, Link Here
305
                    memcpy(new_buffer, *s, bytes_handled);
373
                    memcpy(new_buffer, *s, bytes_handled);
306
                    current_alloc = new_size;
374
                    current_alloc = new_size;
307
                    *s = new_buffer;
375
                    *s = new_buffer;
376
					/* solo */
377
					ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
378
								 "ap_rgetline_core: (*s) is FALSE, (bytes_handled + len > current_alloc) is TRUE, *s = new_buffer, *s='%s'", *s);
379
					ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
380
								 "ap_rgetline_core: (*s) is FALSE, (bytes_handled + len > current_alloc) is TRUE, r->the_request='%s'", r->the_request);
381
					/* */
308
                }
382
                }
309
            }
383
            }
384
			/* solo */
385
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
386
						 "ap_rgetline_core: Post (do_alloc), *s='%s'", *s);
387
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
388
						 "ap_rgetline_core: Post (do_alloc), r->the_request='%s'", r->the_request);
389
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
390
						 "ap_rgetline_core: Post (do_alloc), bytes_handled='%d'", bytes_handled);
391
			/* */
310
392
311
            /* Just copy the rest of the data to the end of the old buffer. */
393
            /* Just copy the rest of the data to the end of the old buffer. */
312
            pos = *s + bytes_handled;
394
            pos = *s + bytes_handled;
Lines 315-324 AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, Link Here
315
397
316
            /* We've now processed that new data - update accordingly. */
398
            /* We've now processed that new data - update accordingly. */
317
            bytes_handled += len;
399
            bytes_handled += len;
400
			/* solo */
401
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
402
						 "ap_rgetline_core: Post 2 (do_alloc), *s='%s'", *s);
403
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
404
						 "ap_rgetline_core: Post 2 (do_alloc), r->the_request='%s'", r->the_request);
405
			/* */
318
        }
406
        }
319
407
320
        /* If we got a full line of input, stop reading */
408
        /* If we got a full line of input, stop reading */
321
        if (last_char && (*last_char == APR_ASCII_LF)) {
409
        if (last_char && (*last_char == APR_ASCII_LF)) {
410
			/* solo */
411
			ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
412
						 "ap_rgetline_core: (last_char && (*last_char == APR_ASCII_LF)) is TRUE, r->the_request='%s'", r->the_request);
413
			/* */
322
            break;
414
            break;
323
        }
415
        }
324
    }
416
    }
Lines 326-341 AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, Link Here
326
    /* Now NUL-terminate the string at the end of the line;
418
    /* Now NUL-terminate the string at the end of the line;
327
     * if the last-but-one character is a CR, terminate there */
419
     * if the last-but-one character is a CR, terminate there */
328
    if (last_char > *s && last_char[-1] == APR_ASCII_CR) {
420
    if (last_char > *s && last_char[-1] == APR_ASCII_CR) {
421
		/* solo */
422
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
423
					 "ap_rgetline_core: (last_char > *s && last_char[-1] == APR_ASCII_CR) is TRUE, r->the_request='%s'", r->the_request);
424
		/* */
329
        last_char--;
425
        last_char--;
330
    }
426
    }
331
    *last_char = '\0';
427
    *last_char = '\0';
332
    bytes_handled = last_char - *s;
428
    bytes_handled = last_char - *s;
429
	/* solo */
430
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
431
				 "ap_rgetline_core: Post (last_char > *s && last_char[-1] == APR_ASCII_CR), r->the_request='%s'", r->the_request);
432
	/* */
333
433
334
    /* If we're folding, we have more work to do.
434
    /* If we're folding, we have more work to do.
335
     *
435
     *
336
     * Note that if an EOS was seen, we know we can't have another line.
436
     * Note that if an EOS was seen, we know we can't have another line.
337
     */
437
     */
338
    if (fold && bytes_handled && !saw_eos) {
438
    if (fold && bytes_handled && !saw_eos) {
439
		/* solo */
440
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
441
					 "ap_rgetline_core: (fold && bytes_handled && !saw_eos) is TRUE, r->the_request='%s'", r->the_request);
442
		/* */
339
        for (;;) {
443
        for (;;) {
340
            const char *str;
444
            const char *str;
341
            apr_size_t len;
445
            apr_size_t len;
Lines 380-387 AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, Link Here
380
             */
484
             */
381
            c = *str;
485
            c = *str;
382
            if (c == APR_ASCII_BLANK || c == APR_ASCII_TAB) {
486
            if (c == APR_ASCII_BLANK || c == APR_ASCII_TAB) {
487
				/* solo */
488
				ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
489
							 "ap_rgetline_core: (c == APR_ASCII_BLANK || c == APR_ASCII_TAB) is TRUE, r->the_request='%s'", r->the_request);
490
				/* */
383
                /* Do we have enough space? We may be full now. */
491
                /* Do we have enough space? We may be full now. */
384
                if (bytes_handled >= n) {
492
                if (bytes_handled >= n) {
493
					/* solo */
494
					ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
495
								 "ap_rgetline_core: (bytes_handled >= n) is TRUE, r->the_request='%s'", r->the_request);
496
					/* */
385
                    *read = n;
497
                    *read = n;
386
                    /* ensure this string is terminated */
498
                    /* ensure this string is terminated */
387
                    (*s)[n-1] = '\0';
499
                    (*s)[n-1] = '\0';
Lines 391-396 AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, Link Here
391
                    apr_size_t next_size, next_len;
503
                    apr_size_t next_size, next_len;
392
                    char *tmp;
504
                    char *tmp;
393
505
506
					/* solo */
507
					ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
508
								 "ap_rgetline_core: (bytes_handled >= n) is FALSE, r->the_request='%s'", r->the_request);
509
					/* */
394
                    /* If we're doing the allocations for them, we have to
510
                    /* If we're doing the allocations for them, we have to
395
                     * give ourselves a NULL and copy it on return.
511
                     * give ourselves a NULL and copy it on return.
396
                     */
512
                     */
Lines 411-416 AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, Link Here
411
527
412
                    if (do_alloc && next_len > 0) {
528
                    if (do_alloc && next_len > 0) {
413
                        char *new_buffer;
529
                        char *new_buffer;
530
						/* solo */
531
						ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
532
									 "ap_rgetline_core: (do_alloc && next_len > 0) is TRUE, r->the_request='%s'", r->the_request);
533
						/* */
414
                        apr_size_t new_size = bytes_handled + next_len + 1;
534
                        apr_size_t new_size = bytes_handled + next_len + 1;
415
535
416
                        /* we need to alloc an extra byte for a null */
536
                        /* we need to alloc an extra byte for a null */
Lines 429-440 AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, Link Here
429
                }
549
                }
430
            }
550
            }
431
            else { /* next character is not tab or space */
551
            else { /* next character is not tab or space */
552
				/* solo */
553
				ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
554
							 "ap_rgetline_core: (c == APR_ASCII_BLANK || c == APR_ASCII_TAB) is FALSE, r->the_request='%s'", r->the_request);
555
				/* */
432
                break;
556
                break;
433
            }
557
            }
434
        }
558
        }
435
    }
559
    }
436
560
437
    *read = bytes_handled;
561
    *read = bytes_handled;
562
	/* solo */
563
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
564
				 "ap_rgetline_core: END, return APR_SUCCESS");
565
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
566
				 "ap_rgetline_core: END, return APR_SUCCESS r->the_request='%s'", r->the_request);
567
	/* */
438
    return APR_SUCCESS;
568
    return APR_SUCCESS;
439
}
569
}
440
570
Lines 566-571 static int read_request_line(request_rec *r, apr_bucket_brigade *bb) Link Here
566
    apr_size_t len;
696
    apr_size_t len;
567
    int num_blank_lines = 0;
697
    int num_blank_lines = 0;
568
    int max_blank_lines = r->server->limit_req_fields;
698
    int max_blank_lines = r->server->limit_req_fields;
699
	/* solo */
700
	server_rec * ss = r->server;
701
702
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
703
				 "read_request_line: START");
704
	/* */
569
705
570
    if (max_blank_lines <= 0) {
706
    if (max_blank_lines <= 0) {
571
        max_blank_lines = DEFAULT_LIMIT_REQUEST_FIELDS;
707
        max_blank_lines = DEFAULT_LIMIT_REQUEST_FIELDS;
Lines 588-593 static int read_request_line(request_rec *r, apr_bucket_brigade *bb) Link Here
588
724
589
    do {
725
    do {
590
        apr_status_t rv;
726
        apr_status_t rv;
727
		/* solo */
728
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
729
					 "read_request_line: loop, num_blank_lines=%d", num_blank_lines);
730
		/* */
591
731
592
        /* insure ap_rgetline allocates memory each time thru the loop
732
        /* insure ap_rgetline allocates memory each time thru the loop
593
         * if there are empty lines
733
         * if there are empty lines
Lines 595-600 static int read_request_line(request_rec *r, apr_bucket_brigade *bb) Link Here
595
        r->the_request = NULL;
735
        r->the_request = NULL;
596
        rv = ap_rgetline(&(r->the_request), (apr_size_t)(r->server->limit_req_line + 2),
736
        rv = ap_rgetline(&(r->the_request), (apr_size_t)(r->server->limit_req_line + 2),
597
                         &len, r, 0, bb);
737
                         &len, r, 0, bb);
738
		/* solo */
739
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
740
					 "read_request_line: loop, r->the_request='%s'", r->the_request);
741
		/* */
598
742
599
        if (rv != APR_SUCCESS) {
743
        if (rv != APR_SUCCESS) {
600
            r->request_time = apr_time_now();
744
            r->request_time = apr_time_now();
Lines 616-621 static int read_request_line(request_rec *r, apr_bucket_brigade *bb) Link Here
616
760
617
    r->request_time = apr_time_now();
761
    r->request_time = apr_time_now();
618
    ll = r->the_request;
762
    ll = r->the_request;
763
	/* solo */
764
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
765
				 "read_request_line: first, ll='%s'", ll);
766
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
767
				 "read_request_line: first, ll[0]=%d", ll[0]);
768
	/* */
619
    r->method = ap_getword_white(r->pool, &ll);
769
    r->method = ap_getword_white(r->pool, &ll);
620
770
621
#if 0
771
#if 0
Lines 627-632 static int read_request_line(request_rec *r, apr_bucket_brigade *bb) Link Here
627
#endif
777
#endif
628
778
629
    uri = ap_getword_white(r->pool, &ll);
779
    uri = ap_getword_white(r->pool, &ll);
780
	/* solo */
781
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
782
				 "read_request_line: post 'uri = ap_getword_white(r->pool, &ll)', ll='%s'", ll);
783
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
784
				 "read_request_line: post 'uri = ap_getword_white(r->pool, &ll)', ll[0]=%d", ll[0]);
785
	/* */
630
786
631
    /* Provide quick information about the request method as soon as known */
787
    /* Provide quick information about the request method as soon as known */
632
788
Lines 636-647 static int read_request_line(request_rec *r, apr_bucket_brigade *bb) Link Here
636
    }
792
    }
637
793
638
    ap_parse_uri(r, uri);
794
    ap_parse_uri(r, uri);
795
	/* solo */
796
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
797
				 "read_request_line: post 'ap_parse_uri(r, uri)', ll='%s'", ll);
798
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
799
				 "read_request_line: post 'ap_parse_uri(r, uri)', ll[0]=%d", ll[0]);
800
	/* */
639
801
640
    if (ll[0]) {
802
    if (ll[0]) {
803
		/* solo */
804
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
805
					 "read_request_line: (ll[0]) is TRUE");
806
		/* */
641
        r->assbackwards = 0;
807
        r->assbackwards = 0;
642
        pro = ll;
808
        pro = ll;
643
        len = strlen(ll);
809
        len = strlen(ll);
644
    } else {
810
    } else {
811
		/* solo */
812
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
813
					 "read_request_line: (ll[0]) is FALSE");
814
		/* */
645
        r->assbackwards = 1;
815
        r->assbackwards = 1;
646
        pro = "HTTP/0.9";
816
        pro = "HTTP/0.9";
647
        len = 8;
817
        len = 8;
Lines 664-669 static int read_request_line(request_rec *r, apr_bucket_brigade *bb) Link Here
664
    else
834
    else
665
        r->proto_num = HTTP_VERSION(1, 0);
835
        r->proto_num = HTTP_VERSION(1, 0);
666
836
837
	/* solo */
838
	ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ss,
839
				 "read_request_line: END, return 1");
840
	/* */
667
    return 1;
841
    return 1;
668
}
842
}
669
843

Return to bug 11559