Skip to content
Browse files

git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…

…f1-0310-9951-d761b3857238
  • Loading branch information...
0 parents commit ae9d9717a2bcf09d9fb85de2e691049a4f2a9d24 @alobbs alobbs committed Apr 1, 2006
Showing with 25,009 additions and 0 deletions.
  1. +41 −0 .ignore
  2. +1 −0 AUTHORS
  3. +340 −0 COPYING
  4. +6,209 −0 ChangeLog
  5. +181 −0 Makefile.am
  6. 0 NEWS
  7. +48 −0 README
  8. +154 −0 SUNWcherokee.spec
  9. +29 −0 TODO
  10. +449 −0 acinclude.m4
  11. +59 −0 advanced.conf.sample.pre
  12. +99 −0 autogen.sh
  13. +54 −0 cget.1
  14. +20 −0 cget/Makefile.am
  15. +432 −0 cget/main.c
  16. +32 −0 cherokee-config.1
  17. +61 −0 cherokee-config.in
  18. +54 −0 cherokee.1
  19. +120 −0 cherokee.conf.sample.pre
  20. +171 −0 cherokee.m4
  21. +11 −0 cherokee.pc.in
  22. +61 −0 cherokee.spec.in
  23. +25 −0 cherokee/.ignore
  24. +255 −0 cherokee/Makefile.MingW.in
  25. +989 −0 cherokee/Makefile.am
  26. +79 −0 cherokee/Makefile.embedded
  27. +605 −0 cherokee/access.c
  28. +45 −0 cherokee/access.h
  29. +571 −0 cherokee/admin_client.c
  30. +112 −0 cherokee/admin_client.h
  31. +92 −0 cherokee/admin_request.c
  32. +51 −0 cherokee/admin_request.h
  33. +262 −0 cherokee/admin_server.c
  34. +45 −0 cherokee/admin_server.h
  35. +890 −0 cherokee/avl/avl.c
  36. +115 −0 cherokee/avl/avl.h
  37. +1,231 −0 cherokee/buffer.c
  38. +121 −0 cherokee/buffer.h
  39. +150 −0 cherokee/buffer_escape.c
  40. +55 −0 cherokee/buffer_escape.h
  41. +109 −0 cherokee/cherokee-panic
  42. +72 −0 cherokee/cherokee.h
  43. +131 −0 cherokee/cherokee_admin.c
  44. +200 −0 cherokee/cherokee_logrotate.c
  45. +1 −0 cherokee/combined.deps
  46. +118 −0 cherokee/common-internal.h
  47. +2 −0 cherokee/common.deps
  48. +74 −0 cherokee/common.h
  49. +260 −0 cherokee/config_entry.c
  50. +86 −0 cherokee/config_entry.h
  51. +251 −0 cherokee/connection-protected.h
  52. +1,909 −0 cherokee/connection.c
  53. +49 −0 cherokee/connection.h
  54. +284 −0 cherokee/connection_info.c
  55. +69 −0 cherokee/connection_info.h
  56. +109 −0 cherokee/crc32.c
  57. +14 −0 cherokee/crc32.h
  58. +136 −0 cherokee/dict.c
  59. +68 −0 cherokee/dict.h
  60. +67 −0 cherokee/dict/dict_generic.c
  61. +135 −0 cherokee/dict/dict_generic.h
  62. +91 −0 cherokee/dict/dict_private.h
  63. +999 −0 cherokee/dict/sp_tree.c
  64. +65 −0 cherokee/dict/sp_tree.h
  65. +190 −0 cherokee/dirs_table.c
  66. +49 −0 cherokee/dirs_table.h
  67. +94 −0 cherokee/downloader-protected.h
  68. +666 −0 cherokee/downloader.c
  69. +76 −0 cherokee/downloader.h
  70. +97 −0 cherokee/encoder.c
  71. +77 −0 cherokee/encoder.h
  72. +326 −0 cherokee/encoder_gzip.c
  73. +55 −0 cherokee/encoder_gzip.h
  74. +157 −0 cherokee/encoder_table.c
  75. +72 −0 cherokee/encoder_table.h
  76. +1 −0 cherokee/error_redir.deps
  77. +312 −0 cherokee/ext_source.c
  78. +85 −0 cherokee/ext_source.h
  79. +109 −0 cherokee/exts_table.c
  80. +42 −0 cherokee/exts_table.h
  81. +136 −0 cherokee/fastcgi.h
  82. +194 −0 cherokee/fcgi_dispatcher.c
  83. +58 −0 cherokee/fcgi_dispatcher.h
  84. +485 −0 cherokee/fcgi_manager.c
  85. +75 −0 cherokee/fcgi_manager.h
  86. +319 −0 cherokee/fdpoll-epoll.c
  87. +280 −0 cherokee/fdpoll-kqueue.c
  88. +237 −0 cherokee/fdpoll-poll.c
  89. +299 −0 cherokee/fdpoll-port.c
  90. +67 −0 cherokee/fdpoll-protected.h
  91. +298 −0 cherokee/fdpoll-select.c
  92. +261 −0 cherokee/fdpoll-win32.c
  93. +206 −0 cherokee/fdpoll.c
  94. +68 −0 cherokee/fdpoll.h
Sorry, we could not display the entire diff because too many files (464) changed.
41 .ignore
@@ -0,0 +1,41 @@
+.libs
+.deps
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache
+config.guess
+config.h.in
+config.log
+config.status
+configure.scan
+config.sub
+configure
+libtool
+ltmain.sh
+stamp-h.in
+cherokee-config
+cherokee.spec
+config.h
+stamp-h
+cherokee.conf
+*.rpm
+*.tar.gz
+cherokee.conf.sample
+config.cache
+echo
+stamp-h1
+cherokee.pc
+mods-ssl.sample
+depcomp
+sites-default.sample
+sites-example.sample
+autogen.olg
+compile
+INSTALL
+advanced.conf.sample
+missing
+ylwrap
+install-sh
+cherokee_replace
+build_solaris.sh
1 AUTHORS
@@ -0,0 +1 @@
+Alvaro Lopez Ortega <alvaro@alobbs.com>
340 COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
6,209 ChangeLog
6,209 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
181 Makefile.am
@@ -0,0 +1,181 @@
+## Cherokee: Makefile.am -*- makefile -*-
+
+SUBDIRS = m4 contrib www doc icons qa cherokee cget windows
+bin_SCRIPTS = cherokee-config
+SUFFIXES = .sample.pre .sample
+
+# M4 macro file for inclusion with autoconf
+m4datadir = "$(datadir)/aclocal"
+m4data_DATA = cherokee.m4
+
+# Man pag
+man_MANS = \
+cget.1 \
+cherokee.1 \
+cherokee-config.1 \
+cherokee_logrotate.1
+
+# pkg-config
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = cherokee.pc
+
+# Replacement utility
+noinst_PROGRAMS = cherokee_replace
+cherokee_replace_SOURCES = cherokee_replace.c
+
+# Configuration files
+cherokeeconfdir = $(sysconfdir)/cherokee
+
+.sample.pre.sample:
+ $(top_builddir)/cherokee_replace $< $@ "%sysconfdir%" "${sysconfdir}" "%datadir%" "${datadir}" "%prefix%" "${prefix}" "%wwwroot%" "${WWW_ROOT}"
+
+CONFS_PRE = \
+mods-ssl.sample.pre \
+cherokee.conf.sample.pre \
+advanced.conf.sample.pre \
+sites-default.sample.pre \
+sites-example.sample.pre
+
+CONFS_DONE = \
+mime.types.sample \
+mime.compression.types.sample \
+icons.conf.sample \
+mods-admin.sample
+
+CONFS = \
+$(CONFS_PRE:.sample.pre=.sample)
+
+WINDOWS_PORT_FILES = \
+config.h.win32
+
+DISTCLEANFILES = \
+cherokee.pc \
+$(CONFS)
+
+COMPILATION_TESTS = \
+debian_testing.sh \
+debian_testing_chroot.sh
+
+
+EXTRA_DIST = \
+TODO \
+http-cherokee.xml \
+cherokee.spec \
+cherokee.spec.in \
+SUNWcherokee.spec \
+pam.d_cherokee \
+cherokee.pc.in \
+$(m4data_DATA) \
+$(CONFS_DONE) \
+$(CONFS_PRE) \
+$(man_MANS) \
+$(WINDOWS_PORT_FILES) \
+$(COMPILATION_TESTS)
+
+
+install-data-local-config:
+ @$(mkinstalldirs) $(DESTDIR)$(pkgincludedir);
+ $(INSTALL_DATA) $(top_builddir)/config.h $(DESTDIR)$(pkgincludedir)/cherokee-config.h
+
+uninstall-local-config:
+ @if test -f $(DESTDIR)$(pkgincludedir)/cherokee-config.h; then \
+ echo "rm -f $(DESTDIR)$(pkgincludedir)/cherokee-config.h"; \
+ $(RM) -f $(DESTDIR)$(pkgincludedir)/cherokee-config.h; \
+ fi
+
+
+install-data-local: $(CONFS) $(CONFS_DONE) install-data-local-config
+ @$(mkinstalldirs) $(DESTDIR)$(cherokeeconfdir)
+ @$(mkinstalldirs) $(DESTDIR)$(cherokeeconfdir)/ssl
+ @$(mkinstalldirs) $(DESTDIR)$(cherokeeconfdir)/mods-enabled
+ @$(mkinstalldirs) $(DESTDIR)$(cherokeeconfdir)/mods-available
+ @$(mkinstalldirs) $(DESTDIR)$(cherokeeconfdir)/sites-enabled
+ @$(mkinstalldirs) $(DESTDIR)$(cherokeeconfdir)/sites-available
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/cherokee.conf ; then \
+ echo "$@ will not overwrite existing $(cherokeeconfdir)/cherokee.conf"; \
+ else \
+ $(INSTALL_DATA) $(top_builddir)/cherokee.conf.sample $(DESTDIR)$(cherokeeconfdir)/cherokee.conf; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/advanced.conf ; then \
+ echo "$@ will not overwrite existing $(cherokeeconfdir)/advanced.conf"; \
+ else \
+ $(INSTALL_DATA) $(top_builddir)/advanced.conf.sample $(DESTDIR)$(cherokeeconfdir)/advanced.conf; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/icons.conf ; then \
+ echo "$@ will not overwrite existing $(cherokeeconfdir)/icons.conf"; \
+ else \
+ $(INSTALL_DATA) $(top_srcdir)/icons.conf.sample $(DESTDIR)$(cherokeeconfdir)/icons.conf; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/mime.types ; then \
+ echo "$@ will not overwrite existing $(cherokeeconfdir)/mime.types"; \
+ else \
+ $(INSTALL_DATA) $(top_srcdir)/mime.types.sample $(DESTDIR)$(cherokeeconfdir)/mime.types; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/mime.compression.types ; then \
+ echo "$@ will not overwrite existing $(cherokeeconfdir)/mime.compression.types"; \
+ else \
+ $(INSTALL_DATA) $(top_srcdir)/mime.compression.types.sample $(DESTDIR)$(cherokeeconfdir)/mime.compression.types; \
+ fi
+ @if test -d $(DESTDIR)$(sysconfdir)/pam.d && test ! -d $(DESTDIR)$(sysconfdir)/pam.d/cherokee ; then \
+ $(INSTALL_DATA) $(top_srcdir)/pam.d_cherokee $(DESTDIR)$(sysconfdir)/pam.d/cherokee; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/sites-available/default ; then \
+ echo "$@ will not overwrite existing $(cherokeeconfdir)/sites-available/default"; \
+ else \
+ $(INSTALL_DATA) $(top_builddir)/sites-default.sample $(DESTDIR)$(cherokeeconfdir)/sites-available/default; \
+ $(SHELL) -c "cd $(DESTDIR)$(cherokeeconfdir)/sites-enabled/ && $(LN_S) ../sites-available/default ."; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/sites-available/example.com ; then \
+ echo "$@ will not overwrite existing $(cherokeeconfdir)/sites-available/example.com"; \
+ else \
+ $(INSTALL_DATA) $(top_builddir)/sites-example.sample $(DESTDIR)$(cherokeeconfdir)/sites-available/example.com; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/mods-available/ssl ; then \
+ echo "$@ will not overwrite existing $(cherokeeconfdir)/mods-available/ssl"; \
+ else \
+ $(INSTALL_DATA) $(top_builddir)/mods-ssl.sample $(DESTDIR)$(cherokeeconfdir)/mods-available/ssl; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/mods-available/admin ; then \
+ echo "$@ will not overwrite existing $(cherokeeconfdir)/mods-available/admin"; \
+ else \
+ $(INSTALL_DATA) $(top_srcdir)/mods-admin.sample $(DESTDIR)$(cherokeeconfdir)/mods-available/admin; \
+ fi
+ $(mkinstalldirs) $(DESTDIR)$(localstatedir)
+
+uninstall-local: uninstall-local-config
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/cherokee.conf ; then \
+ echo "rm -f $(DESTDIR)$(cherokeeconfdir)/cherokee.conf"; \
+ $(RM) -f $(DESTDIR)$(cherokeeconfdir)/cherokee.conf; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/advanced.conf ; then \
+ echo "rm -f $(DESTDIR)$(cherokeeconfdir)/advanced.conf"; \
+ $(RM) -f $(DESTDIR)$(cherokeeconfdir)/advanced.conf; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/icons.conf ; then \
+ echo "rm -f $(DESTDIR)$(cherokeeconfdir)/icons.conf"; \
+ $(RM) -f $(DESTDIR)$(cherokeeconfdir)/icons.conf; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/mime.types ; then \
+ echo "rm -f $(cherokeeconfdir)/mime.types"; \
+ $(RM) -f $(DESTDIR)$(cherokeeconfdir)/mime.types; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/mime.compression.types ; then \
+ echo "rm -f $(cherokeeconfdir)/mime.compression.types"; \
+ $(RM) -f $(DESTDIR)$(cherokeeconfdir)/mime.compression.types; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/mods-available/ssl ; then \
+ $(RM) -f $(DESTDIR)$(cherokeeconfdir)/mods-available/ssl; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/mods-available/admin ; then \
+ $(RM) -f $(DESTDIR)$(cherokeeconfdir)/mods-available/admin; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/sites-available/default ; then \
+ $(RM) -f $(DESTDIR)$(cherokeeconfdir)/sites-available/default; \
+ fi
+ @if test -f $(DESTDIR)$(cherokeeconfdir)/sites-available/example.com ; then \
+ $(RM) -f $(DESTDIR)$(cherokeeconfdir)/sites-available/example.com; \
+ fi
+
+test:
+ $(MAKE) -C qa test
+
0 NEWS
No changes.
48 README
@@ -0,0 +1,48 @@
+Cherokee Web Server
+===================
+
+A mailing-list cherokee@alobbs.com is available, to subscribe:
+ http://alobbs.com/cgi-bin/mailman/listinfo/cherokee
+
+The list archive is at:
+ http://www.0x50.org/archives/
+
+
+
+1.- How to compile it
+---------------------
+./configure --prefix=/usr --sysconfdir=/etc
+
+2.- How to create dinamyc modules
+---------------------------------
+It's the default way.
+
+3.- How to compile the module xyz statically in the libcherokee
+---------------------------------------------------------------
+./configure --prefix=/usr --sysconfdir=/etc --enable-static-module=xyz
+
+4.- How to build statically
+---------------------------
+./configure --prefix=/usr --sysconfdir=/etc --enable-static-module=all
+
+5.- How to optimize in a Pentium4
+---------------------------------
+make CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer -fforce-addr -falign-functions=4 -fprefetch-loop-arrays"
+
+6.- How to create a self signed certificate for TLS
+---------------------------------------------------
+openssl req -days 1000 -new -x509 -nodes -out /etc/cherokee/ssl/cherokee.pem -keyout /etc/cherokee/ssl/cherokee.pem
+
+7.- How to compile the embedded version
+--------------------------------------
+./configure --prefix=/usr --sysconfdir=/etc --disable-pthread --disable-tls --disable-largefile --disable-pcre
+cd cherokee && make -f Makefile.embedded
+
+8.- Windows compilation
+-----------------------
+./configure --prefix=/usr --sysconfdir=/etc --enable-trace --enable-static-module=all --enable-static --enable-shared=no
+
+
+--
+Alvaro Lopez Ortega
+alvaro@gnu.org
154 SUNWcherokee.spec
@@ -0,0 +1,154 @@
+#
+# spec file for package SUNWcherokee
+#
+# Copyright (c) 2006 Sun Microsystems, Inc.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+
+%include Solaris.inc
+
+Name: SUNWcherokee
+Summary: cherokee - Fast, flexible, lightweight web server
+Version: 0.5.0
+Source: http://www.0x50.org/download/0.5/%{version}/cherokee-%{version}.tar.gz
+SUNW_BaseDir: %{_basedir}
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+
+%include default-depend.inc
+#BuildRequires: SUNWgnome-base-libs-share
+
+%package root
+Summary: cherokee - Fast, flexible, lightweight web server - platform dependent files, / filesystem
+SUNW_BaseDir: /
+%include default-depend.inc
+
+%package devel
+Summary: cherokee - Fast, flexible, lightweight web server - developer files
+SUNW_BaseDir: %{_basedir}
+%include default-depend.inc
+Requires: SUNWcherokee
+
+%prep
+%setup -q -n cherokee-%version
+
+%build
+#export PKG_CONFIG_PATH=%{_pkg_config_path}
+#export MSGFMT="/usr/bin/msgfmt"
+export CFLAGS="%optflags -I%{_includedir}"
+export RPM_OPT_FLAGS="$CFLAGS"
+export LDFLAGS="%_ldflags"
+
+./configure --prefix=%{_prefix} \
+ --enable-os-string="OpenSolaris" \
+ --enable-pthreads \
+ --libexecdir=%{_libexecdir} \
+ --datadir=%{_datadir} \
+ --mandir=%{_mandir} \
+ --infodir=%{_infodir} \
+ --sysconfdir=%{_sysconfdir} \
+ --localstatedir=%{_localstatedir} \
+ --with-wwwroot=%{_localstatedir}/cherokee
+make -j$CPUS
+
+%install
+make install DESTDIR=$RPM_BUILD_ROOT
+
+rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.a
+rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.la
+rm -f $RPM_BUILD_ROOT%{_libdir}/cherokee/lib*.a
+rm -f $RPM_BUILD_ROOT%{_libdir}/cherokee/lib*.la
+
+mkdir -p ${RPM_BUILD_ROOT}/var/svc/manifest/network/
+cp http-cherokee.xml ${RPM_BUILD_ROOT}/var/svc/manifest/network/http-cherokee.xml
+
+%{?pkgbuild_postprocess: %pkgbuild_postprocess -v -c "%{version}:%{jds_version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $RPM_BUILD_ROOT}
+
+
+
+%post -n SUNWcherokee-root
+
+if [ -f /lib/svc/share/smf_include.sh ] ; then
+ . /lib/svc/share/smf_include.sh
+ smf_present
+ if [ $? -eq 0 ]; then
+ /usr/sbin/svccfg import /var/svc/manifest/network/http-cherokee.xml
+ fi
+fi
+
+exit 0
+
+%preun -n SUNWcherokee-root
+if [ -f /lib/svc/share/smf_include.sh ] ; then
+ . /lib/svc/share/smf_include.sh
+ smf_present
+ if [ $? -eq 0 ]; then
+ if [ `svcs -H -o STATE svc:/network/http:cherokee` != "disabled" ]; then
+ svcadm disable svc:/network/http:cherokee
+ fi
+ fi
+fi
+
+
+%postun -n SUNWcherokee-root
+
+if [ -f /lib/svc/share/smf_include.sh ] ; then
+ . /lib/svc/share/smf_include.sh
+ smf_present
+ if [ $? -eq 0 ] ; then
+ /usr/sbin/svccfg export svc:/network/http > /dev/null 2>&1
+ if [ $? -eq 0 ] ; then
+ /usr/sbin/svccfg delete -f svc:/network/http:cherokee
+ fi
+ fi
+fi
+
+exit 0
+
+
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr (-, root, other)
+%dir %attr (0755, root, bin) %{_bindir}
+%{_bindir}/*
+%dir %attr (0755, root, bin) %{_sbindir}
+%{_sbindir}/cherokee
+%dir %attr (0755, root, bin) %{_libdir}
+%{_libdir}/lib*.so*
+%{_libdir}/cherokee
+%dir %attr (0755, root, sys) %{_datadir}
+%dir %attr(0755, root, bin) %{_mandir}
+%dir %attr(0755, root, bin) %{_mandir}/man1
+%{_mandir}/man1/*
+%{_datadir}/aclocal
+%{_datadir}/cherokee
+%{_datadir}/doc
+
+
+%files root
+%defattr (-, root, other)
+%attr (0755, root, sys) %dir %{_sysconfdir}
+%{_sysconfdir}/*
+%dir %attr (0755, root, sys) %{_localstatedir}
+%{_localstatedir}/cherokee/*
+%defattr (0755, root, sys)
+%attr(0444, root, sys)/var/svc/manifest/network/http-cherokee.xml
+
+%files devel
+%dir %attr (0755, root, bin) %dir %{_libdir}
+%dir %attr (0755, root, other) %{_libdir}/pkgconfig
+%{_libdir}/pkgconfig/*
+%dir %attr (0755, root, bin) %{_includedir}
+%{_includedir}/*
+
+
+%changelog
+* Wed Jan 25 2006 - rodrigo.fernandez-vizarra@sun.com
+- Added SMF definition file install/removal
+
+* Tue Jan 17 2006 - damien.carbery@sun.com
+- Created.
29 TODO
@@ -0,0 +1,29 @@
+To do list
+==========
+
+x - Finished task
+
+[x] Static compilation support
+[x] Virtual domain support
+[x] Home users support (/~user/)
+[x] Net interfaces
+[x] GNOME-VFS handler
+[x] Hide version
+[x] Timeout for keepalive connections
+[x] IPv6 support
+[x] PHP handler
+[x] Information handler
+[x] "Include" in configuration file
+[x] SSL support (TLS)
+[x] Add command line parameters
+[x] IP Ranges restrictions
+[x] Improve setenv() calls in cgi handler
+[x] handler_dirlist to implement shorting
+[ ] regex'ed list to Deny
+[ ] handler_dirlist to manage content-length
+[ ] Stat cache
+[ ] Cache for the encoder modules
+[ ] Something like the <DirectoryMatch> Apache's directive
+[ ] CAST-256 rfc2616, Blowfish
+[ ] Add X509 authorization support into Auth methods
+
449 acinclude.m4
@@ -0,0 +1,449 @@
+AC_DEFUN([ACX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG_C
+acx_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+ AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
+ AC_MSG_RESULT($acx_pthread_ok)
+ if test x"$acx_pthread_ok" = xno; then
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+ fi
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try. Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all.
+
+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
+
+# The ordering *is* (sometimes) important. Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+# other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+# doesn't hurt to check since this sometimes defines pthreads too;
+# also defines -D_REENTRANT)
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+
+case "${host_cpu}-${host_os}" in
+ *solaris*)
+
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthread or
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+
+ acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
+ ;;
+esac
+
+if test x"$acx_pthread_ok" = xno; then
+for flag in $acx_pthread_flags; do
+
+ case $flag in
+ none)
+ AC_MSG_CHECKING([whether pthreads work without any flags])
+ ;;
+
+ -*)
+ AC_MSG_CHECKING([whether pthreads work with $flag])
+ PTHREAD_CFLAGS="$flag"
+ ;;
+
+ *)
+ AC_MSG_CHECKING([for the pthreads library -l$flag])
+ PTHREAD_LIBS="-l$flag"
+ ;;
+ esac
+
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Check for various functions. We must include pthread.h,
+ # since some functions may be macros. (On the Sequent, we
+ # need a special flag -Kthread to make this header compile.)
+ # We check for pthread_join because it is in -lpthread on IRIX
+ # while pthread_create is in libc. We check for pthread_attr_init
+ # due to DEC craziness with -lpthreads. We check for
+ # pthread_cleanup_push because it is one of the few pthread
+ # functions on Solaris that doesn't have a non-functional libc stub.
+ # We try pthread_create on general principles.
+ AC_TRY_LINK([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
+ [acx_pthread_ok=yes])
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ AC_MSG_RESULT($acx_pthread_ok)
+ if test "x$acx_pthread_ok" = xyes; then
+ break;
+ fi
+
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$acx_pthread_ok" = xyes; then
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Detect AIX lossage: threads are created detached by default
+ # and the JOINABLE attribute has a nonstandard name (UNDETACHED).
+ AC_MSG_CHECKING([for joinable pthread attribute])
+ AC_TRY_LINK([#include <pthread.h>],
+ [int attr=PTHREAD_CREATE_JOINABLE;],
+ ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
+ if test x"$ok" = xunknown; then
+ AC_TRY_LINK([#include <pthread.h>],
+ [int attr=PTHREAD_CREATE_UNDETACHED;],
+ ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
+ fi
+ if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
+ AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
+ [Define to the necessary symbol if this constant
+ uses a non-standard name on your system.])
+ fi
+ AC_MSG_RESULT(${ok})
+ if test x"$ok" = xunknown; then
+ AC_MSG_WARN([we do not know how to create joinable pthreads])
+ fi
+
+ AC_MSG_CHECKING([if more special flags are required for pthreads])
+ flag=no
+ case "${host_cpu}-${host_os}" in
+ *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
+ *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+ esac
+ AC_MSG_RESULT(${flag})
+ if test "x$flag" != xno; then
+ PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+ fi
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ # More AIX lossage: must compile with cc_r
+ AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
+else
+ PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_pthread_ok" = xyes; then
+ ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+ :
+else
+ acx_pthread_ok=no
+ $2
+fi
+AC_LANG_RESTORE
+])dnl ACX_PTHREAD
+
+
+
+
+AC_DEFUN([SAMBA_SENDFILE], [
+
+#################################################
+# check for sendfile support
+
+with_sendfile_support=yes
+AC_MSG_CHECKING(whether to check to support sendfile)
+AC_ARG_WITH(sendfile-support,
+[ --with-sendfile-support Check for sendfile support (default=yes)],
+[ case "$withval" in
+ yes)
+
+ AC_MSG_RESULT(yes);
+
+ case "$host_os" in
+ *linux*)
+ AC_CACHE_CHECK([for linux sendfile64 support],samba_cv_HAVE_SENDFILE64,[
+ AC_TRY_LINK([#include <sys/sendfile.h>],
+[\
+int tofd, fromfd;
+off64_t offset;
+size_t total;
+ssize_t nwritten = sendfile64(tofd, fromfd, &offset, total);
+],
+samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)])
+
+ AC_CACHE_CHECK([for linux sendfile support],samba_cv_HAVE_SENDFILE,[
+ AC_TRY_LINK([#include <sys/sendfile.h>],
+[\
+int tofd, fromfd;
+off_t offset;
+size_t total;
+ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
+],
+samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
+
+# Try and cope with broken Linux sendfile....
+ AC_CACHE_CHECK([for broken linux sendfile support],samba_cv_HAVE_BROKEN_LINUX_SENDFILE,[
+ AC_TRY_LINK([\
+#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
+#undef _FILE_OFFSET_BITS
+#endif
+#include <sys/sendfile.h>],
+[\
+int tofd, fromfd;
+off_t offset;
+size_t total;
+ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
+],
+samba_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,samba_cv_HAVE_BROKEN_LINUX_SENDFILE=no)])
+
+ if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then
+ AC_DEFINE(HAVE_SENDFILE64,1,[Whether 64-bit sendfile() is available])
+ AC_DEFINE(LINUX_SENDFILE_API,1,[Whether linux sendfile() API is available])
+ AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
+ elif test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
+ AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
+ AC_DEFINE(LINUX_SENDFILE_API,1,[Whether linux sendfile() API is available])
+ AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
+ elif test x"$samba_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then
+ AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken])
+ AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used])
+ else
+ AC_MSG_RESULT(no);
+ fi
+
+ ;;
+ *freebsd*)
+ AC_CACHE_CHECK([for freebsd sendfile support],samba_cv_HAVE_SENDFILE,[
+ AC_TRY_LINK([\
+#include <sys/types.h>
+#include <unistd.h>
+#include <sys/socket.h>
+#include <sys/uio.h>],
+[\
+ int fromfd, tofd, ret, total=0;
+ off_t offset, nwritten;
+ struct sf_hdtr hdr;
+ struct iovec hdtrl;
+ hdr.headers = &hdtrl;
+ hdr.hdr_cnt = 1;
+ hdr.trailers = NULL;
+ hdr.trl_cnt = 0;
+ hdtrl.iov_base = NULL;
+ hdtrl.iov_len = 0;
+ ret = sendfile(fromfd, tofd, offset, total, &hdr, &nwritten, 0);
+],
+samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
+
+ if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
+ AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() support is available])
+ AC_DEFINE(FREEBSD_SENDFILE_API,1,[Whether the FreeBSD sendfile() API is available])
+ AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
+ else
+ AC_MSG_RESULT(no);
+ fi
+ ;;
+
+ *hpux*)
+ AC_CACHE_CHECK([for hpux sendfile64 support],samba_cv_HAVE_SENDFILE64,[
+ AC_TRY_LINK([\
+#include <sys/socket.h>
+#include <sys/uio.h>],
+[\
+ int fromfd, tofd;
+ size_t total=0;
+ struct iovec hdtrl[2];
+ ssize_t nwritten;
+ off64_t offset;
+
+ hdtrl[0].iov_base = 0;
+ hdtrl[0].iov_len = 0;
+
+ nwritten = sendfile64(tofd, fromfd, offset, total, &hdtrl[0], 0);
+],
+samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)])
+ if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then
+ AC_DEFINE(HAVE_SENDFILE64,1,[Whether sendfile64() is available])
+ AC_DEFINE(HPUX_SENDFILE_API,1,[Whether the hpux sendfile() API is available])
+ AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
+ else
+ AC_MSG_RESULT(no);
+ fi
+
+ AC_CACHE_CHECK([for hpux sendfile support],samba_cv_HAVE_SENDFILE,[
+ AC_TRY_LINK([\
+#include <sys/socket.h>
+#include <sys/uio.h>],
+[\
+ int fromfd, tofd;
+ size_t total=0;
+ struct iovec hdtrl[2];
+ ssize_t nwritten;
+ off_t offset;
+
+ hdtrl[0].iov_base = 0;
+ hdtrl[0].iov_len = 0;
+
+ nwritten = sendfile(tofd, fromfd, offset, total, &hdtrl[0], 0);
+],
+samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
+ if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
+ AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
+ AC_DEFINE(HPUX_SENDFILE_API,1,[Whether the hpux sendfile() API is available])
+ AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
+ else
+ AC_MSG_RESULT(no);
+ fi
+ ;;
+
+ *solaris*)
+ AC_CHECK_LIB(sendfile,sendfilev)
+ AC_CACHE_CHECK([for solaris sendfilev64 support],samba_cv_HAVE_SENDFILEV64,[
+ AC_TRY_LINK([\
+#include <sys/sendfile.h>],
+[\
+ int sfvcnt;
+ size_t xferred;
+ struct sendfilevec vec[2];
+ ssize_t nwritten;
+ int tofd;
+
+ sfvcnt = 2;
+
+ vec[0].sfv_fd = SFV_FD_SELF;
+ vec[0].sfv_flag = 0;
+ vec[0].sfv_off = 0;
+ vec[0].sfv_len = 0;
+
+ vec[1].sfv_fd = 0;
+ vec[1].sfv_flag = 0;
+ vec[1].sfv_off = 0;
+ vec[1].sfv_len = 0;
+ nwritten = sendfilev64(tofd, vec, sfvcnt, &xferred);
+],
+samba_cv_HAVE_SENDFILEV64=yes,samba_cv_HAVE_SENDFILEV64=no)])
+
+ if test x"$samba_cv_HAVE_SENDFILEV64" = x"yes"; then
+ AC_DEFINE(HAVE_SENDFILEV64,1,[Whether sendfilev64() is available])
+ AC_DEFINE(SOLARIS_SENDFILE_API,1,[Whether the soloris sendfile() API is available])
+ AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
+ else
+ AC_MSG_RESULT(no);
+ fi
+
+ AC_CACHE_CHECK([for solaris sendfilev support],samba_cv_HAVE_SENDFILEV,[
+ AC_TRY_LINK([\
+#include <sys/sendfile.h>],
+[\
+ int sfvcnt;
+ size_t xferred;
+ struct sendfilevec vec[2];
+ ssize_t nwritten;
+ int tofd;
+
+ sfvcnt = 2;
+
+ vec[0].sfv_fd = SFV_FD_SELF;
+ vec[0].sfv_flag = 0;
+ vec[0].sfv_off = 0;
+ vec[0].sfv_len = 0;
+
+ vec[1].sfv_fd = 0;
+ vec[1].sfv_flag = 0;
+ vec[1].sfv_off = 0;
+ vec[1].sfv_len = 0;
+ nwritten = sendfilev(tofd, vec, sfvcnt, &xferred);
+],
+samba_cv_HAVE_SENDFILEV=yes,samba_cv_HAVE_SENDFILEV=no)])
+
+ if test x"$samba_cv_HAVE_SENDFILEV" = x"yes"; then
+ AC_DEFINE(HAVE_SENDFILEV,1,[Whether sendfilev() is available])
+ AC_DEFINE(SOLARIS_SENDFILE_API,1,[Whether the solaris sendfile() API is available])
+ AC_DEFINE(WITH_SENDFILE,1,[Whether to include sendfile() support])
+ else
+ AC_MSG_RESULT(no);
+ fi
+ ;;
+
+ *)
+ ;;
+ esac
+ ;;
+ *)
+ AC_MSG_RESULT(no)
+ ;;
+ esac ],
+ AC_MSG_RESULT(yes)
+)
+
+])
+
+
+
+
+AC_DEFUN([HYDRA_TCP_CORK], [
+
+AC_MSG_CHECKING([whether TCP_CORK is a valid TCP socket option])
+AC_TRY_COMPILE(
+#include <sys/socket.h>
+#include <netinet/tcp.h>
+#include <netinet/in.h>
+,[
+ int one = 1, fd;
+ if (setsockopt(fd, IPPROTO_TCP, TCP_CORK,
+ (void *) &one, sizeof (one)) == -1)
+ return -1;
+ return 0;
+
+],
+dnl *** FOUND
+AC_DEFINE( HAVE_TCP_CORK, 1, [TCP_CORK was found and will be used])
+AC_MSG_RESULT(yes),
+dnl *** NOT FOUND
+AC_MSG_RESULT(no)
+)
+
+])
59 advanced.conf.sample.pre
@@ -0,0 +1,59 @@
+##
+## Advanced configuration:
+## Don't change it unless you know what you're doing.
+##
+
+##
+## LogFlushInterval:
+## Indicates how often, in seconds, the log cache will be flushed
+##
+LogFlushInterval 5
+
+##
+## The maximum number of file descriptors
+##
+MaxFds 16384
+
+##
+## MaxConnectionReuse: Max number of connection to reuse per thread.
+##
+MaxConnectionReuse 20
+
+##
+## PanicAction: It something terrible happens, like a segmentation fault,
+## Cherokee will execute this program to report the problem. The default
+## action is to send a mail to root with the back-trace.
+##
+PanicAction %prefix%/bin/cherokee-panic
+
+##
+## PollMethod:
+## Force to use a polling method. It's available:
+## epoll, kqueue, ports, poll and select.
+##
+# PollMethod epoll
+
+##
+## Size of the TCP listen queue.
+##
+# ListenQueue 1024
+
+##
+## ThreadNumber:
+## Available policies: fifo, rr, other
+##
+# ThreadNumber 5 {
+# Policy fifo
+# }
+
+##
+## Sendfile configuration: for the platforms that supports it.
+##
+## MinSize: Size in bytes of the smallest file to be sent with sendfile.
+## MaxSize: Size in bytes of the biggest file to be sent with sendfile.
+##
+# Sendfile {
+# MinSize 32768
+# MaxSize 2147483647
+# }
+
99 autogen.sh
@@ -0,0 +1,99 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+PROJECT=cherokee
+
+#include our own macros
+ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4"
+
+DIE=0
+
+test -z "$AUTOMAKE" && AUTOMAKE=automake
+test -z "$ACLOCAL" && ACLOCAL=aclocal
+test -z "$AUTOCONF" && AUTOCONF=autoconf
+test -z "$AUTOHEADER" && AUTOHEADER=autoheader
+test -z "$LIBTOOL" && LIBTOOL=libtool
+test -z "$LIBTOOLIZE" && LIBTOOLIZE=libtoolize
+
+($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have autoconf installed to compile $PROJECT."
+ echo "Download the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have libtool installed to compile gnome-xml."
+ echo "Get ftp://ftp.gnu.org/gnu/libtool/libtool-1.4.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+}
+
+($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have automake installed to compile $PROJECT."
+ echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+}
+
+if test "$DIE" -eq 1; then
+ exit 1
+fi
+
+if test -z "$*"; then
+ echo "I am going to run ./configure with no arguments - if you wish "
+ echo "to pass any to it, please specify them on the $0 command line."
+fi
+
+case $CC in
+*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
+esac
+
+if test -z "$ACLOCAL_FLAGS"; then
+
+ acdir=`$ACLOCAL --print-ac-dir`
+ m4list="etr_socket_nsl.m4 network.m4 sendfile_samba.m4"
+
+ for file in $m4list
+ do
+ if [ ! -f "$acdir/$file" ]; then
+ echo "WARNING: aclocal's directory is $acdir, but..."
+ echo " no file $acdir/$file"
+ echo " You may see fatal macro warnings below."
+ echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
+ echo " environment variable to \"-I /some/dir\", or install"
+ echo " $acdir/$file."
+ echo ""
+ fi
+ done
+fi
+
+echo "Running $ACLOCAL $ACLOCAL_FLAGS..."
+$ACLOCAL $ACLOCAL_FLAGS
+
+# optionally feature autoheader
+($AUTOHEADER --version) < /dev/null > /dev/null 2>&1 && $AUTOHEADER
+
+# run libtoolize ...
+echo "Running libtoolize..."
+$LIBTOOLIZE --force
+
+echo "Running automake..."
+$AUTOMAKE -a $am_opt
+$AUTOHEADER
+echo "Running autoconf..."
+$AUTOCONF
+cd $ORIGDIR
+
+$srcdir/configure --enable-maintainer-mode --enable-more-warnings --enable-debug "$@"
+
+echo
+echo "Now type 'make' to compile $PROJECT."
54 cget.1
@@ -0,0 +1,54 @@
+.\" hey, Emacs: -*- nroff -*-
+.\" cherokee is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation version 2 of the License.
+.\"
+.\" This program is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with this program; see the file COPYING. If not, write to
+.\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+.\"
+.TH Cget 1 "Dicember 20, 2001"
+.\" Please update the above date whenever this man page is modified.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins (default)
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+cget \- Cherokee web downloader
+.SH SYNOPSIS
+.B cget
+.SH DESCRIPTION
+\fBcget\fP is a web downloading tool
+.\" .PP
+.\" It also...
+.SH EXAMPLE
+cget http://www.0x50.org/
+.SH BUGS
+.SS Bug reports
+I would appreciate hearing of any problems you have with Cherokee. I
+would also like to hear from you if you have successfully used Cherokee,
+especially if you are using it for a distribution.
+.PP
+There is a mailing list for discussion among Cherokee users and for
+announcements of new and test versions. To join, send a message to
+cherokee-admin@alobbs.com with the line:
+.PP
+.B subscribe cherokee
+.PP
+in the body of the message. The submission address is cherokee@alobbs.com.
+.\" .SH "SEE ALSO"
+.SH AUTHOR
+Alvaro Lopez Ortega <alvaro@alobbs.com>.
+
20 cget/Makefile.am
@@ -0,0 +1,20 @@
+## Cherokee: src/bench/Makefile.am -*- makefile -*-
+
+INCLUDES = \
+-DCHEROKEE_COMPILATION \
+-I. -I${top_srcdir}/cherokee \
+$(TLS_CFLAGS) \
+$(PTHREAD_CFLAGS) \
+$(LARGEFILE_CFLAGS)
+
+
+cget_LDADD = \
+../cherokee/libcherokee-client.la \
+$(TLS_LIBS) \
+$(PTHREAD_LIBS) \
+$(PTHREAD_CFLAGS)
+
+cget_SOURCES = \
+main.c
+
+bin_PROGRAMS = cget
432 cget/main.c
@@ -0,0 +1,432 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/* Cherokee
+ *
+ * Authors:
+ * Alvaro Lopez Ortega <alvaro@alobbs.com>
+ *
+ * Copyright (C) 2001-2006 Alvaro Lopez Ortega
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#include "common-internal.h"
+
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#ifdef HAVE_TIME_H
+# include <time.h>
+#endif
+
+#include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <strings.h>
+
+#include "util.h"
+#include "url.h"
+#include "header.h"
+#include "fdpoll.h"
+#include "request.h"
+#include "downloader.h"
+#include "downloader-protected.h"
+#include "header-protected.h" /* FIXME! */
+
+#define EXIT_OK 0
+#define EXIT_ERROR 1
+#define POLL_TIME 1000
+#define UNSET_FD -1
+#define COLUM_NUM 20
+#define COLUM_SEP ":"
+
+
+/* Globals..
+ */
+static int output_fd = UNSET_FD;
+static int global_fd = UNSET_FD;
+static cherokee_boolean_t quiet = false;
+static cherokee_boolean_t save_headers = false;
+
+
+static void
+print_help (void)
+{
+ printf ("Cherokee Downloader %s\n"
+ "Usage: cget [options] URL\n\n"
+ "Mandatory arguments to long options are mandatory for short options too.\n\n"
+ "Startup:\n"
+ " -V, --version Print version and exit\n"
+ " -h, --help Print this help\n"
+ "\n"
+ "Logging and input file:\n"
+ " -q, --quiet Quiet (no output)\n"
+ "\n"
+ "Download:\n"
+ " -O --output-document=FILE Write documents to FILE\n"
+ "\n"
+ "HTTP options:\n"
+ " -s, --save-headers Save the HTTP headers to file\n"
+ " --header=STRING insert STRING among the headers\n"
+ "\n"
+ "Report bugs to alvaro@gnu.org\n", PACKAGE_VERSION);
+}
+
+
+static void
+print_usage (void)
+{
+ printf ("Cherokee Downloader %s\n"
+ "Usage: cget [options] URL\n\n"
+ "Try `cget --help' for more options.\n", PACKAGE_VERSION);
+}
+
+
+static void
+print_tuple_str (const char *title, const char *info)
+{
+ int whites;
+ char *tmp;
+
+ if (quiet == true)
+ return;
+
+ whites = COLUM_NUM - strlen(title);
+
+ fprintf (stderr, "%s ", title);
+
+ if (whites > 0) {
+ tmp = (char *) malloc (whites +1);
+ memset (tmp, ' ', whites);
+ tmp[whites] = '\0';
+ fprintf (stderr, "%s", tmp);
+ free (tmp);
+ }
+
+ fprintf (stderr, COLUM_SEP " %s\n", info);
+}
+
+
+static void
+print_tuple_int (const char *title, int num)
+{
+ char tmp[128];
+
+ snprintf (tmp, 128, "%d", num);
+ print_tuple_str (title, tmp);
+}
+
+
+static ret_t
+do_download__init (cherokee_downloader_t *downloader, void *param)
+{
+ cherokee_url_t *url;
+
+ url = &downloader->request.url;
+
+ print_tuple_str ("Host", url->host.buf);
+ print_tuple_str ("Request", url->request.buf);
+ print_tuple_int ("Port", url->port);
+
+ return ret_ok;
+}
+
+
+static ret_t
+do_download__has_headers (cherokee_downloader_t *downloader, void *param)
+{
+ cherokee_url_t *url;
+ cherokee_buffer_t *req;
+ cherokee_header_t *hdr;
+
+ url = &downloader->request.url;
+ req = &url->request;
+ hdr = downloader->header;
+
+ /* Check the response
+ */
+ if (quiet == false) {
+ cherokee_buffer_t *buf;
+
+ cherokee_buffer_new (&buf);
+ cherokee_http_code_copy (HDR_RESPONSE(hdr), buf);
+
+ print_tuple_str ("Response", buf->buf);
+
+ cherokee_buffer_free (buf);
+ }
+
+ if ((! http_type_200 (hdr->response)) && (! save_headers)) {
+ return ret_error;
+ }
+
+ /* Open a new file if needed
+ */
+ if (global_fd == UNSET_FD) {
+ char *name;
+
+ name = strrchr (req->buf, '/');
+ if (name == NULL) {
+ name = "index.html";
+ }
+
+ output_fd = open (name, O_WRONLY, O_CREAT);
+ if (output_fd < 0) {
+ return ret_error;
+ }
+
+ } else {
+ output_fd = global_fd;
+ }
+
+ /* Save the headers?
+ */
+ if (save_headers == true) {
+ ssize_t written;
+ uint32_t len;
+
+ cherokee_header_get_length (hdr, &len);
+ written = write (output_fd, hdr->input_buffer->buf, len);
+ if (written < 0) {
+ PRINT_ERROR_S ("Can not write to output file\n");
+ return ret_error;
+ }
+ }
+
+ return ret_ok;
+}
+
+
+static ret_t
+do_download__read_body (cherokee_downloader_t *downloader, void *param)
+{
+ char tmp[5];
+ char total[5];
+
+ ret_t ret;
+ ssize_t len;
+
+ /* Write down
+ */
+ len = write (output_fd, downloader->body.buf, downloader->body.len);
+ if (len > 0) {
+ ret = cherokee_buffer_move_to_begin (&downloader->body, len);
+ if (ret != ret_ok) return ret;
+ }
+
+ /* Print info
+ */
+ cherokee_strfsize (downloader->content_length, total);
+ cherokee_strfsize (downloader->info.body_recv, tmp);
+
+ fprintf (stderr, "\rDownloading: %s of %s", tmp, total);
+ fflush(stderr);
+
+ return ret_ok;
+}
+
+
+static ret_t
+do_download__finish (cherokee_downloader_t *downloader, void *param)
+{
+ fprintf (stderr, "\n");
+ return ret_ok;
+}
+
+
+static ret_t
+do_download (cherokee_downloader_t *downloader, cherokee_fdpoll_t *fdpoll)
+{
+ int num;
+ ret_t ret;
+
+ for (;;) {
+ /* Inspect the file descriptors
+ */
+ num = cherokee_fdpoll_watch (downloader->fdpoll, POLL_TIME);
+
+ /* Do some work
+ */
+ ret = cherokee_downloader_step (downloader);
+
+ switch (ret) {
+ case ret_ok:
+ case ret_eagain:
+ /* it is go.. continue
+ */
+ break;
+
+ case ret_eof:
+ case ret_error:
+ /* Finished or critical error
+ */
+ return ret;
+
+ default:
+ SHOULDNT_HAPPEN;
+ return ret_error;
+ }
+ }
+
+ return ret_ok;
+}
+
+
+int
+main (int argc, char **argv)
+{
+ int re;
+ ret_t ret;
+ int val;
+ int param_num;
+ int long_index;
+ cuint_t fdlimit;
+ cherokee_fdpoll_t *fdpoll;
+ cherokee_downloader_t *downloader;
+
+
+ struct option long_options[] = {
+ /* Options without arguments */
+ {"help", no_argument, NULL, 'h'},
+ {"version", no_argument, NULL, 'V'},
+ {"quiet", no_argument, NULL, 'q'},
+ {"save-headers", no_argument, NULL, 's'},
+ {"header", required_argument, NULL, 0 },
+ {NULL, 0, NULL, 0}
+ };
+
+ /* Build the fd poll object..
+ */
+ ret = cherokee_sys_fdlimit_get (&fdlimit);
+ if (ret != ret_ok) return EXIT_ERROR;
+
+ ret = cherokee_fdpoll_best_new (&fdpoll, fdlimit, fdlimit);
+ if (ret != ret_ok) return EXIT_ERROR;
+
+ /* Parse known parameters
+ */
+ while ((val = getopt_long (argc, argv, "VshqO:", long_options, &long_index)) != -1) {
+ switch (val) {
+ case 'V':
+ printf ("Cherokee Downloader %s\n"
+ "Written by Alvaro Lopez Ortega <alvaro@gnu.org>\n\n"
+ "Copyright (C) 2001-2006 Alvaro Lopez Ortega.\n"
+ "This is free software; see the source for copying conditions. There is NO\n"
+ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
+ PACKAGE_VERSION);
+ return EXIT_OK;
+
+ case 'O':
+ if (! strncmp (optarg, "-", 1)) {
+ global_fd = 1;
+ } else {
+ global_fd = open (optarg, O_WRONLY | O_CREAT, 0644);
+ if (global_fd < 0) {
+ PRINT_ERROR ("ERROR: Can not open %s\n", optarg);
+ return EXIT_ERROR;
+ }
+ }
+ break;
+
+ case 0:
+ break;
+
+ case 'q':
+ quiet = true;
+ break;
+
+ case 's':
+ save_headers = true;
+ break;
+
+ case 'h':
+ case '?':
+ default:
+ print_help();
+ return EXIT_OK;
+ }
+ }
+
+ /* The rest..
+ */
+ param_num = argc - optind;
+
+ if (param_num <= 0) {
+ print_usage();
+ return EXIT_OK;
+ }
+
+ for (val=optind; val<optind+param_num; val++) {
+ cherokee_buffer_t *url;
+
+ /* Build the url buffer
+ */
+ ret = cherokee_buffer_new (&url);
+ if (ret != ret_ok) return EXIT_ERROR;
+
+ ret = cherokee_buffer_add_va (url, "%s", argv[val]);
+ if (ret != ret_ok) return EXIT_ERROR;
+
+ /* Create the downloader object..
+ */
+ ret = cherokee_downloader_new (&downloader);
+ if (ret != ret_ok) return EXIT_ERROR;
+
+ ret = cherokee_downloader_set_url (downloader, url);
+ if (ret != ret_ok) return EXIT_ERROR;
+
+ ret = cherokee_downloader_set_fdpoll (downloader, fdpoll);
+ if (ret != ret_ok) return EXIT_ERROR;
+
+ ret = cherokee_downloader_connect (downloader);
+ if (ret != ret_ok) return EXIT_ERROR;
+
+ /* Set the callbacks
+ */
+ cherokee_downloader_connect_event (downloader, downloader_event_init, do_download__init, NULL);
+ cherokee_downloader_connect_event (downloader, downloader_event_has_headers, do_download__has_headers, NULL);
+ cherokee_downloader_connect_event (downloader, downloader_event_read_body, do_download__read_body, NULL);
+ cherokee_downloader_connect_event (downloader, downloader_event_finish, do_download__finish, NULL);
+
+ /* Download it!
+ */
+ ret = do_download (downloader, fdpoll);
+ if ((ret != ret_ok) && (ret != ret_eof)) {
+ return EXIT_ERROR;
+ }
+
+ /* Free the objects..
+ */
+ cherokee_buffer_free (url);
+ cherokee_downloader_free (downloader);
+ }
+
+ /* Close the output file
+ */
+ re = close (output_fd);
+ if (re != 0) return EXIT_ERROR;
+
+ return EXIT_OK;
+}
32 cherokee-config.1
@@ -0,0 +1,32 @@
+.TH CHEROKEE
+.SH NAME
+cherokee-config - script to get information about the installed version of Cherokee
+.SH SYNOPSIS
+.B xml-config
+[\-\-prefix\fI[=DIR]\fP] [\-\-libs] [\-\-cflags] [\-\-version] [\-\-help]
+.SH DESCRIPTION
+\fIcherokee-config\fP is a tool that is used to determine the compile and
+linker flags that should be used to compile and link programs that use
+\fICherokee\fP.
+.SH OPTIONS
+.l
+\fIcherokee-config\fP accepts the following options:
+.TP 8
+.B \-\-version
+Print the currently installed version of \fICHEROKEE\fP on the standard output.
+.TP 8
+.B \-\-libs
+Print the linker flags that are necessary to link a \fICHEROKEE\fP program.
+.TP 8
+.B \-\-cflags
+Print the compiler flags that are necessary to compile a \fICHEROKEE\fP program
+.
+.TP 8
+.B \-\-prefix=PREFIX
+If specified, use PREFIX instead of the installation prefix that
+\fICHEROKEE\fP was built with when computing the output for the
+\-\-cflags and \-\-libs options. This option must be specified before
+any \-\-libs or \-\-cflags options.
+.SH AUTHOR
+This manual page was written by Fredrik Hallenberg <hallon@lysator.liu.se>,
+for the Debian GNU/linux system (but may be used by others).
61 cherokee-config.in
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+exec_prefix_set=no
+
+usage="\
+Usage: @PACKAGE@-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
+
+if test $# -eq 0; then
+ echo "${usage}" 1>&2
+ exit 1
+fi
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case $1 in
+ --prefix=*)
+ prefix=$optarg
+ if test $exec_prefix_set = no ; then
+ exec_prefix=$optarg
+ fi
+ ;;
+ --prefix)
+ echo $prefix
+ ;;
+ --exec-prefix=*)
+ exec_prefix=$optarg
+ exec_prefix_set=yes
+ ;;
+ --exec-prefix)
+ echo $exec_prefix
+ ;;
+ --version)
+ echo @VERSION@
+ ;;
+ --cflags)
+ if test @includedir@ != /usr/include ; then
+ includes=-I@includedir@
+ fi
+ echo $includes -I@includedir@/cherokee
+ ;;
+ --libs)
+ if [ "`uname`" = "SunOS" ]; then
+ libdirs="-L@libdir@ -R@libdir@"
+ else
+ libdirs="-L@libdir@"
+ fi
+ echo $libdirs -lcherokee-base -lcherokee-server -lcherokee-client
+ ;;
+ *)
+ echo "${usage}" 1>&2
+ exit 1
+ ;;
+ esac
+ shift
+done
54 cherokee.1
@@ -0,0 +1,54 @@
+.\" hey, Emacs: -*- nroff -*-
+.\" cherokee is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation version 2 of the License.
+.\"
+.\" This program is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with this program; see the file COPYING. If not, write to
+.\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+.\"
+.TH Cherokee 1 "Dicember 20, 2001"
+.\" Please update the above date whenever this man page is modified.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins (default)
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+cherokee \- Cherokee web server
+.SH SYNOPSIS
+.B cherokee
+.SH DESCRIPTION
+\fBcherokee\fP is an extremely fast, flexible and embedable web server.
+.\" .PP
+.\" It also...
+.SH EXAMPLE
+cherokee &
+.SH BUGS
+.SS Bug reports
+I would appreciate hearing of any problems you have with Cherokee. I
+would also like to hear from you if you have successfully used Cherokee,
+especially if you are using it for a distribution.
+.PP
+There is a mailing list for discussion among Cherokee users and for
+announcements of new and test versions. To join, send a message to
+cherokee-admin@alobbs.com with the line:
+.PP
+.B subscribe cherokee
+.PP
+in the body of the message. The submission address is cherokee@alobbs.com.
+.\" .SH "SEE ALSO"
+.\" cherokee.conf (8)
+.SH AUTHOR
+Alvaro Lopez Ortega <alvaro@alobbs.com>.
120 cherokee.conf.sample.pre
@@ -0,0 +1,120 @@
+##
+## cherokee.conf -- Cherokee HTTP server configuration file
+##
+
+##
+## Port: The port to which the standalone server listens. For
+## ports < 1023, you will need cherokee to be run as root initially.
+## Security: if you do start the server as root, be sure not to set
+## "User" to root.
+##
+Port 80
+
+##
+## PortTLS: The port to which the secure server listens. Default 443.
+##
+# PortTLS 443
+
+##
+## IPv6 support
+##
+IPv6 Off
+
+##
+## This directiveis used to tell the server which IP address to listen to.
+##
+#Listen 127.0.0.1
+
+##
+## If you wish cherokee to run as a different user or group, you must run
+## cherokee as root initially and it will switch.
+##
+## Eg: User www-data
+## Group www-data
+##
+## Eg: User 65534
+## Group 65534
+##
+#User nobody
+#Group nogroup
+
+##
+## Chroot:
+##
+# Chroot %wwwroot%
+
+##
+## Timeout: The number of seconds before receives and sends time out.
+##
+Timeout 60
+
+##
+## KeepAlive: Whether or not to allow persistent connections (more than
+## one request per connection). Set to "Off" to deactivate.
+##
+KeepAlive On
+
+##
+## MaxKeepAliveRequests: The MaxKeepAliveRequests directive limits the
+## number of requests allowed per connection when KeepAlive is on.
+## We recommend that this setting be kept to a high value for maximum
+## server performance.
+##
+MaxKeepAliveRequests 500
+
+##
+## ServerTokens: This directive configures what you return as the Server
+## HTTP response Header. The default is 'Full' which sends information about
+## the OS-Type and compiled in modules. Full conveys the most information,
+## and Product the least.
+##
+## Product - Cherokee
+## Minor - Cherokee/0.0
+## Minimal - Cherokee/0.0.0
+## OS - Cherokee/0.0.0 (UNIX)
+## Full - Cherokee/0.0.0 (UNIX) Ext/0.0 Ext2/0.0
+##
+ServerTokens Full
+
+##
+## Load the GZip encoder plugin
+## only used if the client support the encoding ("Accept-Encoding:")
+##
+Encoder gzip {
+ Allow html, htm, txt
+ Deny jpg, png, gz, php
+}
+
+##
+## PidFile: The file in which the server should record its process
+## identification number when it starts.
+##
+PidFile /var/run/cherokee.pid
+
+##
+## Icons: Extension to icon file.
+##
+Icons %sysconfdir%/cherokee/icons.conf
+
+##
+## MimeFile: Mime types file. By default you should leave it
+## commented
+##
+MimeFile %sysconfdir%/cherokee/mime.types
+MimeFile %sysconfdir%/cherokee/mime.compression.types
+
+##
+## Advanced settings, do not change if you are not sure..
+##
+Include %sysconfdir%/cherokee/advanced.conf
+
+##
+## Include the module configuration:
+##
+Include %sysconfdir%/cherokee/mods-enabled
+
+##
+## Include the virtual host configuration:
+##
+Include %sysconfdir%/cherokee/sites-enabled
+
171 cherokee.m4
@@ -0,0 +1,171 @@
+# Configure paths for Cherokee
+# originally by Owen Taylor
+
+dnl AM_PATH_CHEROKEE([MINIMUM-VERSION, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
+dnl Test for CHEROKEE, and define CHEROKEE_CFLAGS and CHEROKEE_LIBS
+dnl
+AC_DEFUN([AM_PATH_CHEROKEE],[
+AC_SYS_LARGEFILE
+
+dnl
+dnl Get the cflags and libraries from the cherokee-config script
+dnl
+AC_ARG_WITH(cherokee-prefix,[ --with-cherokee-prefix=PFX Prefix where Cherokee is
+installed (optional)],
+ cherokee_prefix="$withval", cherokee_prefix="")
+AC_ARG_WITH(cherokee-exec-prefix,[ --with-cherokee-exec-prefix=PFX Exec prefix
+where Cherokee is installed (optional)],
+ cherokee_exec_prefix="$withval", cherokee_exec_prefix="")
+AC_ARG_ENABLE(cherokeetest, [ --disable-cherokeetest Do not try to compile
+and run a test Cherokee program],
+ , enable_cherokeetest=yes)
+
+ if test x$cherokee_exec_prefix != x ; then
+ cherokee_args="$cherokee_args --exec-prefix=$cherokee_exec_prefix"
+ if test x${CHEROKEE_CONFIG+set} != xset ; then
+ CHEROKEE_CONFIG=$cherokee_exec_prefix/bin/cherokee-config
+ fi
+ fi
+ if test x$cherokee_prefix != x ; then
+ cherokee_args="$cherokee_args --prefix=$cherokee_prefix"
+ if test x${CHEROKEE_CONFIG+set} != xset ; then
+ CHEROKEE_CONFIG=$cherokee_prefix/bin/cherokee-config
+ fi
+ fi
+
+ AC_PATH_PROG(CHEROKEE_CONFIG, cherokee-config, no)
+ min_cherokee_version=ifelse([$1], ,0.4.18,$1)
+ AC_MSG_CHECKING(for CHEROKEE - version >= $min_cherokee_version)
+ no_cherokee=""
+ if test "$CHEROKEE_CONFIG" = "no" ; then
+ no_cherokee=yes
+ else
+ CHEROKEE_CFLAGS=`$CHEROKEE_CONFIG $cherokeeconf_args --cflags`
+ CHEROKEE_LIBS=`$CHEROKEE_CONFIG $cherokeeconf_args --libs`
+
+ cherokee_major_version=`$CHEROKEE_CONFIG $cherokee_args --version | \
+ sed 's/\([[0-9]]\+\)\.\([[0-9]]\+\)\.\([[0-9]]\+\)\(b\?[[0-9]]\+\)/\1/'`
+ cherokee_minor_version=`$CHEROKEE_CONFIG $cherokee_args --version | \
+ sed 's/\([[0-9]]\+\)\.\([[0-9]]\+\)\.\([[0-9]]\+\)\(b\?[[0-9]]\+\)/\2/'`
+ cherokee_micro_version=`$CHEROKEE_CONFIG $cherokee_config_args --version | \
+ sed 's/\([[0-9]]\+\)\.\([[0-9]]\+\)\.\([[0-9]]\+\)\(b\?[[0-9]]\+\)/\3/'`
+ if test "x$enable_cherokeetest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $CHEROKEE_CFLAGS $SDL_CFLAGS"
+ LIBS="$LIBS $CHEROKEE_LIBS $SDL_LIBS"
+dnl
+dnl Now check if the installed CHEROKEE is sufficiently new. (Also sanity
+dnl checks the results of cherokee-config to some extent
+dnl
+ rm -f conf.cherokeetest
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "cherokee.h"
+
+char*
+my_strdup (char *str)
+{
+ char *new_str;
+
+ if (str)
+ {
+ new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
+ strcpy (new_str, str);
+ }
+ else
+ new_str = NULL;
+
+ return new_str;
+}
+
+int main (int argc, char *argv[])
+{
+ int major, minor, micro;
+ char *tmp_version;
+
+ /* This hangs on some systems (?)
+ system ("touch conf.cherokeetest");
+ */
+ { FILE *fp = fopen("conf.cherokeetest", "a"); if ( fp ) fclose(fp); }
+
+ /* HP/UX 9 (%@#!) writes to sscanf strings */
+ tmp_version = my_strdup("$min_cherokee_version");
+ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_cherokee_version");
+ exit(1);
+ }
+
+ if (($cherokee_major_version > major) ||
+ (($cherokee_major_version == major) && ($cherokee_minor_version > minor)) ||
+ (($cherokee_major_version == major) && ($cherokee_minor_version == minor) && ($cherokee_micro_version >= micro)))
+ {
+ return 0;
+ }
+ else
+ {
+ printf("\n*** 'cherokee-config --version' returned %d.%d.%d, but the minimum version\n",
+ $cherokee_major_version, $cherokee_minor_version, $cherokee_micro_version);
+ printf("*** of Cherokee required is %d.%d.%d. If cherokee-config is correct, then it is\n",
+ major, minor, micro);
+ printf("*** best to upgrade to the required version.\n");
+ printf("*** If cherokee-config was wrong, set the environment variable CHEROKEE_CONFIG\n");
+ printf("*** to point to the correct copy of cherokee-config, and remove the file\n");
+ printf("*** config.cache before re-running configure\n");
+ return 1;
+ }
+}
+
+],, no_cherokee=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ if test "x$no_cherokee" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test "$CHEROKEE_CONFIG" = "no" ; then
+ echo "*** The cherokee-config script installed by Cherokee could not be found"
+ echo "*** If Cherokee was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the CHEROKEE_CONFIG environment variable to the"
+ echo "*** full path to cherokee-config."
+ else
+ if test -f conf.cherokeetest ; then
+ :
+ else
+ echo "*** Could not run Cherokee test program, checking why..."
+ CFLAGS="$CFLAGS $CHEROKEE_CFLAGS $SDL_CFLAGS"
+ LIBS="$LIBS $CHEROKEE_LIBS $SDL_LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include "cherokee.h"
+], [ return 0; ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding Cherokee or finding the wrong"
+ echo "*** version of Cherokee. If it is not finding Cherokee, you'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+ [ echo "*** The test program failed to compile or link. See the file config.log for the"
+ echo "*** exact error that occured. This usually means Cherokee was incorrectly installed"
+ echo "*** or that you have moved Cherokee since it was installed. In the latter case, you"
+ echo "*** may want to edit the cherokee-config script: $CHEROKEE_CONFIG" ])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ CHEROKEE_CFLAGS=""
+ CHEROKEE_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(CHEROKEE_CFLAGS)
+ AC_SUBST(CHEROKEE_LIBS)
+ rm -f conf.cherokeetest
+])
11 cherokee.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+
+Name: Cherokee
+Description: Cherokee web server framework
+Version: @VERSION@
+Libs: -L${libdir} -lcherokee-base -lcherokee-server -lcherokee-client
+Cflags: -I${includedir} -I${includedir}/cherokee
61 cherokee.spec.in
@@ -0,0 +1,61 @@
+# Cherokee
+# Copyright (C) 2001-2006 Alvaro Lopez Ortega
+
+Name: @PACKAGE@
+Version: @VERSION@
+Release: 1
+License: GPL
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+Docdir: %{_datadir}/doc
+Autoreqprov: on
+Source: %{name}-%{version}.tar.gz
+Summary: Flexible and Fast web server
+Group: Pro