mod_harbour - binary file download issue

198 views
Skip to first unread message

Ron Christie

unread,
Jun 28, 2021, 1:58:43 AM6/28/21
to Harbour Users
Hi all, especially Antonio
I'm using mod_harbour in developing a website and I've run into an issue with downloading binary files through .hrb files on the website. In my case it's .png files that are particularly of interest The earlier version of mod_harbour I was using wasn't able to handle files with embedded null characters as it didn't allow for a length specification.

That problem got solved in the version that was posted a month or so ago, but I think that the new version also contains a bug. When I send a .png file via a .hrb script the file that is sent to the client is one byte larger than the file that exists on the server and that byte is a single space character at the end of the file.

I think that the problem is in out.c which contains contains a section of code (starting at line 134) that reads:

   ap_rputs( buffer, r );
   ap_rputs( " ", r );

You can see that the second ap_rputs unconditionally adds a space character to the data stream and I'm not sure why it's in this block of code.

I'm using apache on a CentOS 7 server and while there is a prebuilt libharbour.so.3.2.0 in the linux/CentOS 7/ directory I'm not able to build a modified libharbour.so.3.2.0 for two reasons.

First, the instruction file mod_harbour_CentOS7.md requires that you download and install harbour_for_modharbour from github.com/FiveTechSoft/harbour_for_modharbour but that file seems to no longer exist.

Second, the same instruction file contains the line

- modify mod_harbour.c file, line lib_harbour = dlopen( "/var/www/html/libharbour.so.3.2.0", RTLD_LAZY ); by lib_harbour = dlopen( "/usr/lib64/libharbour.so.3.2.0", RTLD_LAZY );

but that line doesn't seem to exist.

I also tried to subscribe to the mod_harbour forum, but that doesn't seem to work either.

Any advice would be appreciated.

Thanks!
Ron


CNavarro

unread,
Jun 28, 2021, 2:23:36 PM6/28/21
to Harbour Users
Ron, please, with which user have you tried to register on the forum https://forum.modharbour.app/?
Confirm the user, and do the user again and you will be registered immediately.
Thanks
Regarding the problem you are commenting on, would you be able to put a small self-contained example to check your problem?
You can put it here or directly in the modharbour.app forum when you are registered.
Greetings

CNavarro

unread,
Jun 28, 2021, 2:33:52 PM6/28/21
to Harbour Users
It also has the forum: https://groups.google.com/g/modharbour

Ron Christie

unread,
Jun 28, 2021, 4:54:44 PM6/28/21
to Harbour Users
Hi all,
Supplying a self-contained example is difficult - it would require having a fully functional mod_harbour installation.
Besides that, I'm only looking for clarification on how to build the libharbour.so.3.2.0 library for myself so that I can check to see whether what I think is the bug actually is. As I indicated in my earlier post the documentation file at ~/mod_harbour/linux/CentOS 7/mod_harbour_CentOS 7.md is incorrect and I'm only asking for some assistance in trying to figure out how to build the libharbour.so from source.

Cheers,
Ron

CNavarro

unread,
Jun 28, 2021, 5:53:28 PM6/28/21
to Harbour Users
Ron, I'm directing you to head over to the specialized ModHarbour forums
Regarding your problem with the DLL, you have in the httpd.conf file, the line
SetEnv LIBHARBOUR "C\xampp\htdocs\libharbour.dll" ?
Replace the path that appears there with your configuration path, which could be
/var/www/html

CNavarro

unread,
Jun 28, 2021, 5:56:34 PM6/28/21
to Harbour Users
I have activated your account on the forum
Feel free to use whatever language you consider

Antonio Linares

unread,
Jun 29, 2021, 3:16:21 AM6/29/21
to Harbour Users
Hi Ron,

If you could provide a small example to see how you manage the PNGs that will help.

You can contact me to my email or much better if you post your mod_harbour questions in our


then go to linux folder and run go.sh. That should build it with no issues so you can apply
your changes. We appreciate all the feedback about it.

regards,

Antonio
El lunes, 28 de junio de 2021 a las 7:58:43 UTC+2, Ron Christie escribió:

Antonio Linares

unread,
Jun 29, 2021, 4:35:33 AM6/29/21
to Harbour Users
Ron,

Use ?? instead of ? to avoid the space

best regards,

Samuel Lobstine

unread,
Jun 29, 2021, 11:32:29 AM6/29/21
to Harbour Users
Hi Antonio, from what I see there are two forums, or actually three( inc google groups ). What is the official forum for inquiries regarding modharbour.

Thanks,
Sam

CNavarro

unread,
Jun 29, 2021, 1:29:34 PM6/29/21
to Harbour Users
In any of the forums you will be attended

Ron Christie

unread,
Jun 29, 2021, 10:19:43 PM6/29/21
to Harbour Users
Hi Antonio,
Unfortunately I'm going to be away from the computer for a few days, but when I get back in front of it I'll document what's going on.
Cheers,
R.
Reply all
Reply to author
Forward
0 new messages