Sign in Join

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

Mailing lists / fpc-devel / 2009-03

Patch for FCL-web; bug fixes and improvements for CGI and Apache applications

11 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

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

ABorka

Hi,

I posted the following patch as
http://bugs.freepascal.org/view.php?id=13254

(includes the changes posted in 13250 and 13228 too)

1. Added: CGI and Apache applications' temporary uploaded files will be deleted after a request is handled /html forms with file upload(s)/ so the files are not left there in the temporary directory.

2. Fixed: Temporary files are not created with a single CRLF in them for html forms where no file(s) were uploaded.

3. Added: Apache applications are now processing and passing the input parameters (QueryFields, ContentFields, uploaded files, etc.). This was only there for CGI applications.

4. THTTPHeader and descendants RemoteAddress property renamed to RemoteAddr for Delphi compatibility

5. Note: For some unknown reason for apache mods the

ap_get_remote_host(FRequest^.Connection, FRequest^.Per_Dir_Config, REMOTE_HOST, Nil)
call is always crashing, therefore for now this field is not populated. This would force a DNS lookup according to the HostnameLookups setting in the Apache configuration.

6. Minor changes and corrections in comments here and there in FCL-web

7. Added custom header handling to CGI and Apache applications (ex: can send "Pragma: no-cache" header now, can do redirects, etc.)

8. Added the procedure SendRedirect(const TargetURL:String) to CGI and Apache applications
("302 Found" for HTTP/1.0 and "307 Temporary Redirect" for HTTP/1.1)

9. Fixed a bug for Apache applications that returned with the same action results after any action with the use of TFPTemplate called (the FPTemplate which is a global property for a web module was not reset after an action was handled)

10. Fixed a bug for Apache applications to pass the Status Code and Content Encoding to the web server in the response. (ex: can send 'Content-Type: text/html; charset=ISO-8859-2' now to the clients, redirects need it too to pass the status code, etc.)

11. Fixed the header name/value pair passing for Apache applications (do not need the extra space for the header values, apache puts it there automatically)

12. Minor changes to the template usage example projects in some comments (the Template:TFPTemplate is a property of the web module, not the web action)

13. Changed the behaviour for CGI and Apache applications when non existing actions are called. Until now, an error message was displayed. Now the default action is called if it exists. If not, an error message is displayed.

14. fptemplate.txt is extended with more code snippets and step by step instructions on how to create apache and cgi applications that are using templates.

15. Example projects were created for the above step by step guide into /packages/fcl-web/examples/ about the usage of template files

Reply by email

Joost van der Sluis
to ABorka: I posted the following patch as http://bugs.freepascal.org/view.php?id=13254 (includes…

Op zaterdag 28-02-2009 om 22:06 uur [tijdzone -0800], schreef ABorka:

I posted the following patch as http://bugs.freepascal.org/view.php?id=13254 (includes the changes posted in 13250 and 13228 too)

It takes soo long before the patches are applied because they are too large. ;)

Now you create more patches which are even longer and then another one which is again longer... That doesn't make it easier for us.

It takes hours to look at such patches.

So next time (not this time, we're already on it now) provide small patches if you can and try not to include old patches into new ones. Although I do admit that that's more work, that way we can apply faster and that way it's easier for you to make new changes...

Joost.

Reply by email

Florian Klaempfl
to Joost van der Sluis
Show quoted text 5 lines
So next time (not this time, we're already on it now) provide small patches if you can and try not to include old patches into new ones. Although I do admit that that's more work, that way we can apply faster and that way it's easier for you to make new changes...

If one has more patches, something like using mercurial queues is a good idea. Maybe Alexander Klenin could write a short tutorial how to use mq to maintain patches.

Reply by email

ABorka
to Joost van der Sluis: Op zaterdag 28-02-2009 om 22:06 uur [tijdzone -0800], schreef ABorka: It takes soo long…

Sorry guys, I knew I should have called them service packs, not patches :)

In the future I would like to do it in the right way, but I'm not exactly sure how. Lets say I check out the latest SVN and make some changes in a few files in /FCL-web/ .
I generate a patch file which contains the differences. I create a mantis report and submit the patch there. So far so good. Now, I would like to do more changes in /FCL-web/ , how do I make the SVN client to not include the previous changes in the following patch file generations until the patches are all applied to the SVN trunk?

AB

Joost van der Sluis wrote 25 lines
Op zaterdag 28-02-2009 om 22:06 uur [tijdzone -0800], schreef ABorka: > I posted the following patch as > http://bugs.freepascal.org/view.php?id=13254 > > (includes the changes posted in 13250 and 13228 too) It takes soo long before the patches are applied because they are too large. ;) Now you create more patches which are even longer and then another one which is again longer... That doesn't make it easier for us. It takes hours to look at such patches. So next time (not this time, we're already on it now) provide small patches if you can and try not to include old patches into new ones. Although I do admit that that's more work, that way we can apply faster and that way it's easier for you to make new changes... Joost. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Florian Klaempfl
to ABorka
Show quoted text 10 lines
Sorry guys, I knew I should have called them service packs, not patches :) In the future I would like to do it in the right way, but I'm not exactly sure how. Lets say I check out the latest SVN and make some changes in a few files in /FCL-web/ . I generate a patch file which contains the differences. I create a mantis report and submit the patch there. So far so good. Now, I would like to do more changes in /FCL-web/ , how do I make the SVN client to not include the previous changes in the following patch file generations until the patches are all applied to the SVN trunk?

The best solution to handle this is to use patch queues. For example mercurial offers this with Mercurial Queues:
http://www.selenic.com/mercurial/wiki/index.cgi/MqExtension

As base for your patches you can use the fpc mercurial ready only mirror: http://florianklaempfl.de:8000/fpctrunk

Reply by email

Graeme Geldenhuys
to Joost van der Sluis: Op zaterdag 28-02-2009 om 22:06 uur [tijdzone -0800], schreef ABorka: It takes soo long…
Joost van der Sluis wrote 5 lines
So next time (not this time, we're already on it now) provide small patches if you can and try not to include old patches into new ones. Although I do admit that that's more work, that way we can apply faster and that way it's easier for you to make new changes...

This is where a Git repository comes in really handy. Create a new local feature branch or stash existing changes while working on new changes. Then unstash / pop old changes again.

Florian, do you read freeX magazine (same people as Toolbox)? I wrote an Introduction to Git article for the magazine - so I could learn more about Git as well. In the process, I have learnt such a lot. Git has some truly amazing (and maybe not that well known) features that really impressed be.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Alexander Klenin
to Graeme Geldenhuys
Florian Klaempfl wrote
If one has more patches, something like using mercurial queues is a good idea. Maybe Alexander Klenin could write a short tutorial how to use mq to maintain patches.

There are many tutorials already:
http://www.google.ru/search?q=mercurial+queues+tutorial The only thing I should note is that, contrary to recommendation by some tutorials,
one must _not_ turn on "git diff" option, since resulting patches will not be applicable by svn.

Graeme Geldenhuys wrote
This is where a Git repository comes in really handy. Create a new local feature branch or stash existing changes while working on new changes. Then unstash / pop old changes again.

Indeed -- while Mercurial Queues provide necessary tools, Git rebase --interactive
is more powerful and easier to work with.

Alexander S. Klenin

Reply by email

Florian Klaempfl
to Graeme Geldenhuys: This is where a Git repository comes in really handy. Create a new local feature branch…
Show quoted text 5 lines
This is where a Git repository comes in really handy. Create a new local feature branch or stash existing changes while working on new changes. Then unstash / pop old changes again. Florian, do you read freeX magazine (same people as Toolbox)?

No.

Show quoted text 5 lines
I wrote an Introduction to Git article for the magazine - so I could learn more about Git as well. In the process, I have learnt such a lot. Git has some truly amazing (and maybe not that well known) features that really impressed be.

It doesn't help if it can not do basic things like:
- Windows support (console *and* GUI)
- line feed conversion
right.

Reply by email

Florian Klaempfl
to Alexander Klenin: There are many tutorials already: http://www.google.ru/search?q=mercurial+queues+tutorial…
Show quoted text 11 lines
On Sun, Mar 1, 2009 at 21:06, Florian Klaempfl wrote: > If one has more patches, something like using mercurial queues is a good > idea. Maybe Alexander Klenin could write a short tutorial how to use mq > to maintain patches. There are many tutorials already: http://www.google.ru/search?q=mercurial+queues+tutorial The only thing I should note is that, contrary to recommendation by some tutorials, one must _not_ turn on "git diff" option, since resulting patches will not be applicable by svn.

Due to their flexible concept, DVCS require good descriptions of working practices especially because most people are not common with DVCS and as the win32text documentation showed, their documentation is still far from perfect.

Reply by email

ABorka
to Joost van der Sluis: Op zaterdag 28-02-2009 om 22:06 uur [tijdzone -0800], schreef ABorka: It takes soo long…

Sorry Joost, but I posted 2(+1) more, much smaller ones though :)

http://bugs.freepascal.org/view.php?id=13280
and
http://bugs.freepascal.org/view.php?id=13287

The third I submitted contains the rest of the example CGI/Apache projects to demonstrate the use of FCL-web with templates. http://bugs.freepascal.org/view.php?id=13288

I promise these are the last bugs I found while creating these example applications for fcl-web. All started by trying to reply to some people on the forum asking questions about using fpweb :)

I attached the README.txt for the whole set of examples if anyone is interested what is in there (don't panic, only about 50 something lines).

AB

Joost van der Sluis wrote 25 lines
Op zaterdag 28-02-2009 om 22:06 uur [tijdzone -0800], schreef ABorka: > I posted the following patch as > http://bugs.freepascal.org/view.php?id=13254 > > (includes the changes posted in 13250 and 13228 too) It takes soo long before the patches are applied because they are too large. ;) Now you create more patches which are even longer and then another one which is again longer... That doesn't make it easier for us. It takes hours to look at such patches. So next time (not this time, we're already on it now) provide small patches if you can and try not to include old patches into new ones. Although I do admit that that's more work, that way we can apply faster and that way it's easier for you to make new changes... Joost. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email