Sign in Join

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

Mailing lists / fpc-devel / 2008-10

Strange things with the apache header files on Linux

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

ABorka

On Linux (Ubuntu 8.04), latest SVN, in fpc/packages/httpd22/...

in httpd.inc inside request_rec:
{ body byte count, for easy access }

     bytes_sent: apr_off_t;
     { Last modified time of the requested resource }
     mtime: apr_time_t;
in apr.pas :
   apr_off_t = Int64;
   apr_int64_t = Int64;
in apr_time.inc :
   apr_time_t = apr_int64_t;

Using an example apache module compiled with FPC/Lazarus (the initialization part is executed when apache loads): sizeof(apr_int64_t) gives 4
sizeof(apr_off_t) gives 4
sizeof(apr_time_t) gives 8
sizeof(request_rec.bytes_sent) gives 4
sizeof(request_rec.mtime) gives 8

Shouldn't all be 8 bytes? Or am I missing something? And why apr_time_t is the correct 8 if the others are 4?

One of the reasons that the C compiled apache modules have 412 bytes (correctly) in "request_rec" instead of the 384 bytes (incorrectly) in the FPC compiled ones is that sizeof(apr_off_t) is 4 instead of 8. This might be the reason that apache modules are not working on Linux compiled with FPC/lazarus, unless I'm way off track...

Any thoughts?

Reply by email

ABorka
to ABorka

When copying the files from httpd22 dir to my project directory and recompiling them with my project the record sizes are OK and same as the C compiled apache module.

Yet, the apache module compiled with FPC/Lazarus is not working. The hooked DefaultHandler function is never called, just an empty web page is returned. Everything works under Windows, but not on Linux.

ABorka wrote 38 lines
On Linux (Ubuntu 8.04), latest SVN, in fpc/packages/httpd22/... in httpd.inc inside request_rec: { body byte count, for easy access } bytes_sent: apr_off_t; { Last modified time of the requested resource } mtime: apr_time_t; in apr.pas : apr_off_t = Int64; apr_int64_t = Int64; in apr_time.inc : apr_time_t = apr_int64_t; Using an example apache module compiled with FPC/Lazarus (the initialization part is executed when apache loads): sizeof(apr_int64_t) gives 4 sizeof(apr_off_t) gives 4 sizeof(apr_time_t) gives 8 sizeof(request_rec.bytes_sent) gives 4 sizeof(request_rec.mtime) gives 8 Shouldn't all be 8 bytes? Or am I missing something? And why apr_time_t is the correct 8 if the others are 4? One of the reasons that the C compiled apache modules have 412 bytes (correctly) in "request_rec" instead of the 384 bytes (incorrectly) in the FPC compiled ones is that sizeof(apr_off_t) is 4 instead of 8. This might be the reason that apache modules are not working on Linux compiled with FPC/lazarus, unless I'm way off track... Any thoughts? _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

ABorka
to Marco van de Voort

I am using the latest checkout for both fpc and lazarus (well, 2 or 3 days old checkout now).
Bug 11460 only fixes the apr_off_t to be int64 which is already in the checked out code. It does not fix the problem currently for apache modules. Compiled apache modules are not working (example programs included in the fcl package directory httpd22/examples) The record length for module_struct and request_rec are the same for the fpc compiled apache module and a C compiled module, still the fpc compiled one does not work.

Marco van de Voort wrote 11 lines
In our previous episode, ABorka said: > On Linux (Ubuntu 8.04), latest SVN, in fpc/packages/httpd22/... If you use 2.2.3 branch, I had a feeling I had seen something like this before and found bug 11460, so I merged the fixes for bug 11460 from 2.3.1 to 2.2.1 _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email