Opened 11 years ago

Closed 11 years ago

#3647 closed enhancement (fixed)

Full PoorMan source codes

Reported by: majie Owned by: stippi
Priority: normal Milestone: R1
Component: Applications Version:
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

This is the full source codes of the PoorMan server, which now has the http server feature.

Attachments (1)

poorman.zip (81.6 KB ) - added by majie 11 years ago.
This is the full source codes of the PoorMan server with the two bugs fixed.

Download all attachments as: .zip

Change History (9)

comment:1 by umccullough, 11 years ago

Wouldn't it be better to move all those HAVE_* defines into the config.h?

in reply to:  1 comment:2 by majie, 11 years ago

Replying to umccullough:

Wouldn't it be better to move all those HAVE_* defines into the config.h?

Those HAVE_* are originally defined in a makefile, so I thought jamfile would be the place to put those stuff.

Thanks.

comment:3 by majie, 11 years ago

Ingo provided me patch against the jamfile, which can now translate the txt files in libhttpd directory to headers files. I have tested it.

Thank you Ingo.

comment:4 by stippi, 11 years ago

Owner: changed from axeld to stippi
Status: newassigned

I've looked into the patch, and you have done a lot of good work. I would go ahead and commit this, but you said you wanted to mention the libhttpd license in AboutSystem? I can do this for you, just tell me.

Here are a few things I noticed when testing Poorman a bit:

  • On first start, when no settings were present, Poorman correctly prompted me to specify the public html folder, but when I clicked on Specify, the main window opened, as well as the file requester to pick the folder. Picking the folder was then ignored, I had to go into the settings and pick it again.
  • When serving websites with UTF-8 content, Firefox will not display the multi-byte chars correctly. When I load the same page from disk, it works just fine.

About the patch itself:

  • There are a lot of coding style violations (in the old code but also in the new code). Do you intend to work on those yet?
  • As with so many apps, the interface would improve a lot if it used the new Haiku layout-management. The code would become much simpler and easier to maintain/extend as well.

Anyways, thanks a lot for this work, it's greatly appreciated!

in reply to:  4 comment:5 by majie, 11 years ago

Replying to stippi:

I've looked into the patch, and you have done a lot of good work. I would go ahead and commit this, but you said you wanted to mention the libhttpd license in AboutSystem? I can do this for you, just tell me.

Yes, please help me update the About System app. License declarations can be obtained from libhttpd.c. A copy of the license should be placed in /data/etc/licenses. Thank you.

Here are a few things I noticed when testing Poorman a bit:

  • On first start, when no settings were present, Poorman correctly prompted me to specify the public html folder, but when I clicked on Specify, the main window opened, as well as the file requester to pick the folder. Picking the folder was then ignored, I had to go into the settings and pick it again.

My fault. I'll fix it.

  • When serving websites with UTF-8 content, Firefox will not display the multi-byte chars correctly. When I load the same page from disk, it works just fine.

Thttpd don't have the ability to detect the encoding of an text file. The Content-Type header confuses firefox which chooses a false encoding to decode the text. There is a walk around. I'll fix this when I finish my gsoc application.

About the patch itself:

  • There are a lot of coding style violations (in the old code but also in the new code). Do you intend to work on those yet?

I'm trying to follow the haiku coding guidelines in the codes I wrote, but I didn't mean to modify the old codes.

  • As with so many apps, the interface would improve a lot if it used the new Haiku layout-management. The code would become much simpler and easier to maintain/extend as well.

Anyways, thanks a lot for this work, it's greatly appreciated!

The gui stub was originally developed on hrev5. But haiku uses a new font with a larger size. I used to develop java programs and I know that layout managers are good things. When I picked up the codes I thought I should fix the gui problem. But later I realised I should put more works to the httpd codes. In fact, this is a high priority item in my TODO list. I'll fix it when I have time.

With the two problems above(coding style and layout manager) plus the unclear license declaration, I wonder whether the gui needs to be completely rewritten in the future.

by majie, 11 years ago

Attachment: poorman.zip added

This is the full source codes of the PoorMan server with the two bugs fixed.

comment:6 by majie, 11 years ago

Hello stippi,

Please test it again. If everything is OK, just commit it. Don't forget to update the About System app.

Thank you.

comment:7 by stippi, 11 years ago

Pretty cool now. The start up without settings is still a bit confusing, but it actually works now. Instead of displaying an error message and trying to start the server at all, it could instead just display the file panel and delay everything else until the user selected the public folder. However, restarting the server works after setting the folder, and the multi-byte char problem is fixed. Thanks a lot! I integrated the license and am going to commit in a minute...

comment:8 by stippi, 11 years ago

Resolution: fixed
Status: assignedclosed

Added PoorMan to the image in hrev29909.

Note: See TracTickets for help on using tickets.