Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-10

freepascal and apache

9 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexey Voytsehovich

hi.

this code

uses SysUtils, httpd; function read_Post(r: Prequest_rec; data: string): boolean; var types: string; begin Result := True; if (r^.method_number M_POST) then Exit; ap_set_content_type(r, 'text/html'); types := ap_table_get(r^.headers_in, 'Content-Type'); end; -- dont compile :( say me Error: Identifier not found "ap_table_get" help me please? sorry about stupid question -- Best regards, Alexey Voytsehovich

Reply by email

Michael Van Canneyt
to Alexey Voytsehovich
Alexey Voytsehovich wrote 21 lines
hi. this code -- uses SysUtils, httpd; function read_Post(r: Prequest_rec; data: string): boolean; var types: string; begin Result := True; if (r^.method_number M_POST) then Exit; ap_set_content_type(r, 'text/html'); types := ap_table_get(r^.headers_in, 'Content-Type'); end; -- dont compile :( say me Error: Identifier not found "ap_table_get" help me please? sorry about stupid question

There are 3 versions of Apache distributed with FPC. Probably the compiler is choosing the 1.3 version.

On the command-line, define one of FPCAPACHE_2_0 or FPCAPACHE_2_2 (as in -dFPCAPACHE_2_0) (or delete the units in units/httpd-1.3)

Michael.

Reply by email

Alexey Voytsehovich
to Michael Van Canneyt

Hello Michael,

you wrote
On the command-line, define one of FPCAPACHE_2_0 or FPCAPACHE_2_2 (as in -dFPCAPACHE_2_0) (or delete the units in units/httpd-1.3)

build string
fpc -dFPCAPACHE_2_2 mod_hello.pp
all unit code

library mod_hello; {$ifdef fpc} {$mode objfpc}{$H+} {$endif} {$IFDEF WIN32} {$DEFINE WINDOWS} {$ENDIF} {$define Apache2_2} {$define FPCAPACHE_2_2} uses SysUtils, httpd; function read_Post(r: Prequest_rec; data: string): boolean; var types: string; begin Result := True; if (r^.method_number M_POST) then Exit; ap_set_content_type(r, 'text/html'); types := ap_table_get(r^.headers_in, 'Content-Type'); end; begin end. -- mod_hello.pp(23,24) Error: Identifier not found "ap_table_get" -- Best regards, Alexey Voytsehovich

Reply by email

Michael Van Canneyt
to Alexey Voytsehovich
Alexey Voytsehovich wrote 44 lines
Hello Michael, Wednesday, October 7, 2009, 10:13:08 AM, you wrote: > On the command-line, define one of FPCAPACHE_2_0 or FPCAPACHE_2_2 (as in -dFPCAPACHE_2_0) > (or delete the units in units/httpd-1.3) build string fpc -dFPCAPACHE_2_2 mod_hello.pp all unit code -- library mod_hello; {$ifdef fpc} {$mode objfpc}{$H+} {$endif} {$IFDEF WIN32} {$DEFINE WINDOWS} {$ENDIF} {$define Apache2_2} {$define FPCAPACHE_2_2} uses SysUtils, httpd; function read_Post(r: Prequest_rec; data: string): boolean; var types: string; begin Result := True; if (r^.method_number M_POST) then Exit; ap_set_content_type(r, 'text/html'); types := ap_table_get(r^.headers_in, 'Content-Type'); end; begin end. -- mod_hello.pp(23,24) Error: Identifier not found "ap_table_get"

Correct, because the function is called apr_table_get (note the r), and is located in unit apr, not in httpd.

Michael.

Reply by email

Michael Van Canneyt
to Alexey Voytsehovich
Alexey Voytsehovich wrote 12 lines
Hello Michael, Wednesday, October 7, 2009, 10:31:26 AM, you wrote: > Correct, because the function is called apr_table_get (note the r), > and is located in unit apr, not in httpd. and please help also function ap_hard_timeout. not found in httpd22 directory. then i find this function or replace it any?

This function no longer exists, because it was extremely unsafe. As far as I know, there is no replacement.

Michael.

Reply by email

Alexey Voytsehovich
to Michael Van Canneyt

Hello Michael,

you wrote 12 lines
> > >> Correct, because the function is called apr_table_get (note the r), >> and is located in unit apr, not in httpd. > > > and please help also > function ap_hard_timeout. not found in httpd22 directory. then i find > this function or replace it any? This function no longer exists, because it was extremely unsafe. As far as I know, there is no replacement.

ok. tnx.

Best regards, Alexey Voytsehovich

Reply by email

Alexey Voychehovich
to Alexey Voytsehovich

hi again
build line on ubuntu
fpc -dFPCAPACHE_2_2 mod_hello.pp
and got this error on load module in apache

apache2: Syntax error on line 284 of /etc/apache2/apache2.conf: API module structure 'test_module' in file /etc/apache2/modules/mod_hello.dll is garbled - expected signature 41503232 but saw 41503230 - perhaps this is not an Apache module DSO, or was compiled for a different Apache version? -- help please. 2009/10/7 Alexey Voytsehovich > Hello Michael, > > Wednesday, October 7, 2009, 1:58:50 PM, you wrote: > > >> > >> > >>> Correct, because the function is called apr_table_get (note the r), > >>> and is located in unit apr, not in httpd. > >> > >> > >> and please help also > >> function ap_hard_timeout. not found in httpd22 directory. then i find > >> this function or replace it any? > > > This function no longer exists, because it was extremely unsafe. As far > as I > > know, there is no replacement. > > > ok. tnx. > > -- > Best regards, > Alexey Voytsehovich > > -- Don`t drink and drive, smoke and fly!

Reply by email