diff --git a/httpd/mod_example.lpr b/httpd/mod_example.lpr
index f7e3f9cb6..479334dcb 100644
--- a/httpd/mod_example.lpr
+++ b/httpd/mod_example.lpr
@@ -437,7 +437,7 @@ begin
* on the size (and readability) of the error_log is considerable.
}
if ((EXAMPLE_LOG_EACH = 0) and (s <> nil)) then
- ap_log_error(MODULE_NAME, 438, APLOG_DEBUG, 0, s, 'mod_example: %s', [note]);
+ ap_log_error(MODULE_NAME, 438, APLOG_DEBUG, 0, s, 'mod_example: ', [note]);
end;
{--------------------------------------------------------------------------}
@@ -504,6 +504,8 @@ var
dcfg: Px_cfg;
tempstr: PChar;
begin
+ tempstr := 'Undefined';
+
if not SameText(r^.handler, 'example-handler') then
begin
Result := DECLINED;
@@ -550,8 +552,7 @@ begin
ap_rputs(' mod_example Module Content-Handler Output' + LineEnding, r);
ap_rputs('
' + LineEnding, r);
ap_rputs(' ' + LineEnding, r);
- ap_rprintf(r, ' Apache HTTP Server version: "%s"' + LineEnding,
- [ap_get_server_version()]);
+ ap_rprintf(r, ' Apache HTTP Server version: "%s"' + LineEnding, [ap_get_server_version()]);
ap_rputs('
' + LineEnding, r);
ap_rprintf(r, ' Server built: "%s"' + LineEnding, [ap_get_server_built()]);
ap_rputs('
' + LineEnding, r);;
@@ -1341,12 +1342,12 @@ begin
begin
name := MODULE_NAME;
magic := MODULE_MAGIC_COOKIE;
- create_dir_config := @x_create_dir_config; { per-directory config creator }
- merge_dir_config := @x_merge_dir_config; { dir config merger }
- create_server_config := @x_create_server_config; { server config creator }
+ create_dir_config := @x_create_dir_config; { per-directory config creator }
+ merge_dir_config := @x_merge_dir_config; { dir config merger }
+ create_server_config := @x_create_server_config;{ server config creator }
merge_server_config := @x_merge_server_config; { server config merger }
- cmds := @x_cmds; { command table }
- register_hooks := @x_register_hooks; { set up other request processing hooks }
+ cmds := @x_cmds; { command table }
+ register_hooks := @x_register_hooks; { set up other request processing hooks }
end;
end.
diff --git a/httpd/mod_hello.lpr b/httpd/mod_hello.lpr
index 371c48f8a..0e7eb1366 100644
--- a/httpd/mod_hello.lpr
+++ b/httpd/mod_hello.lpr
@@ -15,9 +15,9 @@ library mod_hello;
{$DEFINE WINDOWS}
{$ENDIF}
-{$define Apache2_0}
+{$define Apache2_2} // Change when recompiling to a different Apache version
-uses SysUtils, httpd, {$ifndef Apache1_3} apr{$endif};
+uses SysUtils, httpd {$ifndef Apache1_3}, apr{$endif};
var
test_module: module; {$ifdef Unix} public name 'test_module'; {$endif}
@@ -74,6 +74,7 @@ begin
{ Now we just print the contents of the document using the
ap_rputs and ap_rprintf functions. More information about
the use of these can be found in http_protocol.inc }
+ ap_rputs(DOCTYPE_HTML_4_0T, r);
ap_rputs('' + LineEnding, r);
ap_rputs('' + LineEnding, r);
ap_rputs('Hello There' + LineEnding, r);
@@ -81,7 +82,7 @@ begin
ap_rputs('' + LineEnding ,r);
ap_rputs('Hello world
' + LineEnding, r);
ap_rputs('This is the first Apache Module working with the new binding from Free Pascal' + LineEnding, r);
- ap_rprintf(r, '
A sample line generated by ap_rprintf
' + LineEnding, []);
+ ap_rprintf(r, '
A sample line generated by %s
' + LineEnding, [PChar('ap_rprintf')]);
ap_rputs('' + LineEnding, r);
{ We can either return OK or DECLINED at this point. If we return
@@ -99,9 +100,10 @@ begin
end;
var
- hw_handlers: array[0..0] of handler_rec =
+ hw_handlers: array[0..1] of handler_rec =
(
- (content_type: 'hw_app'; handler: @DefaultHandler)
+ (content_type: 'testapache-handler'; handler: @DefaultHandler),
+ (content_type: nil; handler: nil)
);
{$else}
diff --git a/httpd/testmodule.dpr b/httpd/testmodule.dpr
index 8ca894d6f..4d3e67819 100644
--- a/httpd/testmodule.dpr
+++ b/httpd/testmodule.dpr
@@ -27,7 +27,6 @@ library testmodule;
{$ENDIF}
uses
-
minimain in 'minimain.pas';
var
diff --git a/httpd/testmodule.lpi b/httpd/testmodule.lpi
index ff995cdd2..be3ecd8d4 100644
--- a/httpd/testmodule.lpi
+++ b/httpd/testmodule.lpi
@@ -8,8 +8,27 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -27,8 +46,8 @@
-
-
+
+
@@ -164,7 +183,7 @@
-
+
@@ -711,15 +730,11 @@