├── debian ├── compat ├── dirs ├── mod_R.load ├── install ├── libapache2-mod-r-base.install ├── libapache2-mod-r-base.postinst ├── libapache2-mod-r-base.postrm ├── control ├── rules └── changelog ├── mod_R.h.in ├── test ├── brew │ ├── info.rhtml │ ├── dllinfo.rhtml │ ├── foo.rhtml │ ├── search.rhtml │ ├── simple.rhtml │ ├── useR2007sim.rhtml │ ├── useR2007ajax.rhtml │ ├── useR2007plot.rhtml │ ├── dynlex.rhtml │ ├── useR2007.css │ └── useR2007.rhtml ├── confs │ └── local ├── mime.types ├── favicon.ico ├── spinner.gif ├── warning.R ├── r-script.R ├── failale.R ├── callwarning.R ├── relocation.R ├── sendBin.r ├── PreserveEnv.R ├── useR2007.R ├── read.r ├── index.html ├── useR2007.js ├── helloworld.r ├── rshell.R ├── recBinLarge.r ├── dynlex2.r ├── dynlex.r ├── recBin.r ├── RookTest.R ├── useR2007.css └── AppServer.R ├── libapreq2 ├── module │ ├── apache │ │ ├── .deps │ │ │ ├── command.Plo │ │ │ └── handle.Plo │ │ ├── apreq_private_apache.h │ │ ├── apreq_module_apache.h │ │ ├── t │ │ │ └── c-modules │ │ │ │ ├── apreq_redirect_test │ │ │ │ └── mod_apreq_redirect_test.c │ │ │ │ ├── apreq_big_request_test │ │ │ │ └── mod_apreq_big_request_test.c │ │ │ │ └── apreq_request_test │ │ │ │ └── mod_apreq_request_test.c │ │ └── Makefile.am │ ├── t │ │ ├── conf │ │ │ ├── ssl │ │ │ │ ├── httpd-passphrase.pl.PL │ │ │ │ └── proxyssl.conf.in │ │ │ └── extra.conf.in │ │ ├── c-modules │ │ │ ├── apreq_redirect_test │ │ │ │ └── mod_apreq_redirect_test.c │ │ │ ├── apreq_big_request_test │ │ │ │ └── mod_apreq_big_request_test.c │ │ │ ├── apreq_request_test │ │ │ │ └── mod_apreq_request_test.c │ │ │ └── apreq_cookie_test │ │ │ │ └── mod_apreq_cookie_test.c │ │ ├── cookie.t │ │ └── big_request.t │ ├── Makefile.am │ └── apache2 │ │ ├── Makefile.am │ │ └── apreq_private_apache2.h ├── library │ ├── t │ │ ├── error.t │ │ ├── util.t │ │ ├── cookie.t │ │ ├── params.t │ │ ├── parsers.t │ │ ├── version.t │ │ ├── Makefile.am │ │ └── version.c │ ├── Makefile.am │ ├── version.c │ └── module.c ├── glue │ ├── README │ ├── perl │ │ ├── xsbuilder │ │ │ ├── APR │ │ │ │ └── Request │ │ │ │ │ ├── Apache2 │ │ │ │ │ ├── APR__Request__Apache2.h │ │ │ │ │ ├── Apache2.pm │ │ │ │ │ ├── Apache2.xs │ │ │ │ │ └── Apache2.pod │ │ │ │ │ ├── Error │ │ │ │ │ ├── Error.pm │ │ │ │ │ ├── APR__Request__Error.h │ │ │ │ │ ├── Error.pod │ │ │ │ │ └── Error.xs │ │ │ │ │ ├── Request.pm │ │ │ │ │ ├── CGI │ │ │ │ │ ├── CGI.xs │ │ │ │ │ ├── CGI.pm │ │ │ │ │ └── CGI.pod │ │ │ │ │ ├── Cookie │ │ │ │ │ └── Cookie.pm │ │ │ │ │ ├── Param │ │ │ │ │ └── Param.pm │ │ │ │ │ └── Request.pod │ │ │ ├── maps │ │ │ │ ├── apreq_structures.map │ │ │ │ ├── apreq_types.map │ │ │ │ └── apreq_functions.map │ │ │ └── apreq_xs_preperl.h │ │ └── t │ │ │ ├── conf │ │ │ └── extra.conf.in │ │ │ ├── response │ │ │ ├── TestAPI │ │ │ │ ├── error.pm │ │ │ │ ├── module.pm │ │ │ │ ├── cookie.pm │ │ │ │ └── param.pm │ │ │ └── TestApReq │ │ │ │ ├── big_input.pm │ │ │ │ ├── inherit.pm │ │ │ │ ├── cookie.pm │ │ │ │ └── upload.pm │ │ │ ├── REPORT │ │ │ ├── SMOKE │ │ │ ├── apreq │ │ │ ├── inherit.t │ │ │ ├── request.t │ │ │ ├── upload.t │ │ │ ├── big_input.t │ │ │ └── cookie.t │ │ │ └── TEST.PL │ └── Makefile.am ├── CHANGES ├── docs │ ├── html │ │ ├── doxygen.png │ │ ├── feather.gif │ │ ├── apreq_changes.html │ │ ├── apreq_notice.html │ │ ├── functions_rela.html │ │ ├── dirs.html │ │ ├── pages.html │ │ ├── dir_000002.html │ │ ├── dir_000003.html │ │ ├── dir_000001.html │ │ ├── group__apreq__lang.html │ │ ├── globals_enum.html │ │ ├── modules.html │ │ ├── group__apreq__module.html │ │ ├── group__apreq__xs.html │ │ ├── globals_eval.html │ │ ├── globals_type.html │ │ └── annotated.html │ └── man │ │ └── man3 │ │ ├── apreq_changes.3 │ │ ├── apreq_faq.3 │ │ ├── apreq_xs_cookie.3 │ │ ├── apreq_xs_upload.3 │ │ ├── apreq_xs_request.3 │ │ ├── apreq_notice.3 │ │ ├── _home_joe_src_apache_httpd_apreq_trunk_module_apache_.3 │ │ ├── _home_joe_src_apache_httpd_apreq_trunk_module_apache2_.3 │ │ ├── _home_joe_src_apache_httpd_apreq_trunk_module_.3 │ │ ├── apreq_lang.3 │ │ ├── apreq_module.3 │ │ ├── apreq_xs.3 │ │ ├── todo.3 │ │ ├── apreq_value_t.3 │ │ ├── apreq_param_t.3 │ │ ├── _home_joe_src_apache_httpd_apreq_trunk_include_.3 │ │ ├── apreq_handle_t.3 │ │ ├── apreq_hook_t.3 │ │ ├── libapreq2.3 │ │ ├── apreq_cookie_t.3 │ │ └── apreq_parser_t.3 ├── NOTICE ├── include │ ├── Makefile.am │ ├── apreq_config.h.in │ └── groups.dox.in ├── build │ ├── dox.foot │ ├── dox.head │ ├── get-version.sh │ ├── WEBSITE │ ├── doxygen.conf.in │ └── announcement.pl ├── win32 │ ├── util.pl │ └── README ├── META.yml ├── PREREQUISITES ├── FAQ.pod ├── configure.ac ├── mkinstalldirs ├── Makefile.PL ├── buildconf └── INSTALL ├── rpm ├── test ├── 99-rapache.conf ├── 00-rapache.conf ├── rapache-openSUSE_13.2.spec └── rapache.spec ├── NOTICE ├── tools ├── brewweb ├── create_tarball_release └── config_http.R ├── m4 ├── ltversion.m4 └── ax_with_apxs.m4 └── Makefile.am /debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /mod_R.h.in: -------------------------------------------------------------------------------- 1 | #define R_HOME "@RHOME@" 2 | -------------------------------------------------------------------------------- /test/brew/info.rhtml: -------------------------------------------------------------------------------- 1 | <% RApacheInfo() %> 2 | -------------------------------------------------------------------------------- /libapreq2/module/apache/.deps/command.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /libapreq2/module/apache/.deps/handle.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /test/confs/local: -------------------------------------------------------------------------------- 1 | # Place local conf snippets here 2 | -------------------------------------------------------------------------------- /libapreq2/library/t/error.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | exec './error' 3 | -------------------------------------------------------------------------------- /libapreq2/library/t/util.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | exec './util' 3 | -------------------------------------------------------------------------------- /libapreq2/glue/README: -------------------------------------------------------------------------------- 1 | Language bindings go in glue//. 2 | -------------------------------------------------------------------------------- /libapreq2/library/t/cookie.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | exec './cookie' 3 | -------------------------------------------------------------------------------- /libapreq2/library/t/params.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | exec './params' 3 | -------------------------------------------------------------------------------- /libapreq2/library/t/parsers.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | exec './parsers' 3 | -------------------------------------------------------------------------------- /libapreq2/library/t/version.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | exec './version' 3 | -------------------------------------------------------------------------------- /test/mime.types: -------------------------------------------------------------------------------- 1 | text/html html htm shtml 2 | text/css css 3 | -------------------------------------------------------------------------------- /debian/dirs: -------------------------------------------------------------------------------- 1 | usr/lib/apache2/modules 2 | etc/apache2/mods-available 3 | -------------------------------------------------------------------------------- /rpm/test: -------------------------------------------------------------------------------- 1 | cat("Todays lucky numers are:\n\n") 2 | print(rnorm(100)) 3 | -------------------------------------------------------------------------------- /debian/mod_R.load: -------------------------------------------------------------------------------- 1 | LoadModule R_module /usr/lib/apache2/modules/mod_R.so 2 | -------------------------------------------------------------------------------- /libapreq2/CHANGES: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeffreyhorner/rapache/HEAD/libapreq2/CHANGES -------------------------------------------------------------------------------- /test/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeffreyhorner/rapache/HEAD/test/favicon.ico -------------------------------------------------------------------------------- /test/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeffreyhorner/rapache/HEAD/test/spinner.gif -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/Apache2/APR__Request__Apache2.h: -------------------------------------------------------------------------------- 1 | #include "mod_perl.h" 2 | -------------------------------------------------------------------------------- /debian/install: -------------------------------------------------------------------------------- 1 | .libs/mod_R.so usr/lib/apache2/modules 2 | debian/mod_R.load etc/apache2/mods-available 3 | -------------------------------------------------------------------------------- /test/warning.R: -------------------------------------------------------------------------------- 1 | cat('options()$warn is',getOption('warn'),'\n') 2 | cat('warnings:\n') 3 | print(warnings()) 4 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | This product includes software developed by 2 | The Apache Software Foundation (http://www.apache.org/). 3 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/Apache2/Apache2.pm: -------------------------------------------------------------------------------- 1 | require APR::Request; 2 | push @ISA, "APR::Request"; 3 | -------------------------------------------------------------------------------- /libapreq2/docs/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeffreyhorner/rapache/HEAD/libapreq2/docs/html/doxygen.png -------------------------------------------------------------------------------- /libapreq2/docs/html/feather.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeffreyhorner/rapache/HEAD/libapreq2/docs/html/feather.gif -------------------------------------------------------------------------------- /rpm/99-rapache.conf: -------------------------------------------------------------------------------- 1 | # 2 | LoadModule R_module modules/mod_R.so 3 | # 4 | 5 | -------------------------------------------------------------------------------- /debian/libapache2-mod-r-base.install: -------------------------------------------------------------------------------- 1 | .libs/mod_R.so usr/lib/apache2/modules 2 | debian/mod_R.load etc/apache2/mods-available 3 | -------------------------------------------------------------------------------- /libapreq2/NOTICE: -------------------------------------------------------------------------------- 1 | This product includes software developed by 2 | The Apache Software Foundation (http://www.apache.org/). 3 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/Error/Error.pm: -------------------------------------------------------------------------------- 1 | use APR::Error; 2 | our @ISA = qw/APR::Error APR::Request/; 3 | 4 | -------------------------------------------------------------------------------- /libapreq2/docs/html/apreq_changes.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeffreyhorner/rapache/HEAD/libapreq2/docs/html/apreq_changes.html -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_changes.3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeffreyhorner/rapache/HEAD/libapreq2/docs/man/man3/apreq_changes.3 -------------------------------------------------------------------------------- /test/r-script.R: -------------------------------------------------------------------------------- 1 | fooey <- function(file,env){ 2 | setContentType("text/plain") 3 | cat("File:",file,"contents:\n") 4 | source(file) 5 | } 6 | -------------------------------------------------------------------------------- /test/failale.R: -------------------------------------------------------------------------------- 1 | handler <- function() { 2 | setContentType("text/plain") 3 | setStatus(400L) 4 | cat("Hi, I'm Ale!\n") 5 | OK 6 | } 7 | -------------------------------------------------------------------------------- /libapreq2/module/t/conf/ssl/httpd-passphrase.pl.PL: -------------------------------------------------------------------------------- 1 | #for testing SSLPassPhraseDialog exec:@ServerRoot@/conf/ssl/httpd-passphrase.pl 2 | print "httpd\n"; 3 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_faq.3: -------------------------------------------------------------------------------- 1 | .TH "apreq_faq" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | apreq_faq \- FAQ 6 | 7 | -------------------------------------------------------------------------------- /test/callwarning.R: -------------------------------------------------------------------------------- 1 | cat('options()$warn is',getOption('warn'),'\n') 2 | for (i in 1:100) warning("warning! you have been warned!") 3 | cat('warnings:\n') 4 | print(warnings()) 5 | -------------------------------------------------------------------------------- /test/brew/dllinfo.rhtml: -------------------------------------------------------------------------------- 1 |
2 | <% print(getLoadedDLLs()) %>
3 | Symbols for "(embedding)"
4 | <% print(getDLLRegisteredRoutines(getLoadedDLLs()[['(embedding)']])) %>
5 | 
6 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_xs_cookie.3: -------------------------------------------------------------------------------- 1 | .TH "Apache2::Cookie" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | Apache2::Cookie \- 6 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_xs_upload.3: -------------------------------------------------------------------------------- 1 | .TH "Apache2::Upload" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | Apache2::Upload \- 6 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/Error/APR__Request__Error.h: -------------------------------------------------------------------------------- 1 | static XS(XS_APR__Request__Error_nil) 2 | { 3 | dXSARGS; 4 | (void)items; 5 | XSRETURN_EMPTY; 6 | } 7 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_xs_request.3: -------------------------------------------------------------------------------- 1 | .TH "Apache2::Request" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | Apache2::Request \- 6 | -------------------------------------------------------------------------------- /test/brew/foo.rhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Brew Templating Test 2

4 |
 5 | <% 
 6 | 	RApacheOutputErrors(TRUE)
 7 | 	stem(rnorm(100)) 
 8 | 	OK
 9 | %>
10 | 
11 | 12 | 13 | -------------------------------------------------------------------------------- /test/relocation.R: -------------------------------------------------------------------------------- 1 | handler <- function(){ 2 | loc <- '/index.html' 3 | if (!is.null(GET) && !is.null(GET$loc) && GET$loc != '') 4 | loc <- GET$loc 5 | setHeader("Location",loc) 6 | return(HTTP_MOVED_TEMPORARILY) 7 | } 8 | -------------------------------------------------------------------------------- /test/brew/search.rhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Brew Templating

4 | <% for (i in search()){ %> 5 |

Contents of <%=i%>

6 |
<% print(ls(i)) %>
7 | <% } %> 8 | <% stop("foo") %> 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/sendBin.r: -------------------------------------------------------------------------------- 1 | setContentType("image/png") 2 | t <- tempfile() 3 | png(t,type="cairo") 4 | plot(rnorm(10)) 5 | dev.off() 6 | setHeader('Content-Length',file.info(t)$size) 7 | sendBin(readBin(t,'raw',n=file.info(t)$size)) 8 | unlink(t) 9 | DONE 10 | -------------------------------------------------------------------------------- /libapreq2/include/Makefile.am: -------------------------------------------------------------------------------- 1 | pkgincludedir = $(includedir)/@APREQ_LIBNAME@ 2 | pkginclude_HEADERS = apreq.h apreq_cookie.h apreq_error.h \ 3 | apreq_module.h apreq_param.h apreq_parser.h \ 4 | apreq_util.h apreq_version.h 5 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/conf/extra.conf.in: -------------------------------------------------------------------------------- 1 | ScriptAlias /cgi-bin/ "@ServerRoot@/cgi-bin/" 2 | 3 | LockFile @ServerRoot@/logs/accept.lock 4 | 5 | 6 | 7 | AllowOverride None 8 | Options None 9 | 10 | 11 | -------------------------------------------------------------------------------- /libapreq2/module/t/conf/extra.conf.in: -------------------------------------------------------------------------------- 1 | ScriptAlias /cgi-bin/ "@ServerRoot@/cgi-bin/" 2 | 3 | LockFile @ServerRoot@/logs/accept.lock 4 | 5 | 6 | 7 | AllowOverride None 8 | Options None 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/PreserveEnv.R: -------------------------------------------------------------------------------- 1 | foo <- 'bar' 2 | 3 | main <- function(){ 4 | setContentType('text/html') 5 | cat('

Hello',foo,'!

\n') 6 | foo <<- 'touched by main' 7 | } 8 | 9 | handler <- function(){ 10 | setContentType('text/html') 11 | cat('

Hello',foo,'!

\n') 12 | foo <<- 'touched by handler' 13 | } 14 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_notice.3: -------------------------------------------------------------------------------- 1 | .TH "apreq_notice" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | apreq_notice \- NOTICE 6 | .PP 7 | .nf 8 | This product includes software developed by 9 | The Apache Software Foundation (http://www.apache.org/). 10 | .fi 11 | .PP 12 | 13 | -------------------------------------------------------------------------------- /libapreq2/module/apache/apreq_private_apache.h: -------------------------------------------------------------------------------- 1 | #define CORE_PRIVATE 2 | #include "http_config.h" 3 | #undef CORE_PRIVATE 4 | 5 | extern module MODULE_VAR_EXPORT apreq_module; 6 | 7 | struct dir_config { 8 | const char *temp_dir; 9 | apr_uint64_t read_limit; 10 | apr_size_t brigade_limit; 11 | }; 12 | -------------------------------------------------------------------------------- /rpm/00-rapache.conf: -------------------------------------------------------------------------------- 1 | # EL < 7 does not load ./conf.modules.d/ 2 | 3 | LoadModule R_module modules/mod_R.so 4 | 5 | 6 | # Sites 7 | 8 | SetHandler r-info 9 | 10 | 11 | 12 | SetHandler r-script 13 | RHandler sys.source 14 | 15 | 16 | -------------------------------------------------------------------------------- /debian/libapache2-mod-r-base.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | case "$1" in 6 | configure) 7 | : 8 | a2enmod mod_R 9 | ;; 10 | abort-upgrade | abort-remove | abort-deconfigure) 11 | : 12 | ;; 13 | *) echo "$0: didn't understand being called with \`$1'" 1>&2 14 | exit 1;; 15 | esac 16 | 17 | #DEBHELPER# 18 | 19 | exit 0 20 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/_home_joe_src_apache_httpd_apreq_trunk_module_apache_.3: -------------------------------------------------------------------------------- 1 | .TH "module/apache/ Directory Reference" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | module/apache/ Directory Reference \- 6 | .SS "Files" 7 | 8 | .in +1c 9 | .ti -1c 10 | .RI "file \fBapreq_module_apache.h\fP" 11 | .br 12 | .in -1c 13 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/_home_joe_src_apache_httpd_apreq_trunk_module_apache2_.3: -------------------------------------------------------------------------------- 1 | .TH "module/apache2/ Directory Reference" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | module/apache2/ Directory Reference \- 6 | .SS "Files" 7 | 8 | .in +1c 9 | .ti -1c 10 | .RI "file \fBapreq_module_apache2.h\fP" 11 | .br 12 | .in -1c 13 | -------------------------------------------------------------------------------- /tools/brewweb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | library(brew) 3 | library(Rook) 4 | 5 | h <- file.path(getwd(),'website') 6 | t <- file.path(h,'templates') 7 | 8 | setwd(t) 9 | for (p in list.files(pattern='\\.html')){ 10 | inputfile <- file.path(t,p) 11 | outputfile <- file.path(h,p) 12 | cat(inputfile,'\n') 13 | brew(inputfile,outputfile,tplParser=Utils$escape_html) 14 | } 15 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/_home_joe_src_apache_httpd_apreq_trunk_module_.3: -------------------------------------------------------------------------------- 1 | .TH "module/ Directory Reference" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | module/ Directory Reference \- 6 | .SS "Directories" 7 | 8 | .in +1c 9 | .ti -1c 10 | .RI "directory \fBapache\fP" 11 | .br 12 | .ti -1c 13 | .RI "directory \fBapache2\fP" 14 | .br 15 | .in -1c 16 | -------------------------------------------------------------------------------- /tools/create_tarball_release: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Call this from the top level dir like so: 3 | # ./tools/create_tarball_release 4 | # Will create the tarball in the top level dir 5 | MOD_R_VERSION=`grep "define MOD_R_VERSION" mod_R.c | awk '{print $3}' | tr -d \"` 6 | echo creating version $MOD_R_VERSION 7 | git archive --format=tar --prefix=rapache-${MOD_R_VERSION}/ HEAD | gzip >rapache-${MOD_R_VERSION}.tar.gz 8 | -------------------------------------------------------------------------------- /debian/libapache2-mod-r-base.postrm: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -e 4 | 5 | case "$1" in 6 | remove) 7 | : 8 | a2dismod mod_R 9 | ;; 10 | purge | disappear | upgrade | failed-upgrade | abort-upgrade) 11 | : 12 | ;; 13 | abort-install) 14 | : 15 | a2dismod mod_R 16 | ;; 17 | *) echo "$0: didn't understand being called with \`$1'" 1>&2 18 | exit 1;; 19 | esac 20 | 21 | #DEBHELPER# 22 | 23 | exit 0 24 | -------------------------------------------------------------------------------- /libapreq2/build/dox.foot: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/useR2007.R: -------------------------------------------------------------------------------- 1 | user2007example <- function(p1=.95,p2=.7){ 2 | x11(width=10,height=10) 3 | sc <- Weibull2(c(1,3),c(p1,p2)) 4 | rcens <- function(n) 1 + (5-1) * (runif(n) ^ .5) 5 | f <- Quantile2(sc, 6 | hratio=function(x) ifelse(x <= .75, 1, .75), 7 | dropin=function(x) ifelse(x <= .5, 0, .15 * (x-.5)/(5-.5)), 8 | dropout=function(x) .3*x/5 9 | ) 10 | par(mfrow=c(2,2)) 11 | plot(f,'all',label.curves=list(keys='lines')) 12 | } 13 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_lang.3: -------------------------------------------------------------------------------- 1 | .TH "Language Bindings" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | Language Bindings \- libapreq2 APIs for programming languages other than C 6 | 7 | .PP 8 | .SS "Modules" 9 | 10 | .in +1c 11 | .ti -1c 12 | .RI "\fBPerl\fP" 13 | .br 14 | .RI "\fIXS Modules. \fP" 15 | .PP 16 | 17 | .in -1c 18 | .SH "Detailed Description" 19 | .PP 20 | libapreq2 APIs for programming languages other than C 21 | .PP 22 | XXX 23 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/Request.pm: -------------------------------------------------------------------------------- 1 | use APR::Request::Error; 2 | 3 | sub import { 4 | my $class = shift; 5 | return unless @_; 6 | my $pkg = caller; 7 | no strict 'refs'; 8 | 9 | for (@_) { 10 | *{"$pkg\::$_"} = $class->can($_) 11 | or die "Can't find method $_ in class $class"; 12 | } 13 | } 14 | 15 | sub param_status { 16 | my $req = shift; 17 | return $req->args_status || $req->body_status if wantarray; 18 | return ($req->args_status, $req->body_status); 19 | } 20 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_module.3: -------------------------------------------------------------------------------- 1 | .TH "Modules" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | Modules \- apreq2 modules included in libapreq2-2.05-dev. 6 | 7 | .PP 8 | .SS "Modules" 9 | 10 | .in +1c 11 | .ti -1c 12 | .RI "\fBApache 2.X Filter Module\fP" 13 | .br 14 | .RI "\fImod_apreq2 - DSO that ties libapreq2 to \fBApache\fP HTTPD 2.X. \fP" 15 | .PP 16 | 17 | .in -1c 18 | .SH "Detailed Description" 19 | .PP 20 | apreq2 modules included in libapreq2-2.05-dev. 21 | .PP 22 | XXX 23 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/Apache2/Apache2.xs: -------------------------------------------------------------------------------- 1 | MODULE = APR::Request::Apache2 PACKAGE = APR::Request::Apache2 2 | 3 | BOOT: 4 | { 5 | apr_version_t version; 6 | apr_version(&version); 7 | if (version.major != APR_MAJOR_VERSION) 8 | Perl_croak(aTHX_ "Can't load module APR::Request::Apache2 : " 9 | "wrong libapr major version " 10 | "(expected %d, saw %d)", 11 | APR_MAJOR_VERSION, version.major); 12 | } 13 | -------------------------------------------------------------------------------- /test/brew/simple.rhtml: -------------------------------------------------------------------------------- 1 | <% 2 | setContentType("text/html") 3 | myname <- ifelse(is.null(GET$name),'World',GET$name) 4 | %> 5 | 6 | A Simple Example 7 | 8 |

Hello <%=myname%>!

9 | <% if (myname=='World'){ %> 10 |
What is your name? 11 | 12 | 13 |
14 | <% } else { %> 15 | Today is: <%=format(Sys.time())%>
16 | Click me! 17 | <% } %> 18 | 19 | -------------------------------------------------------------------------------- /libapreq2/build/dox.head: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $projectname-$projectnumber: $title 5 | 6 | 7 | 13 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_xs.3: -------------------------------------------------------------------------------- 1 | .TH "Perl" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | Perl \- XS Modules. 6 | 7 | .PP 8 | .SS "Modules" 9 | 10 | .in +1c 11 | .ti -1c 12 | .RI "\fBApache2::Request\fP" 13 | .br 14 | .ti -1c 15 | .RI "\fBApache2::Upload\fP" 16 | .br 17 | .ti -1c 18 | .RI "\fBApache2::Cookie\fP" 19 | .br 20 | .in -1c 21 | .SH "Detailed Description" 22 | .PP 23 | XS Modules. 24 | .PP 25 | 26 | .SH "SEE ALSO" 27 | .IX Header "SEE ALSO" 28 | \&\fIapreq_xs_request\fR\|(3), \fIapreq_xs_upload\fR\|(3), \fIapreq_xs_cookie\fR\|(3) 29 | 30 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/response/TestAPI/error.pm: -------------------------------------------------------------------------------- 1 | package TestAPI::error; 2 | 3 | use strict; 4 | use warnings FATAL => 'all'; 5 | 6 | use Apache::Test; 7 | use Apache::TestUtil; 8 | 9 | use APR::Request::Apache2; 10 | use APR::Request::Error qw/GENERAL TAINTED/; 11 | 12 | sub handler { 13 | my $r = shift; 14 | plan $r, tests => 3; 15 | 16 | my $req = APR::Request::Apache2->handle($r); 17 | ok $req->isa("APR::Request"); 18 | 19 | # XXX export some constants, and test apreq_xs_strerror 20 | ok TAINTED > GENERAL; 21 | ok GENERAL eq "Internal apreq error"; 22 | return 0; 23 | } 24 | 25 | 26 | 1; 27 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/REPORT: -------------------------------------------------------------------------------- 1 | #!/home/joe/perl/5.8.x/bin/perl 2 | # WARNING: this file is generated, do not edit 3 | # 01: /home/joe/perl/5.8.x/lib/site_perl/5.8.6/x86_64-linux-thread-multi/Apache/TestConfig.pm:923 4 | # 02: /home/joe/perl/5.8.x/lib/site_perl/5.8.6/x86_64-linux-thread-multi/Apache/TestConfig.pm:1013 5 | # 03: /home/joe/perl/5.8.x/lib/site_perl/5.8.6/x86_64-linux-thread-multi/Apache/TestReport.pm:44 6 | # 04: Makefile.PL:160 7 | 8 | BEGIN { eval { require blib && blib->import; } } 9 | 10 | use strict; 11 | use warnings FATAL => 'all'; 12 | 13 | use lib qw( 14 | ); 15 | 16 | 17 | use Apache::TestReportPerl; 18 | Apache::TestReportPerl->new(@ARGV)->run; -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/SMOKE: -------------------------------------------------------------------------------- 1 | #!/home/joe/perl/5.8.x/bin/perl 2 | # WARNING: this file is generated, do not edit 3 | # 01: /home/joe/perl/5.8.x/lib/site_perl/5.8.6/x86_64-linux-thread-multi/Apache/TestConfig.pm:923 4 | # 02: /home/joe/perl/5.8.x/lib/site_perl/5.8.6/x86_64-linux-thread-multi/Apache/TestConfig.pm:1013 5 | # 03: /home/joe/perl/5.8.x/lib/site_perl/5.8.6/x86_64-linux-thread-multi/Apache/TestSmoke.pm:778 6 | # 04: Makefile.PL:159 7 | 8 | BEGIN { eval { require blib && blib->import; } } 9 | 10 | use strict; 11 | use warnings FATAL => 'all'; 12 | 13 | use lib qw( 14 | ); 15 | 16 | 17 | use Apache::TestSmokePerl; 18 | Apache::TestSmokePerl->new(@ARGV)->run; -------------------------------------------------------------------------------- /libapreq2/library/t/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = @APR_INCLUDES@ 2 | AM_LDFLAGS = `@APREQ_CONFIG@ --link-libtool --libs` @APR_LTFLAGS@ 3 | noinst_LIBRARIES = libapache_test.a 4 | libapache_test_a_SOURCES = at.h at.c 5 | 6 | check_PROGRAMS = version cookie params parsers error util 7 | LDADD = libapache_test.a 8 | 9 | check_SCRIPTS = version.t cookie.t params.t parsers.t error.t util.t 10 | TESTS = $(check_SCRIPTS) 11 | TESTS_ENVIRONMENT = @PERL@ -MTest::Harness -e 'runtests(@ARGV)' 12 | CLEANFILES = $(check_PROGRAMS) $(check_SCRIPTS) 13 | 14 | %.t: % 15 | echo "#!perl" > $@ 16 | echo "exec './$*'" >> $@ 17 | 18 | test: $(check_SCRIPTS) 19 | $(TESTS_ENVIRONMENT) $(check_SCRIPTS) 20 | -------------------------------------------------------------------------------- /test/read.r: -------------------------------------------------------------------------------- 1 | if (is.null(FILES)) rnorm(10) 2 | tmpfile <- NULL 3 | if(!is.null(SERVER) && ("method" %in% names(SERVER)) && (SERVER$method == "POST") ){ 4 | tmpfile <- tempfile() 5 | con <- file(tmpfile,open="w") 6 | writeLines(readLines(),con); 7 | close(con); 8 | } 9 | setContentType("text/html") 10 | cat("") 11 | cat('

Using R To Read Input

\n') 12 | if (!is.null(tmpfile)) cat('

We read to this file:',tmpfile,'

\n') 13 | cat('
\n') 14 | cat('Upload a file:
\n') 15 | cat('') 16 | cat("
") 17 | -2 18 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/apreq/inherit.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings FATAL => 'all'; 3 | 4 | use Apache::Test; 5 | 6 | use Apache::TestUtil; 7 | use Apache::TestRequest qw(GET_BODY UPLOAD_BODY); 8 | 9 | plan tests => 4, have_lwp; 10 | my $location = "/TestApReq__inherit"; 11 | my @response = split/\r?\n/, GET_BODY($location, Cookie=>"apache=2"); 12 | ok t_cmp($response[0], "method => GET", "inherit method"); 13 | ok t_cmp($response[1], "cookie => apache=2", "inherit cookie"); 14 | ok t_cmp($response[2], "DESTROYING TestApReq::inherit object", 15 | "first object cleanup"); 16 | ok t_cmp($response[3], "DESTROYING TestApReq::inherit object", 17 | "second object cleanup"); 18 | -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 |

RApache Test page

2 | Click on the following to test things out. 3 | 14 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/response/TestApReq/big_input.pm: -------------------------------------------------------------------------------- 1 | package TestApReq::big_input; 2 | 3 | use strict; 4 | use warnings FATAL => 'all'; 5 | use Apache2::Request (); 6 | use Apache2::RequestIO; 7 | use Apache2::RequestRec; 8 | 9 | sub handler { 10 | my $r = shift; 11 | my $req = Apache2::Request->new($r); 12 | my $len = 0; 13 | 14 | for ($req->param) { 15 | my $val = $req->param($_) || ''; 16 | $len += length($_) + length($val) + 2; # +2 ('=' and '&') 17 | } 18 | $len--; # the stick with two ends one '&' char off 19 | 20 | $req->content_type('text/plain'); 21 | $req->print($len); 22 | 23 | return 0; 24 | } 25 | 26 | 1; 27 | 28 | __END__ 29 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/CGI/CGI.xs: -------------------------------------------------------------------------------- 1 | static apr_pool_t *apreq_xs_cgi_global_pool; 2 | 3 | MODULE = APR::Request::CGI PACKAGE = APR::Request::CGI 4 | 5 | BOOT: 6 | { 7 | apr_version_t version; 8 | apr_version(&version); 9 | if (version.major != APR_MAJOR_VERSION) 10 | Perl_croak(aTHX_ "Can't load module APR::Request::CGI : " 11 | "wrong libapr major version " 12 | "(expected %d, saw %d)", 13 | APR_MAJOR_VERSION, version.major); 14 | } 15 | apr_pool_create(&apreq_xs_cgi_global_pool, NULL); 16 | apreq_initialize(apreq_xs_cgi_global_pool); 17 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.pm: -------------------------------------------------------------------------------- 1 | use APR::Request; 2 | 3 | sub new { 4 | my ($class, $pool, %attrs) = @_; 5 | my $name = delete $attrs{name}; 6 | my $value = delete $attrs{value}; 7 | $name = delete $attrs{-name} unless defined $name; 8 | $value = delete $attrs{-value} unless defined $value; 9 | return unless defined $name and defined $value; 10 | 11 | my $cookie = $class->make($pool, $name, $class->freeze($value)); 12 | while(my ($k, $v) = each %attrs) { 13 | $k =~ s/^-//; 14 | $cookie->$k($v); 15 | } 16 | return $cookie; 17 | } 18 | 19 | sub freeze { return $_[1] } 20 | sub thaw { return shift->value } 21 | -------------------------------------------------------------------------------- /test/useR2007.js: -------------------------------------------------------------------------------- 1 | function RePlot(){ 2 | var p1 = document.spower.p1.value; 3 | var p2 = document.spower.p2.value; 4 | var mo = document.spower.mo.value; 5 | 6 | new Ajax.Updater( 'plot', '/brew/useR2007plot.rhtml', 7 | { 8 | 'method': 'get', 9 | 'parameters': {'p1': p1, 'p2': p2, 'mo': mo}, 10 | } 11 | ); 12 | } 13 | function ReSimulate(){ 14 | var p1 = document.spower.p1.value; 15 | var p2 = document.spower.p2.value; 16 | var mo = document.spower.mo.value; 17 | 18 | Element.show('spinner'); 19 | new Ajax.Updater( 'spowerResult', '/brew/useR2007sim.rhtml', 20 | { 21 | 'method': 'get', 22 | 'parameters': {'p1': p1, 'p2': p2, 'mo': mo}, 23 | 'onSuccess': function(r){Element.hide('spinner')} 24 | } 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /test/helloworld.r: -------------------------------------------------------------------------------- 1 | setContentType("text/html") 2 | setHeader("foo","bar") 3 | setCookie("foo","bar",Sys.time()+1000) 4 | cat("

Hello World!

") 5 | cat("
")
 6 | print(warnings())
 7 | cat("search:\n")
 8 | print(search())
 9 | 
10 | cat("\n.GlobalEnv:\n")
11 | print(ls(globalenv()))
12 | 
13 | assign("gfoo","gbar",.GlobalEnv)
14 | if (exists("foo")){
15 | 	foo <- foo + 1
16 | } else {
17 | 	foo <- 1
18 | }
19 | cat("foo is",foo,"\n
"); 20 | 21 | cat("\nls():\n") 22 | print(ls()) 23 | 24 | if (!is.null(GET)){ 25 | for (i in 1:length(GET) ){ 26 | cat("\t",names(GET)[i],":",GET[[i]],"\n") 27 | # cat("\t",GET[[i]],"\n") 28 | } 29 | } else { 30 | cat("\nGET is NULL.\n") 31 | } 32 | 33 | cat("
") 34 | cat("") 35 | DONE 36 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/CGI/CGI.pm: -------------------------------------------------------------------------------- 1 | require APR::Request; 2 | use APR::Pool; 3 | push @ISA, "APR::Request"; 4 | 5 | sub upload { 6 | my $req = shift; 7 | my $body = $req->body; 8 | $body->param_class("APR::Request::CGI::Upload"); 9 | if (@_) { 10 | return grep {$_->upload} $body->get(shift) if wantarray; 11 | for ($body->get(shift)) { 12 | return $_ if $_->upload; 13 | } 14 | } 15 | return map {$_->upload ? $_->name : () } values %$body; 16 | } 17 | 18 | 19 | package APR::Request::CGI::Upload; 20 | use APR::Request::Param; 21 | push our @ISA, "APR::Request::Param"; 22 | 23 | sub type {} 24 | sub filename {} 25 | sub link {} 26 | sub fh {} 27 | sub tempname {} 28 | sub io {} 29 | sub slurp {} 30 | -------------------------------------------------------------------------------- /libapreq2/glue/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = perl 2 | 3 | dist-hook: 4 | 5 | perl_config: 6 | cd perl; @PERL@ ../../build/xsbuilder.pl run 7 | 8 | perl/Makefile: perl/xsbuilder perl/Makefile.PL 9 | cd perl; @PERL@ Makefile.PL -apxs @APACHE2_APXS@ @PERL_OPTS@ 10 | 11 | perl_glue: perl/Makefile 12 | cd perl; $(MAKE) 13 | 14 | perl_test: perl/Makefile 15 | cd perl; $(MAKE) test 16 | 17 | perl_install: 18 | cd perl; $(MAKE) install 19 | 20 | perl_clean: 21 | -cd perl; $(MAKE) clean 22 | 23 | if BUILD_PERL_GLUE 24 | 25 | all-local: perl_glue 26 | 27 | install-exec-local: perl_install 28 | 29 | clean-local: perl_clean 30 | 31 | test: perl_test 32 | 33 | else 34 | 35 | all-local: 36 | 37 | install-exec-local: 38 | 39 | clean-local: 40 | 41 | test: 42 | 43 | endif 44 | -------------------------------------------------------------------------------- /test/brew/useR2007sim.rhtml: -------------------------------------------------------------------------------- 1 | <% 2 | p1 <- ifelse(is.null(GET$p1),.95,as.numeric(GET$p1)) 3 | p2 <- ifelse(is.null(GET$p2),.7,as.numeric(GET$p2)) 4 | mo <- ifelse(is.null(GET$mo),9,as.numeric(GET$mo)) 5 | options(hverbose=FALSE,verbose=FALSE) 6 | library(Hmisc) 7 | sink('/dev/null') 8 | sc <- Weibull2(c(1,3),c(p1,p2)) 9 | f <- Quantile2(sc, 10 | hratio=function(x) ifelse(x <= mo/12, 1, .75), 11 | dropin=function(x) ifelse(x <= .5, 0, .15 * (x-.5)/(5-.5)), 12 | dropout=function(x) .3*x/5 13 | ) 14 | rcens <- function(n) 1 + (5-1) * (runif(n) ^ .5) 15 | rcontrol <- function(n) f(n,'control') 16 | rinterv <- function(n) f(n,'intervention') 17 | set.seed(211) 18 | x <- spower(rcontrol,rinterv,rcens, nc=350, ni=350, test=logrank, nsim=300) 19 | sink() 20 | %> 21 | <%=format(x,digits=5)%> 22 | -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # Generated from ltversion.in. 11 | 12 | # serial 3017 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.2.6b]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3017]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.2.6b' 20 | macro_revision='1.3017' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /test/rshell.R: -------------------------------------------------------------------------------- 1 | setContentType('text/html') 2 | cat('

R Shell for RApache

\n') 9 | cat('
\n') 10 | cat('
') 11 | if (!is.null(POST$code)){ 12 | cat("
\n")
13 |     print(try(eval(parse(text=POST$code))))
14 |     cat("
\n") 15 | } 16 | -------------------------------------------------------------------------------- /test/recBinLarge.r: -------------------------------------------------------------------------------- 1 | # Output starts here 2 | setContentType("text/html") 3 | 4 | cat('

receiveBin() test for RApache

\n') 11 | cat('\n',sep='') 12 | cat('Upload a file:
\n') 13 | cat('') 14 | 15 | x <- receiveBin() 16 | 17 | cat('
length=',length(x),' bytes') 18 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/response/TestApReq/inherit.pm: -------------------------------------------------------------------------------- 1 | package TestApReq::inherit; 2 | use Apache2::Cookie; 3 | use base qw/Apache2::Request Apache2::Cookie::Jar/; 4 | use strict; 5 | use warnings FATAL => 'all'; 6 | use APR; 7 | use Apache2::RequestRec; 8 | use Apache2::RequestIO; 9 | 10 | sub handler { 11 | my $r = shift; 12 | $r = __PACKAGE__->new($r); # tickles refcnt bug in apreq-1 13 | die "Wrong package: ", ref $r unless $r->isa('TestApReq::inherit'); 14 | $r->content_type('text/plain'); 15 | # look for segfault when $r->isa("Apache2::Request") 16 | 17 | my $req = bless { r => $r }; 18 | $req->printf("method => %s\n", $req->method); 19 | $req->printf("cookie => %s\n", $req->cookies->{"apache"}->as_string); 20 | return 0; 21 | } 22 | 23 | sub DESTROY { $_[0]->print("DESTROYING ", __PACKAGE__, " object\n") } 24 | 25 | 1; 26 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/todo.3: -------------------------------------------------------------------------------- 1 | .TH "todo" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | todo \- Todo List 6 | 7 | .IP "\fBGlobal \fBAPREQ_COOKIE_MAX_LENGTH\fP \fP" 1c 8 | convert this macro to an \fBapreq_module_t\fP method. 9 | .PP 10 | .PP 11 | 12 | .IP "\fBGlobal \fBapreq_atoi64f\fP(const char *s) \fP" 1c 13 | What happens when s is malformed? Should this return an unsigned value instead? 14 | .PP 15 | .PP 16 | 17 | .IP "\fBGlobal \fBapreq_atoi64t\fP(const char *s) \fP" 1c 18 | What happens when s is malformed? Should this return an unsigned value instead? 19 | .PP 20 | .PP 21 | 22 | .IP "\fBGlobal \fBapreq_brigade_concat\fP(apr_pool_t *pool, const char *temp_dir, apr_size_t brigade_limit, \fBapr_bucket_brigade\fP *out, \fBapr_bucket_brigade\fP *in) \fP" 1c 23 | Flesh out these error codes, making them as explicit as possible. 24 | .PP 25 | 26 | -------------------------------------------------------------------------------- /test/brew/useR2007ajax.rhtml: -------------------------------------------------------------------------------- 1 | <% 2 | p1 <- ifelse(is.null(GET$p1),.95,as.numeric(GET$p1)) 3 | p2 <- ifelse(is.null(GET$p2),.7,as.numeric(GET$p2)) 4 | options(hverbose=FALSE,verbose=FALSE) 5 | library(Hmisc) 6 | library(Cairo) 7 | PLOTDIR='test/images' 8 | plotname <- paste('plot.',sprintf('%.4f.%.4f',p1,p2),'.png',sep='') 9 | filename <- file.path(PLOTDIR,plotname) 10 | if (!file.exists(filename)){ 11 | CairoPNG(filename=filename,width=600,height=600) 12 | sink('/dev/null') 13 | sc <- Weibull2(c(1,3),c(p1,p2)) 14 | rcens <- function(n) 1 + (5-1) * (runif(n) ^ .5) 15 | f <- Quantile2(sc, 16 | hratio=function(x) ifelse(x <= .75, 1, .75), 17 | dropin=function(x) ifelse(x <= .5, 0, .15 * (x-.5)/(5-.5)), 18 | dropout=function(x) .3*x/5 19 | ) 20 | par(mfrow=c(2,2)) 21 | plot(f,'all',label.curves=list(keys='lines')) 22 | dev.off() 23 | sink() 24 | } 25 | %> 26 | 27 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/maps/apreq_structures.map: -------------------------------------------------------------------------------- 1 | ########## APREQ structures ########## 2 | 3 | # 4 | # name 5 | # status 6 | # size 7 | # data[1] 8 | # 9 | 10 | 11 | info 12 | upload 13 | ! v 14 | 15 | 16 | 17 | ! module 18 | 19 | 20 | 21 | path 22 | domain 23 | port 24 | comment 25 | commentURL 26 | ! max_age 27 | ! flags 28 | ! v 29 | 30 | 31 | 32 | ! hook 33 | ! next 34 | ! ctx 35 | 36 | 37 | 38 | ! parser 39 | ! content_type 40 | ! hook 41 | > ctx 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /libapreq2/library/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = t 2 | AM_CPPFLAGS = @APR_INCLUDES@ 3 | BUILT_SOURCES = @APR_LA@ @APU_LA@ 4 | lib_LTLIBRARIES = libapreq2.la 5 | libapreq2_la_SOURCES = util.c version.c cookie.c param.c parser.c \ 6 | parser_urlencoded.c parser_header.c parser_multipart.c \ 7 | module.c module_custom.c module_cgi.c error.c 8 | libapreq2_la_LDFLAGS = -version-info @APREQ_LIBTOOL_VERSION@ @APR_LTFLAGS@ @APR_LIBS@ 9 | 10 | test: all 11 | cd t; $(MAKE) test 12 | 13 | if ENABLE_PROFILE 14 | 15 | AM_CFLAGS= -pg -fprofile-arcs -ftest-coverage 16 | 17 | clean-local: 18 | -rm *.bb *.bbg *.da *.gcov 19 | 20 | else 21 | 22 | clean-local: 23 | 24 | endif 25 | 26 | 27 | 28 | if BUILD_APR 29 | 30 | @APR_LA@: 31 | cd `@APR_CONFIG@ --srcdir` && $(MAKE) 32 | 33 | endif 34 | 35 | if BUILD_APU 36 | 37 | @APU_LA@: @APR_LA@ 38 | cd `@APU_CONFIG@ --srcdir` && $(MAKE) 39 | 40 | endif 41 | -------------------------------------------------------------------------------- /test/brew/useR2007plot.rhtml: -------------------------------------------------------------------------------- 1 | <% 2 | p1 <- ifelse(is.null(GET$p1),.95,as.numeric(GET$p1)) 3 | p2 <- ifelse(is.null(GET$p2),.7,as.numeric(GET$p2)) 4 | mo <- ifelse(is.null(GET$mo),9,as.numeric(GET$mo)) 5 | options(hverbose=FALSE,verbose=FALSE) 6 | library(Hmisc) 7 | PLOTDIR='test/images' 8 | plotname <- paste('plot.',sprintf('%.4f.%.4f.%d',p1,p2,mo),'.png',sep='') 9 | filename <- file.path(PLOTDIR,plotname) 10 | if (!file.exists(filename)){ 11 | png(type='cairo',filename=filename,width=600,height=600) 12 | sink('/dev/null') 13 | sc <- Weibull2(c(1,3),c(p1,p2)) 14 | rcens <- function(n) 1 + (5-1) * (runif(n) ^ .5) 15 | f <- Quantile2(sc, 16 | hratio=function(x) ifelse(x <= mo/12, 1, .75), 17 | dropin=function(x) ifelse(x <= .5, 0, .15 * (x-.5)/(5-.5)), 18 | dropout=function(x) .3*x/5 19 | ) 20 | par(mfrow=c(2,2)) 21 | plot(f,'all',label.curves=list(keys='lines')) 22 | dev.off() 23 | sink() 24 | } 25 | %> 26 | 27 | -------------------------------------------------------------------------------- /libapreq2/win32/util.pl: -------------------------------------------------------------------------------- 1 | sub usage { 2 | my $script = shift; 3 | print <<"END"; 4 | 5 | Usage: perl $script [--with-apache2=C:\Path\to\Apache2] 6 | perl $script --help 7 | 8 | Options: 9 | 10 | --with-apache2=C:\Path\to\Apache2 : specify the top-level Apache2 directory 11 | --help : print this help message 12 | 13 | With no options specified, an attempt will be made to find a suitable 14 | Apache2 directory. 15 | 16 | END 17 | exit; 18 | } 19 | 20 | sub check { 21 | my $apache = shift; 22 | die qq{No libhttpd library found under $apache/lib} 23 | unless -e qq{$apache/lib/libhttpd.lib}; 24 | die qq{No httpd header found under $apache/include} 25 | unless -e qq{$apache/include/httpd.h}; 26 | my $vers = qx{"$apache/bin/Apache.exe" -v}; 27 | die qq{"$apache" does not appear to be version 2.0} 28 | unless $vers =~ m!Apache/2.0!; 29 | return 1; 30 | } 31 | 32 | 1; 33 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/response/TestAPI/module.pm: -------------------------------------------------------------------------------- 1 | package TestAPI::module; 2 | 3 | use strict; 4 | use warnings FATAL => 'all'; 5 | 6 | use Apache::Test; 7 | use Apache::TestUtil; 8 | 9 | use APR::Request::Apache2; 10 | 11 | sub handler { 12 | my $r = shift; 13 | plan $r, tests => 9; 14 | 15 | my $req = APR::Request::Apache2->handle($r); 16 | ok $req->isa("APR::Request::Apache2"); 17 | 18 | ok t_cmp $req->brigade_limit, 256 * 1024, "default brigade limit is 256K"; 19 | ok $req->brigade_limit(1024); 20 | ok t_cmp $req->brigade_limit, 1024, "brigade_limit reset to 1K"; 21 | 22 | ok $req->read_limit(1024 * 1024); 23 | ok t_cmp $req->read_limit, 1024 * 1024, "read_limit reset to 1M"; 24 | 25 | ok not defined $req->temp_dir; 26 | ok $req->temp_dir("/tmp"); 27 | ok t_cmp $req->temp_dir, "/tmp", "temp dir reset to /tmp"; 28 | 29 | # XXX parse, header_in & header_out tests 30 | 31 | return 0; 32 | } 33 | 34 | 35 | 1; 36 | -------------------------------------------------------------------------------- /libapreq2/META.yml: -------------------------------------------------------------------------------- 1 | --- #YAML:1.0 (see http://module-build.sourceforge.net/META-spec.html) 2 | name: libapreq2 3 | version: 2.05-dev 4 | license: open_source 5 | installdirs: site 6 | distribution_type: module 7 | dynamic_config: 1 8 | provides: 9 | Apache2::Request: 10 | version: 2.05-dev 11 | Apache2::Cookie: 12 | version: 2.05-dev 13 | Apache2::Upload: 14 | version: 2.05-dev 15 | APR::Request: 16 | version: 2.05-dev 17 | APR::Request::Apache2: 18 | version: 2.05-dev 19 | APR::Request::CGI: 20 | version: 2.05-dev 21 | APR::Request::Error: 22 | version: 2.05-dev 23 | APR::Request::Cookie: 24 | version: 2.05-dev 25 | APR::Request::Param: 26 | version: 2.05-dev 27 | generated_by: build/version_check.pl 28 | requires: 29 | mod_perl: 1.999022 30 | perl: 5.6.1 31 | build_requires: 32 | Apache::Test: 1.04 33 | ExtUtils::MakeMaker: 6.15 34 | ExtUtils::XSBuilder: 0.23 35 | Test::More: 0.47 36 | mod_perl: 1.999022 37 | perl: 5.6.1 38 | -------------------------------------------------------------------------------- /libapreq2/module/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = @APR_INCLUDES@ 2 | SUBDIRS = apache2 3 | TEST_CONFIG_SCRIPT = package Apache::TestMM; filter_args(); generate_script("t/TEST") 4 | EXTRA_DIST = t apache 5 | 6 | noinst_PROGRAMS = test_cgi 7 | test_cgi_LDFLAGS = `@APREQ_CONFIG@ --link-libtool --libs` @APR_LTFLAGS@ 8 | 9 | run_tests : t/TEST 10 | -cp -f test_cgi t/cgi-bin 11 | -cp -Rp .libs t 12 | MAKE=$(MAKE) @PERL@ t/TEST 13 | 14 | t/TEST : Makefile.am t/TEST.PL 15 | @PERL@ -MApache::TestMM -e '$(TEST_CONFIG_SCRIPT)' -- -apxs @APACHE2_APXS@ 16 | 17 | test :: all check run_tests 18 | 19 | test_clean : cmodules_clean 20 | -MAKE=$(MAKE) @PERL@ t/TEST -clean 21 | -rm -rf t/htdocs t/logs t/modules t/TEST t/core t/core.* t/cgi-bin/test_cgi t/cgi-bin/.libs t/.libs t/conf/extra.conf t/conf/ssl/ca t/conf/ssl/httpd-passphrase.pl 22 | 23 | cmodules_clean: 24 | -cd c-modules && $(MAKE) clean 25 | -rm c-modules/Makefile c-modules/*/Makefile c-modules/apache_httpd_test.h 26 | 27 | clean-local: test_clean 28 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: libapache2-mod-r-base 2 | Section: web 3 | Priority: optional 4 | Maintainer: Jeffrey Horner 5 | Build-Depends: debhelper (>= 4.2.20), lsb-release, apache2-dev, libapreq2-dev, r-base-core, r-base-dev 6 | Standards-Version: 3.7.2 7 | 8 | Package: libapache2-mod-r-base 9 | Architecture: any 10 | Depends: apache2 | apache2.2-common, libapreq2-3 | libapreq2, r-base-core, ${shlibs:Depends} 11 | Description: Apache module for running server-side R programs 12 | This package provides the R module for the Apache 2 webserver. Note 13 | that it will work with either Apache's prefork or worker MPM. Prefork 14 | is preferred. 15 | . 16 | R is a language and environment for statistical computing and graphics. 17 | By embedding R inside Apache, developers can create dynamic web pages and 18 | graphics. Even more compelling is the ability for developers to provide 19 | web service style access to novel, cutting edge statistical techniques. 20 | . 21 | Homepage: http://www.rapache.net/ 22 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/Param/Param.pm: -------------------------------------------------------------------------------- 1 | use APR::Request; 2 | use APR::Table; 3 | use APR::Brigade; 4 | 5 | sub upload_io { 6 | tie local (*FH), "APR::Request::Brigade", shift->upload; 7 | return bless *FH{IO}, "APR::Request::Brigade::IO"; 8 | } 9 | 10 | sub upload_fh { 11 | my $fname = shift->upload_tempname(@_); 12 | open my $fh, "<", $fname 13 | or die "Can't open ", $fname, ": ", $!; 14 | binmode $fh; 15 | return $fh; 16 | } 17 | 18 | sub APR::Request::upload { 19 | my $req = shift; 20 | my $body = $req->body or return; 21 | $body->param_class(__PACKAGE__); 22 | if (@_) { 23 | my @uploads = grep $_->upload, $body->get(@_); 24 | return wantarray ? @uploads : $uploads[0]; 25 | } 26 | 27 | return map { $_->upload ? $_->name : () } values %$body 28 | if wantarray; 29 | 30 | return $body->uploads($req->pool); 31 | 32 | } 33 | 34 | package APR::Request::Brigade; 35 | push our(@ISA), "APR::Brigade"; 36 | 37 | package APR::Request::Brigade::IO; 38 | push our(@ISA), (); 39 | -------------------------------------------------------------------------------- /test/brew/dynlex.rhtml: -------------------------------------------------------------------------------- 1 | <% listEnclosures <- function(){ 2 | empty <- environmentName(emptyenv()) 3 | e <- parent.env(parent.frame(1)); 4 | n <- environmentName(e); 5 | i <- 1 6 | while (n != empty){ 7 | if (n == '') n <- attributes(e)$name[1] 8 | cat('ENV:',i,n,'------------------------------\n'); 9 | vars <- ls(envir=e) 10 | if (length(vars) > 10) 11 | cat('\t',vars[1:10],'....\n') 12 | else 13 | cat('\t',vars,'\n') 14 | e <- parent.env(e) 15 | n <- environmentName(e) 16 | i <- i + 1 17 | } 18 | } 19 | 20 | listFrames <- function(){ 21 | f <- sys.frames(); 22 | len <- length(f) - 1 ; 23 | if (len < 1) return(invisible()); 24 | cat("in listFrames\n") 25 | for ( i in len:1 ){ 26 | cat('FRAME:',len-i,'----------------\n') 27 | vars <- ls(envir=f[[i]]) 28 | if (length(vars) > 10) 29 | cat('\t',vars[1:10],'....\n') 30 | else 31 | cat('\t',vars,'\n') 32 | } 33 | } -%> 34 | 35 | 36 |

Call Stack

37 |
38 | <% listFrames() %>
39 | 
40 |

Enclosures

41 |
42 | <% listEnclosures() %>
43 | 
44 | 45 | 46 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_value_t.3: -------------------------------------------------------------------------------- 1 | .TH "apreq_value_t" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | apreq_value_t \- libapreq's pre-extensible string type 6 | 7 | .PP 8 | .SH SYNOPSIS 9 | .br 10 | .PP 11 | \fC#include \fP 12 | .PP 13 | .SS "Data Fields" 14 | 15 | .in +1c 16 | .ti -1c 17 | .RI "char * \fBname\fP" 18 | .br 19 | .ti -1c 20 | .RI "\fBapr_size_t\fP \fBnlen\fP" 21 | .br 22 | .ti -1c 23 | .RI "\fBapr_size_t\fP \fBdlen\fP" 24 | .br 25 | .ti -1c 26 | .RI "char \fBdata\fP [1]" 27 | .br 28 | .in -1c 29 | .SH "Detailed Description" 30 | .PP 31 | libapreq's pre-extensible string type 32 | .PP 33 | .SH "Field Documentation" 34 | .PP 35 | .SS "char \fBapreq_value_t::data\fP[1]" 36 | .PP 37 | value data 38 | .SS "\fBapr_size_t\fP \fBapreq_value_t::dlen\fP" 39 | .PP 40 | length of data 41 | .SS "char* \fBapreq_value_t::name\fP" 42 | .PP 43 | value name 44 | .SS "\fBapr_size_t\fP \fBapreq_value_t::nlen\fP" 45 | .PP 46 | length of name 47 | 48 | .SH "Author" 49 | .PP 50 | Generated automatically by Doxygen for libapreq2 from the source code. 51 | -------------------------------------------------------------------------------- /libapreq2/PREREQUISITES: -------------------------------------------------------------------------------- 1 | ================================================== 2 | Build system (core C API) prerequisites 3 | 4 | apache2: 2.0.48 5 | apr: 0.9.4 (bundled with apache2 2.0.48) 6 | apu: 0.9.4 (bundled with apache2 2.0.48) 7 | perl: 5.6.1 8 | 9 | ================================================== 10 | Perl glue (Apache::Request) prerequisites 11 | 12 | Apache::Test: 1.04 (Win32 requires version 1.06) 13 | ExtUtils::MakeMaker: 6.15 14 | ExtUtils::XSBuilder: 0.23 15 | Test::More: 0.47 16 | mod_perl: 1.999022 17 | perl: 5.6.1 18 | 19 | ================================================== 20 | Additional prerequisites for apreq subversion builds 21 | 22 | ExtUtils::XSBuilder: 0.23 23 | autoconf: 2.53 24 | automake: 1.6.0 25 | doxygen: 1.2 26 | libtool: 1.4.3 27 | perl: 5.6.1 28 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | # Uncomment this to turn on verbose mode. 4 | export DH_VERBOSE=1 5 | 6 | PACKAGE=$(shell dh_listpackages) 7 | 8 | build: 9 | dh_testdir 10 | ./configure --with-R=/usr/bin/R --with-apache2-apxs=/usr/bin/apxs2 --with-apreq2-config=/usr/bin/apreq2-config 11 | if test -f /usr/bin/lsb_release -a `/usr/bin/lsb_release -cs` = "lucid"; then \ 12 | cp /usr/lib/libapreq2.la libapreq2.la~; \ 13 | sed -e "s/\/usr\/lib\/libuuid.la/-luuid/g;s/libdir='\/lib/libdir='\/usr\/lib/g" < libapreq2.la~ > libapreq2.la; \ 14 | fi; 15 | $(MAKE) 16 | 17 | clean: 18 | dh_testdir 19 | dh_testroot 20 | if [ -f Makefile ]; then $(MAKE) distclean; fi; 21 | dh_clean 22 | 23 | binary: binary-arch binary-indep 24 | 25 | binary-indep: 26 | 27 | binary-arch: build 28 | dh_testdir 29 | dh_testroot 30 | dh_clean -k 31 | dh_installdirs 32 | dh_install 33 | dh_installdocs 34 | dh_installchangelogs 35 | dh_link 36 | dh_strip 37 | dh_compress 38 | dh_fixperms 39 | dh_installdeb 40 | #dh_shlibdeps 41 | dh_gencontrol 42 | dh_md5sums 43 | dh_builddeb 44 | #dh_clean 45 | dh_prep 46 | 47 | .PHONY: build clean binary binary-arch binary-indep 48 | -------------------------------------------------------------------------------- /test/dynlex2.r: -------------------------------------------------------------------------------- 1 | setContentType("text/html") 2 | listEnclosures <- function(env=NULL){ 3 | empty <- environmentName(emptyenv()) 4 | if (!is.null(env)) e <- env 5 | else e <- parent.frame(); 6 | n <- environmentName(e); 7 | i <- 0 8 | while (n != empty){ 9 | if (n == '') n <- attributes(e)$name[1] 10 | cat('ENV:',i,n,'------------------------------\n'); 11 | vars <- ls(envir=e) 12 | if (length(vars) > 10) 13 | cat('\t',vars[1:10],'....\n') 14 | else 15 | cat('\t',vars,'\n') 16 | 17 | e <- parent.env(e) 18 | n <- environmentName(e) 19 | i <- i + 1 20 | } 21 | } 22 | 23 | listFrames <- function(){ 24 | f <- sys.frames(); 25 | len <- length(f) - 1 ; 26 | if (len < 1) return(invisible()); 27 | cat("in listFrames\n") 28 | for ( i in len:1 ){ 29 | cat('FRAME:',len-i,'----------------\n') 30 | vars <- ls(envir=f[[i]]) 31 | if (length(vars) > 10) 32 | cat('\t',vars[1:10],'....\n') 33 | else 34 | cat('\t',vars,'\n') 35 | } 36 | } 37 | cat("

Call Stack

")
38 | listFrames()
39 | cat("

Enclosures

")
40 | listEnclosures()
41 | cat("
") 42 | cat("did we change it?",DONE,"
") 43 | cat("returning",OK," ") 44 | OK 45 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_param_t.3: -------------------------------------------------------------------------------- 1 | .TH "apreq_param_t" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | apreq_param_t \- 6 | .SH SYNOPSIS 7 | .br 8 | .PP 9 | \fC#include \fP 10 | .PP 11 | .SS "Data Fields" 12 | 13 | .in +1c 14 | .ti -1c 15 | .RI "\fBapr_table_t\fP * \fBinfo\fP" 16 | .br 17 | .ti -1c 18 | .RI "\fBapr_bucket_brigade\fP * \fBupload\fP" 19 | .br 20 | .ti -1c 21 | .RI "unsigned \fBflags\fP" 22 | .br 23 | .ti -1c 24 | .RI "const \fBapreq_value_t\fP \fBv\fP" 25 | .br 26 | .in -1c 27 | .SH "Detailed Description" 28 | .PP 29 | Common data structure for params and file uploads 30 | .PP 31 | .SH "Field Documentation" 32 | .PP 33 | .SS "unsigned \fBapreq_param_t::flags\fP" 34 | .PP 35 | charsets, taint marks, app-specific bits 36 | .SS "\fBapr_table_t\fP* \fBapreq_param_t::info\fP" 37 | .PP 38 | header table associated with the param 39 | .SS "\fBapr_bucket_brigade\fP* \fBapreq_param_t::upload\fP" 40 | .PP 41 | brigade used to spool upload files 42 | .SS "const \fBapreq_value_t\fP \fBapreq_param_t::v\fP" 43 | .PP 44 | underlying name/value info 45 | 46 | .SH "Author" 47 | .PP 48 | Generated automatically by Doxygen for libapreq2 from the source code. 49 | -------------------------------------------------------------------------------- /libapreq2/library/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright 2003-2005 The Apache Software Foundation 3 | ** 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); 5 | ** you may not use this file except in compliance with the License. 6 | ** You may obtain a copy of the License at 7 | ** 8 | ** http://www.apache.org/licenses/LICENSE-2.0 9 | ** 10 | ** Unless required by applicable law or agreed to in writing, software 11 | ** distributed under the License is distributed on an "AS IS" BASIS, 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ** See the License for the specific language governing permissions and 14 | ** limitations under the License. 15 | */ 16 | 17 | #include "apreq_version.h" 18 | #include "apr_general.h" /* for APR_STRINGIFY */ 19 | 20 | APREQ_DECLARE(void) apreq_version(apr_version_t *pvsn) 21 | { 22 | pvsn->major = APREQ_MAJOR_VERSION; 23 | pvsn->minor = APREQ_MINOR_VERSION; 24 | pvsn->patch = APREQ_PATCH_VERSION; 25 | #ifdef APREQ_IS_DEV_VERSION 26 | pvsn->is_dev = 1; 27 | #else 28 | pvsn->is_dev = 0; 29 | #endif 30 | } 31 | 32 | APREQ_DECLARE(const char *) apreq_version_string(void) 33 | { 34 | return APREQ_VERSION_STRING; 35 | } 36 | -------------------------------------------------------------------------------- /libapreq2/FAQ.pod: -------------------------------------------------------------------------------- 1 | =head1 Issues during installation. 2 | 3 | [...] 4 | 5 | 6 | =head1 Using libapreq2 with Apache 2 and mod_perl 2. 7 | 8 | 9 | =head2 When I use Apache::Request in my output filter, it seems to lose the incoming POST variables. 10 | 11 | The problem is likely that the mod_apreq filter has not been 12 | added to the input filter chain in time to read the POST data. 13 | 14 | There are two solutions to this problem: 15 | 16 | 17 | 1) Write a filter init handler for you filter that instantiates an Apache::Request object. 18 | 19 | http://perl.apache.org/docs/2.0/api/Apache/Filter.html#C_FilterInitHandler_ 20 | 21 | 2) Use .htaccess or your server config to ensure the apreq input filter 22 | is active for this request with "AddInputFilter APREQ" or somesuch. 23 | 24 | We recommend using (1), and falling back to (2) until you get (1) working. 25 | 26 | =head2 When I try to upload a file, why do I get this error "[error] Can't locate .../Apache/Request/upload.al in @INC"? 27 | 28 | I is now a separate module in apreq2, so you need to 29 | C to load the C function. 30 | 31 | 32 | =head1 Using libapreq2 outside of Apache. 33 | 34 | [...] 35 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/_home_joe_src_apache_httpd_apreq_trunk_include_.3: -------------------------------------------------------------------------------- 1 | .TH "include/ Directory Reference" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | include/ Directory Reference \- 6 | .SS "Files" 7 | 8 | .in +1c 9 | .ti -1c 10 | .RI "file \fBapreq.h\fP" 11 | .br 12 | .RI "\fIMain header file... \fP" 13 | .PP 14 | .in +1c 15 | 16 | .ti -1c 17 | .RI "file \fBapreq_cookie.h\fP" 18 | .br 19 | .RI "\fICookies and Jars. \fP" 20 | .PP 21 | .in +1c 22 | 23 | .ti -1c 24 | .RI "file \fBapreq_error.h\fP" 25 | .br 26 | .RI "\fIError status codes. \fP" 27 | .PP 28 | .in +1c 29 | 30 | .ti -1c 31 | .RI "file \fBapreq_module.h\fP" 32 | .br 33 | .RI "\fIModule API. \fP" 34 | .PP 35 | .in +1c 36 | 37 | .ti -1c 38 | .RI "file \fBapreq_param.h\fP" 39 | .br 40 | .RI "\fIRequest parsing and parameter API. \fP" 41 | .PP 42 | .in +1c 43 | 44 | .ti -1c 45 | .RI "file \fBapreq_parser.h\fP" 46 | .br 47 | .RI "\fIRequest body parser API. \fP" 48 | .PP 49 | .in +1c 50 | 51 | .ti -1c 52 | .RI "file \fBapreq_util.h\fP" 53 | .br 54 | .RI "\fIUtility functions for apreq. \fP" 55 | .PP 56 | .in +1c 57 | 58 | .ti -1c 59 | .RI "file \fBapreq_version.h\fP" 60 | .br 61 | .RI "\fIVersioning API for libapreq. \fP" 62 | .PP 63 | 64 | .in -1c 65 | -------------------------------------------------------------------------------- /test/dynlex.r: -------------------------------------------------------------------------------- 1 | dynlex <- function() { 2 | setContentType("text/html") 3 | listEnclosures <- function(env=NULL){ 4 | empty <- environmentName(emptyenv()) 5 | if (!is.null(env)) e <- env 6 | else e <- parent.frame(); 7 | n <- environmentName(e); 8 | i <- 0 9 | while (n != empty){ 10 | if (n == '') n <- attributes(e)$name[1] 11 | cat('ENV:',i,n,'------------------------------\n'); 12 | vars <- ls(envir=e) 13 | if (length(vars) > 10) 14 | cat('\t',vars[1:10],'....\n') 15 | else 16 | cat('\t',vars,'\n') 17 | e <- parent.env(e) 18 | n <- environmentName(e) 19 | i <- i + 1 20 | } 21 | } 22 | 23 | listFrames <- function(){ 24 | f <- sys.frames(); 25 | len <- length(f) - 1 ; 26 | if (len < 1) return(invisible()); 27 | cat("in listFrames\n") 28 | for ( i in len:1 ){ 29 | cat('FRAME:',len-i,'----------------\n') 30 | vars <- ls(envir=f[[i]]) 31 | if (length(vars) > 10) 32 | cat('\t',vars[1:10],'....\n') 33 | else 34 | cat('\t',vars,'\n') 35 | } 36 | } 37 | cat("

Call Stack

")
38 | 	listFrames()
39 | 	cat("

Enclosures

")
40 | 	listEnclosures(sys.frame(sys.nframe()))
41 | 	cat("
") 42 | cat("returning",OK," ") 43 | OK 44 | } 45 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_handle_t.3: -------------------------------------------------------------------------------- 1 | .TH "apreq_handle_t" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | apreq_handle_t \- 6 | .SH SYNOPSIS 7 | .br 8 | .PP 9 | \fC#include \fP 10 | .PP 11 | .SS "Data Fields" 12 | 13 | .in +1c 14 | .ti -1c 15 | .RI "const struct \fBapreq_module_t\fP * \fBmodule\fP" 16 | .br 17 | .ti -1c 18 | .RI "\fBapr_pool_t\fP * \fBpool\fP" 19 | .br 20 | .ti -1c 21 | .RI "\fBapr_bucket_alloc_t\fP * \fBbucket_alloc\fP" 22 | .br 23 | .in -1c 24 | .SH "Detailed Description" 25 | .PP 26 | An apreq handle associated with a module. The structure may have variable size, because the module may append its own data structures after it. 27 | .PP 28 | .SH "Field Documentation" 29 | .PP 30 | .SS "\fBapr_bucket_alloc_t\fP* \fBapreq_handle_t::bucket_alloc\fP" 31 | .PP 32 | the allocator, which persists at least as long as the pool 33 | .SS "const struct \fBapreq_module_t\fP* \fBapreq_handle_t::module\fP" 34 | .PP 35 | the apreq module which implements this handle 36 | .SS "\fBapr_pool_t\fP* \fBapreq_handle_t::pool\fP" 37 | .PP 38 | the pool which defines the lifetime of the parsed data 39 | 40 | .SH "Author" 41 | .PP 42 | Generated automatically by Doxygen for libapreq2 from the source code. 43 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/maps/apreq_types.map: -------------------------------------------------------------------------------- 1 | ########## APREQ types ########## 2 | const apr_size_t | UV 3 | apr_size_t | UV 4 | struct SV | SV 5 | apr_status_t | IV 6 | const char * | PV 7 | char * | PV 8 | void | VOID 9 | void * | PTR 10 | const void * | PTR 11 | unsigned | UV 12 | unsigned char | UV 13 | 14 | #data structure stuff 15 | struct request_rec | Apache2::RequestRec | T_APACHEOBJ | r 16 | struct apr_pool_t | APR::Pool | T_POOLOBJ 17 | struct apr_array_header_t | APR::ArrayHeader 18 | struct apr_table_t | APR::Table | T_HASHOBJ 19 | struct apr_bucket_brigade | APR::Brigade 20 | 21 | struct apreq_param_t | APR::Request::Param | T_APREQ_PARAM | param 22 | struct apreq_cookie_t | APR::Request::Cookie | T_APREQ_COOKIE | cookie 23 | 24 | struct apreq_handle_t | APR::Request | T_APREQ_HANDLE | req 25 | struct apreq_xs_handle_apache2_t | APR::Request::Apache2 | T_APREQ_HANDLE_APACHE2 26 | struct apreq_xs_handle_cgi_t | APR::Request::CGI | T_APREQ_HANDLE_CGI 27 | struct apreq_xs_error_t | APR::Request::Error | T_APREQ_ERROR 28 | struct apreq_xs_cookie_table_t | APR::Request::Cookie::Table | T_HASHOBJ 29 | const apreq_xs_param_table_t * | APR::Request::Param::Table | T_HASHOBJ 30 | apreq_xs_subclass_t | SUBCLASS 31 | 32 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_hook_t.3: -------------------------------------------------------------------------------- 1 | .TH "apreq_hook_t" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | apreq_hook_t \- 6 | .SH SYNOPSIS 7 | .br 8 | .PP 9 | \fC#include \fP 10 | .PP 11 | .SS "Data Fields" 12 | 13 | .in +1c 14 | .ti -1c 15 | .RI "\fBapreq_hook_function_t\fP \fBhook\fP" 16 | .br 17 | .ti -1c 18 | .RI "\fBapreq_hook_t\fP * \fBnext\fP" 19 | .br 20 | .ti -1c 21 | .RI "\fBapr_pool_t\fP * \fBpool\fP" 22 | .br 23 | .ti -1c 24 | .RI "void * \fBctx\fP" 25 | .br 26 | .in -1c 27 | .SH "Detailed Description" 28 | .PP 29 | A hook is called by the parser whenever data arrives in a file upload parameter of the request body. You may associate any number of hooks with a parser instance with \fBapreq_parser_add_hook()\fP. 30 | .PP 31 | .SH "Field Documentation" 32 | .PP 33 | .SS "void* \fBapreq_hook_t::ctx\fP" 34 | .PP 35 | a user defined pointer passed to the hook function 36 | .SS "\fBapreq_hook_function_t\fP \fBapreq_hook_t::hook\fP" 37 | .PP 38 | the hook function 39 | .SS "\fBapreq_hook_t\fP* \fBapreq_hook_t::next\fP" 40 | .PP 41 | next item in the linked list 42 | .SS "\fBapr_pool_t\fP* \fBapreq_hook_t::pool\fP" 43 | .PP 44 | pool which allocated this hook 45 | 46 | .SH "Author" 47 | .PP 48 | Generated automatically by Doxygen for libapreq2 from the source code. 49 | -------------------------------------------------------------------------------- /libapreq2/build/get-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # extract version numbers from a header file 4 | # 5 | # USAGE: get-version.sh CMD VERSION_HEADER PREFIX 6 | # where CMD is one of: all, major, libtool 7 | # where PREFIX is the prefix to {MAJOR|MINOR|PATCH}_VERSION defines 8 | # 9 | # get-version.sh all returns a dotted version number 10 | # get-version.sh major returns just the major version number 11 | # get-version.sh minor returns just the minor version number 12 | # get-version.sh patch returns just the match version number 13 | # 14 | 15 | if test $# != 3; then 16 | echo "USAGE: $0 CMD INCLUDEDIR PREFIX" 17 | echo " where CMD is one of: all, major, minor, patch" 18 | exit 1 19 | fi 20 | 21 | major_sed="/#define.*$3_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p" 22 | minor_sed="/#define.*$3_MINOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p" 23 | patch_sed="/#define.*$3_PATCH_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p" 24 | major="`sed -n $major_sed $2`" 25 | minor="`sed -n $minor_sed $2`" 26 | patch="`sed -n $patch_sed $2`" 27 | 28 | if test "$1" = "all"; then 29 | echo ${major}.${minor}.${patch} 30 | elif test "$1" = "major"; then 31 | echo ${major} 32 | elif test "$1" = "minor"; then 33 | echo ${minor} 34 | elif test "$1" = "patch"; then 35 | echo ${patch} 36 | else 37 | echo "ERROR: unknown version CMD ($1)" 38 | exit 1 39 | fi 40 | -------------------------------------------------------------------------------- /libapreq2/module/apache/apreq_module_apache.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright 2003-2005 The Apache Software Foundation 3 | ** 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); 5 | ** you may not use this file except in compliance with the License. 6 | ** You may obtain a copy of the License at 7 | ** 8 | ** http://www.apache.org/licenses/LICENSE-2.0 9 | ** 10 | ** Unless required by applicable law or agreed to in writing, software 11 | ** distributed under the License is distributed on an "AS IS" BASIS, 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ** See the License for the specific language governing permissions and 14 | ** limitations under the License. 15 | */ 16 | 17 | #ifndef APREQ_APACHE_H 18 | #define APREQ_APACHE_H 19 | 20 | #include "apreq_module.h" 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /** 28 | * Create an apreq handle which communicates with an Apache 1.3.x 29 | * request_rec. 30 | */ 31 | APREQ_DECLARE(apreq_handle_t*) apreq_handle_apache(request_rec *r); 32 | 33 | 34 | APREQ_DECLARE(apr_pool_t *) apreq_handle_apache_pool(apreq_handle_t *req); 35 | 36 | APREQ_DECLARE(apr_bucket_alloc_t *) 37 | apreq_handle_apache_bucket_alloc(apreq_handle_t *req); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/TEST.PL: -------------------------------------------------------------------------------- 1 | #!perl 2 | 3 | use strict; 4 | use warnings FATAL => 'all'; 5 | use Apache2::Build; 6 | use constant WIN32 => Apache2::Build::WIN32; 7 | 8 | use Cwd; 9 | my $cwd = WIN32 ? 10 | Win32::GetLongPathName(cwd) : cwd; 11 | $cwd =~ m{^(.+)/glue/perl$} or die "Can't find base cvs directory"; 12 | my $base_dir = $1; 13 | my $module_dir = "$base_dir/module"; 14 | my $mod_apreq2_dir = Apache2::Build::WIN32 ? 15 | "$base_dir/win32/libs" : "$module_dir/apache2/.libs"; 16 | 17 | use base 'Apache::TestRunPerl'; 18 | 19 | main::->new->run(@ARGV); 20 | 21 | sub pre_configure { 22 | my $self = shift; 23 | # Don't load an installed mod_apreq 24 | Apache::TestConfig::autoconfig_skip_module_add('mod_apreq.c'); 25 | Apache::TestConfig::autoconfig_skip_module_add('mod_apreq2.c'); 26 | $self->SUPER::pre_configure(); 27 | } 28 | 29 | sub configure_modperl { 30 | my $self = shift; 31 | my $cfg = $self->{test_config}; 32 | # make sure Win32 uses the just-built libapreq2.dll 33 | if (WIN32) { 34 | my $library_dir = $mod_apreq2_dir; 35 | $cfg->preamble(qq{LoadFile "$library_dir/libapreq2.dll"\n}); 36 | } 37 | $cfg->preamble(IfModule => '!mod_apreq2.c', 38 | qq(LoadModule apreq_module "$mod_apreq2_dir/mod_apreq2.so"\n)); 39 | 40 | $self->SUPER::configure_modperl(); 41 | } 42 | -------------------------------------------------------------------------------- /libapreq2/configure.ac: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | 3 | AC_PREREQ(2.53) 4 | AC_INIT(Apache HTTP Server Request Library, 2.05-dev, apreq-dev@httpd.apache.org, libapreq2) 5 | dnl Generate config.nice script- macro must be here at the top 6 | dnl to avoid corruption of $0 and $@. 7 | APR_CONFIG_NICE(config.nice) 8 | 9 | dnl this: 10 | dnl AC_CONFIG_AUX_DIR(build) 11 | dnl causes problems on certain platforms 12 | dnl aclocal.m4:817: required file `build/ltmain.sh' not found 13 | 14 | dnl debian woody's archaic auto* tools don't set PACKAGE/VERSION correctly via 15 | dnl AC_INIT above, so we do it again here. 16 | AM_INIT_AUTOMAKE(libapreq2, 2.05-dev) 17 | 18 | AC_PROG_MAKE_SET 19 | 20 | dnl Checks for programs. 21 | AC_PROG_CC 22 | AM_PROG_LIBTOOL 23 | AC_PROG_RANLIB 24 | AC_PROG_INSTALL 25 | AC_PROG_LN_S 26 | 27 | AM_MAINTAINER_MODE 28 | 29 | dnl Checks for header files. 30 | AM_CONFIG_HEADER(include/apreq_config.h) 31 | dnl Checks for typedefs, structures, and compiler characteristics. 32 | dnl Checks for library functions. 33 | 34 | AC_APREQ 35 | AC_CONFIG_FILES([Makefile include/Makefile library/Makefile library/t/Makefile module/Makefile module/apache2/Makefile module/apache/Makefile glue/Makefile]) 36 | AC_CONFIG_FILES([build/doxygen.conf include/groups.dox]) 37 | AC_CONFIG_FILES([apreq2-config], [chmod +x apreq2-config]) 38 | AC_OUTPUT 39 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/Error/Error.pod: -------------------------------------------------------------------------------- 1 | =head1 NAME 2 | 3 | APR::Request::Error - wrapper for libapreq2's error API. 4 | 5 | 6 | 7 | =head1 SYNOPSIS 8 | 9 | use APR::Request::Error; 10 | 11 | 12 | 13 | 14 | =head1 DESCRIPTION 15 | 16 | This manpage documents the APR::Request::Error package. 17 | 18 | 19 | 20 | 21 | =head1 SUBROUTINES 22 | 23 | APR::Request::Error - derived from C<< APR::Request >> and C<< APR::Error >>. 24 | 25 | 26 | 27 | 28 | =head2 strerror 29 | 30 | strerror($status) 31 | 32 | Returns the apreq error string associated with a numeric C<$status> code. 33 | 34 | 35 | 36 | 37 | =head1 SEE ALSO 38 | 39 | L, L 40 | 41 | 42 | 43 | 44 | =head1 COPYRIGHT 45 | 46 | Copyright 2003-2005 The Apache Software Foundation 47 | 48 | Licensed under the Apache License, Version 2.0 (the "License"); 49 | you may not use this file except in compliance with the License. 50 | You may obtain a copy of the License at 51 | 52 | http://www.apache.org/licenses/LICENSE-2.0 53 | 54 | Unless required by applicable law or agreed to in writing, software 55 | distributed under the License is distributed on an "AS IS" BASIS, 56 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 57 | See the License for the specific language governing permissions and 58 | limitations under the License. 59 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/response/TestApReq/cookie.pm: -------------------------------------------------------------------------------- 1 | package TestApReq::cookie; 2 | 3 | use strict; 4 | use warnings FATAL => 'all'; 5 | 6 | use Apache2::RequestIO; 7 | use Apache2::RequestRec; 8 | use Apache2::Connection; 9 | 10 | use Apache2::Cookie (); 11 | use Apache2::Request (); 12 | 13 | sub handler { 14 | my $r = shift; 15 | my $req = Apache2::Request->new($r); 16 | my %cookies = Apache2::Cookie->fetch($r); 17 | 18 | $r->content_type('text/plain'); 19 | my $test = $req->APR::Request::args('test'); 20 | my $key = $req->APR::Request::args('key'); 21 | 22 | if ($key and $cookies{$key}) { 23 | if ($test eq "bake") { 24 | $cookies{$key}->bake($r); 25 | } 26 | elsif ($test eq "bake2") { 27 | $cookies{$key}->bake2($r); 28 | } 29 | $r->print($cookies{$key}->value); 30 | } 31 | else { 32 | my @expires; 33 | @expires = ("expires", $req->APR::Request::args('expires')) 34 | if $req->APR::Request::args('expires'); 35 | my $cookie = Apache2::Cookie->new($r, name => "foo", 36 | value => "bar", @expires); 37 | if ($test eq "bake") { 38 | $cookie->bake($req); 39 | } 40 | elsif ($test eq "bake2") { 41 | $cookie->set_attr(version => 1); 42 | $cookie->bake2; 43 | } 44 | $r->print($cookie->value); 45 | } 46 | 47 | 48 | return 0; 49 | } 50 | 51 | 1; 52 | 53 | __END__ 54 | -------------------------------------------------------------------------------- /test/recBin.r: -------------------------------------------------------------------------------- 1 | # Output starts here 2 | setContentType("text/html") 3 | 4 | cat('

receiveBin() test for RApache

\n') 11 | cat('\n',sep='') 12 | cat('Enter a string:
\n',sep='') 13 | cat('Enter another string:
\n',sep='') 14 | cat('Upload a file:
\n') 15 | cat('Upload another file:
\n') 16 | cat('') 17 | 18 | cat("
\n")
19 | while(length(x <- receiveBin(30)) > 0){
20 |     cat(' raw:', x,'\nchar:',sep=' ')
21 |     for (i in 1:length(x)){
22 | 	if (x[i] == 0) cat(' \\0')
23 | 	else if (x[i] == 13) cat(' \\r')
24 | 	else if (x[i] == 10) cat(' \\n')
25 | 	else cat(' ',rawToChar(x[i]))
26 |     }
27 |     cat('\n')
28 | }
29 | cat("
\n")
30 | cat("SERVER INTERNALS\n")
31 | print(list(readStarted=SERVER$internals('readStarted'),postParsed=SERVER$internals('postParsed')))
32 | cat("SERVER\n")
33 | print(SERVER)
34 | cat("
\n") 35 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/apreq_xs_preperl.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright 2004-2005 The Apache Software Foundation 3 | ** 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); 5 | ** you may not use this file except in compliance with the License. 6 | ** You may obtain a copy of the License at 7 | ** 8 | ** http://www.apache.org/licenses/LICENSE-2.0 9 | ** 10 | ** Unless required by applicable law or agreed to in writing, software 11 | ** distributed under the License is distributed on an "AS IS" BASIS, 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ** See the License for the specific language governing permissions and 14 | ** limitations under the License. 15 | */ 16 | 17 | #ifndef APREQ_XS_PREPERL_H 18 | #define APREQ_XS_PREPERL_H 19 | 20 | #define PERL_NO_GET_CONTEXT /* we want efficiency under ithreads */ 21 | 22 | /* some redefines needed for Win32 */ 23 | #ifdef WIN32 24 | # define uid_t perl_uid_t 25 | # define gid_t perl_gid_t 26 | # ifdef exit 27 | # define perl_exit exit 28 | # undef exit 29 | # endif 30 | #endif 31 | 32 | /* Undo httpd.h's strchr override. */ 33 | #ifdef AP_DEBUG 34 | # undef strchr 35 | #endif 36 | 37 | /** 38 | * @file apreq_xs_preperl.h 39 | * @brief XS include file for making Cookie.so and Request.so, for things 40 | * that has to be included before EXTERN.h/perl.h/XSUB.h headers 41 | * 42 | */ 43 | /** 44 | * @defgroup XS Perl 45 | * @ingroup GLUE 46 | * @{ 47 | */ 48 | 49 | /** @} */ 50 | 51 | #endif /* APREQ_XS_PREPERL_H */ 52 | -------------------------------------------------------------------------------- /libapreq2/build/WEBSITE: -------------------------------------------------------------------------------- 1 | build/ 2 | General Info on the apreq community. 3 | Utility scripts for building & packaging httpd-apreq-2. 4 | 5 | 6 | 7 | UPDATING THE WEBSITE: 8 | (cf: http://jakarta.apache.org/site/jakarta-site2.html ) 9 | 10 | RedHat Linux Instructions: 11 | 12 | 1) Download and install j2re and j2sdk rpms from Sun's 13 | website: 14 | 15 | http://java.sun.com/j2se/1.3/download.html 16 | 17 | 2) Download the latest binary release of Apache Ant: 18 | 19 | http://ant.apache.org/bindownload.cgi 20 | 21 | (I just expanded the tar.gz file in /usr/java/ant, which 22 | is alongside the jre and jdk directory trees.) 23 | 24 | 3) Prep the (bash) environment: 25 | 26 | $ export ANT_HOME=/usr/java/ant/apache-ant-1.5.3-1 27 | $ export PATH=$PATH:$ANT_HOME/bin 28 | $ export JAVA_HOME=/usr/java/jdk1.3.1_07 29 | 30 | 4) Check out httpd-site from cvs.apache.org and run 31 | 32 | $ cd httpd-site 33 | $ emacs xdocs/apreq 34 | $ ant 35 | $ cvs commit -m "..." xdocs/apreq/ docs/apreq/ 36 | 37 | 5) Login (via ssh) to httpd.apache.org and do 38 | 39 | $ cd /www/httpd.apache.org 40 | $ cvs update index.html apreq/ 41 | 42 | 43 | 44 | BUILDING THE DOXYGEN DOCUMENTATION: 45 | 46 | Be sure doxygen is installed on your machine. Then cd to 47 | the base directory (httpd-apreq-2) and run 48 | 49 | % make docs 50 | 51 | This will generate the C documentation in the docs/ directory 52 | using build/doxygen.conf as the config file for doxygen. 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/CGI/CGI.pod: -------------------------------------------------------------------------------- 1 | =head1 NAME 2 | 3 | APR::Request::CGI - wrapper for libapreq2's CGI handle. 4 | 5 | 6 | 7 | 8 | =head1 SYNOPSIS 9 | 10 | use APR::Request::CGI; 11 | my $req = APR::Request::CGI->handle($pool); 12 | 13 | 14 | 15 | 16 | =head1 DESCRIPTION 17 | 18 | The APR::Request::CGI module provides a constructor 19 | for accessing CGI request data associated to a pool via libapreq2. 20 | 21 | This manpage documents the APR::Request::CGI package. 22 | 23 | 24 | 25 | 26 | =head1 METHODS 27 | 28 | APR::Request::CGI - derived from C<< APR::Request >>. 29 | 30 | 31 | 32 | 33 | =head2 handle 34 | 35 | APR::Request::CGI->handle($pool) 36 | 37 | Creates an APR::Request::CGI object. The argument C<< $pool >> 38 | is an APR::Pool object. 39 | 40 | 41 | 42 | 43 | =head1 SEE ALSO 44 | 45 | L<< APR::Request >>, L<< APR::Pool >>. 46 | 47 | 48 | 49 | 50 | =head1 COPYRIGHT 51 | 52 | Copyright 2003-2005 The Apache Software Foundation 53 | 54 | Licensed under the Apache License, Version 2.0 (the "License"); 55 | you may not use this file except in compliance with the License. 56 | You may obtain a copy of the License at 57 | 58 | http://www.apache.org/licenses/LICENSE-2.0 59 | 60 | Unless required by applicable law or agreed to in writing, software 61 | distributed under the License is distributed on an "AS IS" BASIS, 62 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 63 | See the License for the specific language governing permissions and 64 | limitations under the License. 65 | 66 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/Apache2/Apache2.pod: -------------------------------------------------------------------------------- 1 | =head1 NAME 2 | 3 | APR::Request::Apache2 - wrapper for a mod_apreq2 handle. 4 | 5 | 6 | 7 | 8 | =head1 SYNOPSIS 9 | 10 | use APR::Request::Apache2; 11 | my $req = APR::Request::Apache2->handle($r); 12 | 13 | 14 | 15 | 16 | =head1 DESCRIPTION 17 | 18 | The APR::Request::Apache2 module provides a constructor 19 | for interfacing with the mod_apreq2 Apache module. 20 | 21 | This manpage documents the APR::Request::Apache2 package. 22 | 23 | 24 | 25 | 26 | =head1 METHODS 27 | 28 | APR::Request::Apache2 - derived from C<< APR::Request >>. 29 | 30 | 31 | 32 | 33 | =head2 handle 34 | 35 | APR::Request::Apache2->handle($r) 36 | 37 | Creates an APR::Request::Apache2 object. The argument C<< $r >> 38 | is an Apache2::RequestRec object (from mod_perl2). 39 | 40 | 41 | 42 | 43 | =head1 SEE ALSO 44 | 45 | L<< APR::Request >>, L<< Apache2::RequestRec >>. 46 | 47 | 48 | 49 | 50 | =head1 COPYRIGHT 51 | 52 | Copyright 2003-2005 The Apache Software Foundation 53 | 54 | Licensed under the Apache License, Version 2.0 (the "License"); 55 | you may not use this file except in compliance with the License. 56 | You may obtain a copy of the License at 57 | 58 | http://www.apache.org/licenses/LICENSE-2.0 59 | 60 | Unless required by applicable law or agreed to in writing, software 61 | distributed under the License is distributed on an "AS IS" BASIS, 62 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 63 | See the License for the specific language governing permissions and 64 | limitations under the License. 65 | 66 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/apreq/request.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings FATAL => 'all'; 3 | 4 | use Apache::Test; 5 | 6 | use Apache::TestUtil; 7 | use Apache::TestRequest qw(GET_BODY UPLOAD_BODY); 8 | 9 | plan tests => 18, have_lwp; 10 | 11 | my $location = "/TestApReq__request"; 12 | #print GET_BODY $location; 13 | 14 | { 15 | # basic param() test 16 | my $test = 'param'; 17 | my $value = '42.5'; 18 | ok t_cmp(GET_BODY("$location?test=$test&value=$value"), 19 | $value, 20 | "basic param"); 21 | } 22 | 23 | 24 | for my $test (qw/slurp bb tempname link fh io bad;query=string%%/) { 25 | # upload a string as a file 26 | my $value = ('DataUpload' x 10 . "\n") x 1_000; 27 | my $result = UPLOAD_BODY("$location?test=$test", content => $value); 28 | ok t_cmp($result, $value, "basic upload"); 29 | my $i; 30 | for ($i = 0; $i < length $value; ++$i) { 31 | last if substr($value,$i,1) ne substr($result,$i,1); 32 | } 33 | 34 | ok t_cmp($i, length($value), "basic upload length"); 35 | } 36 | 37 | 38 | { 39 | my $value = 'DataUpload' x 100; 40 | my $result = UPLOAD_BODY("$location?test=type", content => $value); 41 | ok t_cmp($result, "text/plain", "type"); 42 | } 43 | 44 | { 45 | my $value = 'DataUpload' x 100; 46 | my $result = UPLOAD_BODY("$location?test=hook", content => $value); 47 | ok t_cmp($result, $value, "type"); 48 | } 49 | 50 | { 51 | my $value = 'DataUpload' x 100; 52 | my $result = UPLOAD_BODY("$location?test=disable_uploads;foo=bar1;foo=bar2", 53 | content => $value); 54 | ok t_cmp($result, "ok", "disabled uploads"); 55 | } 56 | -------------------------------------------------------------------------------- /libapreq2/library/module.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright 2003-2005 The Apache Software Foundation 3 | ** 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); 5 | ** you may not use this file except in compliance with the License. 6 | ** You may obtain a copy of the License at 7 | ** 8 | ** http://www.apache.org/licenses/LICENSE-2.0 9 | ** 10 | ** Unless required by applicable law or agreed to in writing, software 11 | ** distributed under the License is distributed on an "AS IS" BASIS, 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ** See the License for the specific language governing permissions and 14 | ** limitations under the License. 15 | */ 16 | 17 | #include "apreq_module.h" 18 | #include "apreq_error.h" 19 | #include "apr_strings.h" 20 | #include "apr_lib.h" 21 | #include "apr_file_io.h" 22 | 23 | APREQ_DECLARE(apreq_param_t *)apreq_param(apreq_handle_t *req, const char *key) 24 | { 25 | apreq_param_t *param = apreq_args_get(req, key); 26 | if (param == NULL) 27 | return apreq_body_get(req, key); 28 | else 29 | return param; 30 | } 31 | 32 | APREQ_DECLARE(apr_table_t *)apreq_params(apreq_handle_t *req, apr_pool_t *p) 33 | { 34 | const apr_table_t *args, *body; 35 | apreq_args(req, &args); 36 | apreq_body(req, &body); 37 | 38 | if (args != NULL) 39 | if (body != NULL) 40 | return apr_table_overlay(p, args, body); 41 | else 42 | return apr_table_copy(p, args); 43 | else 44 | if (body != NULL) 45 | return apr_table_copy(p, body); 46 | else 47 | return NULL; 48 | 49 | } 50 | 51 | 52 | /** @} */ 53 | -------------------------------------------------------------------------------- /libapreq2/module/apache2/Makefile.am: -------------------------------------------------------------------------------- 1 | TEST_CONFIG_SCRIPT = package Apache::TestMM; filter_args(); generate_script("t/TEST") 2 | mod_apreq2_la_LDFLAGS = -export-dynamic -module -avoid-version \ 3 | `@APREQ_CONFIG@ --link-libtool --libs` @APR_LTFLAGS@ 4 | mod_apreq2_la_SOURCES = apreq_private_apache2.h handle.c filter.c 5 | 6 | pkgcfgdir = `@APACHE2_APXS@ -q SYSCONFDIR` 7 | pkgincludedir = `@APACHE2_APXS@ -q INCLUDEDIR`/@APREQ_LIBNAME@ 8 | pkglibdir = `@APACHE2_APXS@ -q LIBEXECDIR` 9 | 10 | if MAINTAINER_MODE 11 | 12 | AM_CPPFLAGS = -DAP_HAVE_DESIGNATED_INITIALIZER @APACHE2_INCLUDES@ @APR_INCLUDES@ 13 | 14 | else 15 | 16 | AM_CPPFLAGS = @APACHE2_INCLUDES@ @APR_INCLUDES@ 17 | 18 | endif 19 | 20 | 21 | if BUILD_HTTPD 22 | 23 | # XXX FIXME: static builds don't work anymore 24 | # mod_apreq2 needs to be built from httpd-2.X, e.g. 25 | # 26 | # % cd ../httpd-2.X; 27 | # % ./configure --with-module=filters:../httpd-apreq-2/module/apache2/mod_apreq2.c ... 28 | # 29 | # See the INSTALL file for details. 30 | 31 | @APACHE2_HTTPD@: 32 | cd @APACHE2_SRC@ && $(MAKE) 33 | 34 | all-local: @APACHE2_HTTPD@ 35 | 36 | else 37 | 38 | pkginclude_HEADERS = apreq_module_apache2.h 39 | pkglib_LTLIBRARIES = mod_apreq2.la 40 | 41 | install-exec-local : 42 | @echo "----------------------------------------------------------------------" 43 | @echo "Before you can use mod_apreq2, you must ensure that an appropriate" 44 | @echo "\"LoadModule\" line appears in your webserver's config file:" 45 | @echo "$(pkgcfgdir)/httpd.conf" 46 | @echo 47 | @echo "LoadModule apreq_module $(pkglibdir)/mod_apreq2.so" 48 | @echo "----------------------------------------------------------------------" 49 | 50 | endif 51 | -------------------------------------------------------------------------------- /libapreq2/include/apreq_config.h.in: -------------------------------------------------------------------------------- 1 | /* include/apreq_config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_MEMORY_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_STDINT_H 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_STDLIB_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_STRINGS_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_STRING_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_SYS_STAT_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_SYS_TYPES_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_UNISTD_H 32 | 33 | /* Name of package */ 34 | #undef PACKAGE 35 | 36 | /* Define to the address where bug reports for this package should be sent. */ 37 | #undef PACKAGE_BUGREPORT 38 | 39 | /* Define to the full name of this package. */ 40 | #undef PACKAGE_NAME 41 | 42 | /* Define to the full name and version of this package. */ 43 | #undef PACKAGE_STRING 44 | 45 | /* Define to the one symbol short name of this package. */ 46 | #undef PACKAGE_TARNAME 47 | 48 | /* Define to the version of this package. */ 49 | #undef PACKAGE_VERSION 50 | 51 | /* Define to 1 if you have the ANSI C header files. */ 52 | #undef STDC_HEADERS 53 | 54 | /* Version number of package */ 55 | #undef VERSION 56 | -------------------------------------------------------------------------------- /libapreq2/docs/html/apreq_notice.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: NOTICE 5 | 6 | 7 | 13 | 14 | 15 | 17 |

NOTICE

This product includes software developed by
18 | The Apache Software Foundation (http://www.apache.org/).
19 | 
28 | 29 | 30 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/libapreq2.3: -------------------------------------------------------------------------------- 1 | .TH "Apache Request Library" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | Apache Request Library \- libapreq2 Version 2.1.0 6 | 7 | .PP 8 | .SS "Files" 9 | 10 | .in +1c 11 | .ti -1c 12 | .RI "file \fBapreq.h\fP" 13 | .br 14 | .RI "\fIMain header file... \fP" 15 | .PP 16 | .in +1c 17 | 18 | .ti -1c 19 | .RI "file \fBapreq_cookie.h\fP" 20 | .br 21 | .RI "\fICookies and Jars. \fP" 22 | .PP 23 | .in +1c 24 | 25 | .ti -1c 26 | .RI "file \fBapreq_error.h\fP" 27 | .br 28 | .RI "\fIError status codes. \fP" 29 | .PP 30 | .in +1c 31 | 32 | .ti -1c 33 | .RI "file \fBapreq_module.h\fP" 34 | .br 35 | .RI "\fIModule API. \fP" 36 | .PP 37 | .in +1c 38 | 39 | .ti -1c 40 | .RI "file \fBapreq_param.h\fP" 41 | .br 42 | .RI "\fIRequest parsing and parameter API. \fP" 43 | .PP 44 | .in +1c 45 | 46 | .ti -1c 47 | .RI "file \fBapreq_parser.h\fP" 48 | .br 49 | .RI "\fIRequest body parser API. \fP" 50 | .PP 51 | .in +1c 52 | 53 | .ti -1c 54 | .RI "file \fBapreq_util.h\fP" 55 | .br 56 | .RI "\fIUtility functions for apreq. \fP" 57 | .PP 58 | .in +1c 59 | 60 | .ti -1c 61 | .RI "file \fBapreq_version.h\fP" 62 | .br 63 | .RI "\fIVersioning API for libapreq. \fP" 64 | .PP 65 | 66 | .in -1c 67 | .SH "Detailed Description" 68 | .PP 69 | libapreq2 Version 2.1.0 70 | .PP 71 | libapreq2 is a shared library based on the \fBApache\fP Portable Runtime libraries libapr and libaprutil. 72 | .PP 73 | \fBSee also:\fP 74 | .RS 4 75 | http://apr.apache.org/ 76 | .RE 77 | .PP 78 | .SH "Configuring libapreq2 Applications" 79 | .PP 80 | This package includes \fCapreq2-config\fP, a configuration script for building applications with libapreq2. Run \fCapreq2-config --help\fP to display its options. XXX add examples here XXX 81 | -------------------------------------------------------------------------------- /libapreq2/docs/html/functions_rela.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: Data Fields - Related Functions 5 | 6 | 7 | 13 | 14 | 15 | 16 | 17 | 18 |

19 | 20 |

21 | 22 |

31 | 32 | 33 | -------------------------------------------------------------------------------- /test/RookTest.R: -------------------------------------------------------------------------------- 1 | app <- function(env){ 2 | req <- Request$new(env) 3 | res <- Response$new() 4 | cat('hello',file=stderr()) 5 | envstr <- paste(capture.output(str(as.list(env)),file=NULL),collapse='\n') 6 | poststr <- paste(capture.output(str(req$POST()),file=NULL),collapse='\n') 7 | getstr <- paste(capture.output(str(req$GET()),file=NULL),collapse='\n') 8 | randomString <- function() paste(letters[floor(runif(10,0,26))],collapse='') 9 | randomNumber <- function() runif(1,0,26) 10 | res$write( c( 11 | '', 18 | 'rook logo', 19 | '

Welcome to Rook

\n', 20 | sprintf('',env$SCRIPT_NAME,randomString(),randomNumber()), 21 | 'Enter a string:
\n', 22 | 'Enter another string:
\n', 23 | 'Upload a file:
\n', 24 | 'Upload another file:
\n', 25 | '

', 26 | 'Environment:
',envstr,'

', 27 | 'Get:
',getstr,'

', 28 | 'Post:
',poststr, '


' 29 | )) 30 | res$finish() 31 | } 32 | -------------------------------------------------------------------------------- /libapreq2/win32/README: -------------------------------------------------------------------------------- 1 | This directory contains the necessary makefiles to build 2 | libapreq and related things on Win32 using VC++ 6. Run, 3 | from the httpd-apreq-2 top-level directory, 4 | perl Makefile.PL 5 | to generate the top-level Makefile. Available options are: 6 | 7 | --with-apache2=C:\Path\to\Apache2 : specify the top-level Apache2 directory 8 | --debug : build a debug version 9 | --without-perl : skip initialization of perl glue 10 | --help : print a help message 11 | 12 | With no options specified, an attempt will be made to find a suitable 13 | Apache2 directory, and if found, a non-debug version will be built. 14 | 15 | Assuming the configuration is successful, a Makefile will 16 | be generated. This can be used as: 17 | 18 | nmake - builds the libapreq2 library 19 | nmake test - runs the supplied tests 20 | nmake mod_apreq - builds mod_apreq 21 | nmake install - install the C libraries 22 | nmake clean - clean 23 | nmake perl_glue - build the perl glue 24 | nmake perl_test - test the perl glue 25 | nmake perl_install - install the perl glue 26 | nmake docs - build documentation 27 | nmake help - print a usage message 28 | 29 | The 'docs' target is only available if a doxygen binary is detected. 30 | 31 | An experimental apxs tool for Win32 is available at 32 | http://perl.apache.org/dist/win32-bin/apxs_win32.tar.gz 33 | which will be needed to build the env/c-modules tests. If the 34 | apxs bat file isn't found on your system, the configuration 35 | script should offer to fetch and install it for you. If this 36 | is not done, grab the above archive, unpack it, and run the 37 | Configure.pl script within the archive to install. 38 | -------------------------------------------------------------------------------- /rpm/rapache-openSUSE_13.2.spec: -------------------------------------------------------------------------------- 1 | Name: rapache 2 | Version: 1.2.11 3 | Release: rpm0 4 | Source: %{name}-%{version}.tar.gz 5 | License: Apache2 6 | Summary: RApache module for apache2 web server (mod_R) 7 | Group: Applications/Internet 8 | Buildroot: %{_tmppath}/%{name}-buildroot 9 | URL: http://www.rapache.net 10 | BuildRequires: apache2-devel 11 | BuildRequires: R-base-devel 12 | BuildRequires: libicu-devel 13 | BuildRequires: make 14 | Requires: libicu 15 | Requires: apache2 16 | Requires: apache2-prefork 17 | Requires: R-base 18 | 19 | %description 20 | First presented at DSC2005, rApache is a project supporting web application development using the R statistical language and environment and the Apache web server. The current release runs on UNIX/Linux and Mac OS X operating systems. 21 | 22 | %prep 23 | %setup 24 | 25 | %build 26 | ./configure 27 | make 28 | 29 | %install 30 | mkdir -p $RPM_BUILD_ROOT%{_libdir}/apache2/ 31 | sed -i.bak s\,modules/mod_R.so,%{_libdir}/apache2/mod_R.so,g ./rpm/00-rapache.conf 32 | sed -i.bak s\,/var/www/html,/srv/www/htdocs,g ./rpm/00-rapache.conf 33 | cp .libs/mod_R.so $RPM_BUILD_ROOT%{_libdir}/apache2/ 34 | cp libapreq2/library/.libs/libapreq2.so.3 $RPM_BUILD_ROOT%{_libdir}/ 35 | mkdir -p %{buildroot}/etc/apache2/conf.d 36 | cp ./rpm/00-rapache.conf %{buildroot}/etc/apache2/conf.d/ 37 | mkdir -p %{buildroot}/srv/www/htdocs/R 38 | cp ./rpm/test %{buildroot}/srv/www/htdocs/R/ 39 | export NO_BRP_CHECK_RPATH=true 40 | 41 | %pre 42 | 43 | %post 44 | systemctl restart apache2.service || true 45 | 46 | %preun 47 | 48 | %postun 49 | systemctl restart apache2.service || true 50 | 51 | %files 52 | %defattr(644,wwwrun,www,755) 53 | /etc/apache2/conf.d/00-rapache.conf 54 | %{_libdir}/apache2/mod_R.so 55 | %{_libdir}/libapreq2.so.3 56 | %dir /srv/www/htdocs/R 57 | /srv/www/htdocs/R/test 58 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_cookie_t.3: -------------------------------------------------------------------------------- 1 | .TH "apreq_cookie_t" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | apreq_cookie_t \- Cookie type, supporting both Netscape and RFC cookie specifications. 6 | 7 | .PP 8 | .SH SYNOPSIS 9 | .br 10 | .PP 11 | \fC#include \fP 12 | .PP 13 | .SS "Data Fields" 14 | 15 | .in +1c 16 | .ti -1c 17 | .RI "char * \fBpath\fP" 18 | .br 19 | .ti -1c 20 | .RI "char * \fBdomain\fP" 21 | .br 22 | .ti -1c 23 | .RI "char * \fBport\fP" 24 | .br 25 | .ti -1c 26 | .RI "char * \fBcomment\fP" 27 | .br 28 | .ti -1c 29 | .RI "char * \fBcommentURL\fP" 30 | .br 31 | .ti -1c 32 | .RI "\fBapr_time_t\fP \fBmax_age\fP" 33 | .br 34 | .ti -1c 35 | .RI "unsigned \fBflags\fP" 36 | .br 37 | .ti -1c 38 | .RI "const \fBapreq_value_t\fP \fBv\fP" 39 | .br 40 | .in -1c 41 | .SH "Detailed Description" 42 | .PP 43 | Cookie type, supporting both Netscape and RFC cookie specifications. 44 | .PP 45 | .SH "Field Documentation" 46 | .PP 47 | .SS "char* \fBapreq_cookie_t::comment\fP" 48 | .PP 49 | RFC cookies may send a comment 50 | .SS "char* \fBapreq_cookie_t::commentURL\fP" 51 | .PP 52 | RFC cookies may place an URL here 53 | .SS "char* \fBapreq_cookie_t::domain\fP" 54 | .PP 55 | Restricts server domain 56 | .SS "unsigned \fBapreq_cookie_t::flags\fP" 57 | .PP 58 | charsets, taint marks, app-specific bits 59 | .SS "\fBapr_time_t\fP \fBapreq_cookie_t::max_age\fP" 60 | .PP 61 | total duration of cookie: -1 == session 62 | .SS "char* \fBapreq_cookie_t::path\fP" 63 | .PP 64 | Restricts url path 65 | .SS "char* \fBapreq_cookie_t::port\fP" 66 | .PP 67 | Restricts server port 68 | .SS "const \fBapreq_value_t\fP \fBapreq_cookie_t::v\fP" 69 | .PP 70 | 'raw' cookie value 71 | 72 | .SH "Author" 73 | .PP 74 | Generated automatically by Doxygen for libapreq2 from the source code. 75 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/Error/Error.xs: -------------------------------------------------------------------------------- 1 | MODULE = APR::Request::Error PACKAGE = APR::Request::Error 2 | 3 | SV *strerror(s) 4 | apr_status_t s 5 | CODE: 6 | RETVAL = apreq_xs_error2sv(aTHX_ s); 7 | OUTPUT: 8 | RETVAL 9 | 10 | SV *as_string(hv, p1=NULL, p2=NULL) 11 | APR::Request::Error hv 12 | SV *p1 13 | SV *p2 14 | PREINIT: 15 | SV **svp; 16 | 17 | CODE: 18 | svp = hv_fetch(hv, "rc", 2, FALSE); 19 | if (svp == NULL) 20 | RETVAL = &PL_sv_undef; 21 | else 22 | RETVAL = apreq_xs_error2sv(aTHX_ SvIVX(*svp)); 23 | 24 | OUTPUT: 25 | RETVAL 26 | 27 | BOOT: 28 | { 29 | apr_version_t version; 30 | apr_version(&version); 31 | if (version.major != APR_MAJOR_VERSION) 32 | Perl_croak(aTHX_ "Can't load module APR::Request::Error : " 33 | "wrong libapr major version " 34 | "(expected %d, saw %d)", 35 | APR_MAJOR_VERSION, version.major); 36 | } 37 | /* register the overloading (type 'A') magic */ 38 | PL_amagic_generation++; 39 | /* The magic for overload gets a GV* via gv_fetchmeth as */ 40 | /* mentioned above, and looks in the SV* slot of it for */ 41 | /* the "fallback" status. */ 42 | sv_setsv( 43 | get_sv( "APR::Request::Error::()", TRUE ), 44 | &PL_sv_undef 45 | ); 46 | newXS("APR::Request::Error::()", XS_APR__Request__Error_nil, file); 47 | newXS("APR::Request::Error::(\"\"", XS_APR__Request__Error_as_string, file); 48 | 49 | newCONSTSUB(PL_defstash, "APR::Request::Error::GENERAL", 50 | apreq_xs_error2sv(aTHX_ APREQ_ERROR_GENERAL)); 51 | newCONSTSUB(PL_defstash, "APR::Request::Error::TAINTED", 52 | apreq_xs_error2sv(aTHX_ APREQ_ERROR_TAINTED)); 53 | -------------------------------------------------------------------------------- /libapreq2/docs/html/dirs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: Directory Hierarchy 5 | 6 | 7 | 13 | 14 | 15 |

libapreq2 Directories

This directory hierarchy is sorted roughly, but not completely, alphabetically: 23 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /libapreq2/module/t/c-modules/apreq_redirect_test/mod_apreq_redirect_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright 2003-2005 The Apache Software Foundation 3 | ** 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); 5 | ** you may not use this file except in compliance with the License. 6 | ** You may obtain a copy of the License at 7 | ** 8 | ** http://www.apache.org/licenses/LICENSE-2.0 9 | ** 10 | ** Unless required by applicable law or agreed to in writing, software 11 | ** distributed under the License is distributed on an "AS IS" BASIS, 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ** See the License for the specific language governing permissions and 14 | ** limitations under the License. 15 | */ 16 | 17 | #ifdef CONFIG_FOR_HTTPD_TEST 18 | #if CONFIG_FOR_HTTPD_TEST 19 | 20 | 21 | TestAccess test 22 | SetHandler apreq_redirect_test 23 | 24 | 25 | #endif 26 | #endif 27 | 28 | #define APACHE_HTTPD_TEST_HANDLER apreq_redirect_test_handler 29 | 30 | #include "apache_httpd_test.h" 31 | #include "apreq_module_apache2.h" 32 | #include "httpd.h" 33 | 34 | static int apreq_redirect_test_handler(request_rec *r) 35 | { 36 | apreq_handle_t *req; 37 | const apreq_param_t *loc; 38 | 39 | if (strcmp(r->handler, "apreq_redirect_test") != 0) 40 | return DECLINED; 41 | 42 | req = apreq_handle_apache2(r); 43 | 44 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, 45 | r, "looking for new location"); 46 | loc = apreq_param(req, "location"); 47 | if (!loc) 48 | return DECLINED; 49 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, 50 | r, "redirecting to %s", loc->v.data); 51 | ap_internal_redirect(loc->v.data, r); 52 | return OK; 53 | } 54 | 55 | APACHE_HTTPD_TEST_MODULE(apreq_redirect_test); 56 | -------------------------------------------------------------------------------- /libapreq2/module/apache/t/c-modules/apreq_redirect_test/mod_apreq_redirect_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright 2003-2005 The Apache Software Foundation 3 | ** 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); 5 | ** you may not use this file except in compliance with the License. 6 | ** You may obtain a copy of the License at 7 | ** 8 | ** http://www.apache.org/licenses/LICENSE-2.0 9 | ** 10 | ** Unless required by applicable law or agreed to in writing, software 11 | ** distributed under the License is distributed on an "AS IS" BASIS, 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ** See the License for the specific language governing permissions and 14 | ** limitations under the License. 15 | */ 16 | 17 | #ifdef CONFIG_FOR_HTTPD_TEST 18 | #if CONFIG_FOR_HTTPD_TEST 19 | 20 | 21 | TestAccess test 22 | SetHandler apreq_redirect_test 23 | 24 | 25 | #endif 26 | #endif 27 | 28 | #define APACHE_HTTPD_TEST_HANDLER apreq_redirect_test_handler 29 | 30 | #include "apache_httpd_test.h" 31 | #include "apreq_module_apache2.h" 32 | #include "httpd.h" 33 | 34 | static int apreq_redirect_test_handler(request_rec *r) 35 | { 36 | apreq_handle_t *req; 37 | const apreq_param_t *loc; 38 | 39 | if (strcmp(r->handler, "apreq_redirect_test") != 0) 40 | return DECLINED; 41 | 42 | req = apreq_handle_apache2(r); 43 | 44 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, 45 | r, "looking for new location"); 46 | loc = apreq_param(req, "location"); 47 | if (!loc) 48 | return DECLINED; 49 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, 50 | r, "redirecting to %s", loc->v.data); 51 | ap_internal_redirect(loc->v.data, r); 52 | return OK; 53 | } 54 | 55 | APACHE_HTTPD_TEST_MODULE(apreq_redirect_test); 56 | -------------------------------------------------------------------------------- /libapreq2/module/t/c-modules/apreq_big_request_test/mod_apreq_big_request_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright 2003-2005 The Apache Software Foundation 3 | ** 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); 5 | ** you may not use this file except in compliance with the License. 6 | ** You may obtain a copy of the License at 7 | ** 8 | ** http://www.apache.org/licenses/LICENSE-2.0 9 | ** 10 | ** Unless required by applicable law or agreed to in writing, software 11 | ** distributed under the License is distributed on an "AS IS" BASIS, 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ** See the License for the specific language governing permissions and 14 | ** limitations under the License. 15 | */ 16 | 17 | #ifdef CONFIG_FOR_HTTPD_TEST 18 | #if CONFIG_FOR_HTTPD_TEST 19 | 20 | 21 | SetHandler apreq_big_request_test 22 | 23 | 24 | #endif 25 | #endif 26 | 27 | #define APACHE_HTTPD_TEST_HANDLER apreq_big_request_test_handler 28 | 29 | #include "apache_httpd_test.h" 30 | #include "apreq_module_apache2.h" 31 | #include "httpd.h" 32 | 33 | static int dump_table(void *count, const char *key, const char *value) 34 | { 35 | int *c = (int *) count; 36 | *c = *c + strlen(key) + strlen(value); 37 | return 1; 38 | } 39 | 40 | static int apreq_big_request_test_handler(request_rec *r) 41 | { 42 | apreq_handle_t *req; 43 | apr_table_t *params; 44 | int count = 0; 45 | 46 | if (strcmp(r->handler, "apreq_big_request_test") != 0) 47 | return DECLINED; 48 | 49 | req = apreq_handle_apache2(r); 50 | 51 | params = apreq_params(req, r->pool); 52 | apr_table_do(dump_table, &count, params, NULL); 53 | ap_set_content_type(r, "text/plain"); 54 | ap_rprintf(r, "%d", count); 55 | return OK; 56 | } 57 | 58 | APACHE_HTTPD_TEST_MODULE(apreq_big_request_test); 59 | -------------------------------------------------------------------------------- /libapreq2/module/apache/t/c-modules/apreq_big_request_test/mod_apreq_big_request_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright 2003-2005 The Apache Software Foundation 3 | ** 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); 5 | ** you may not use this file except in compliance with the License. 6 | ** You may obtain a copy of the License at 7 | ** 8 | ** http://www.apache.org/licenses/LICENSE-2.0 9 | ** 10 | ** Unless required by applicable law or agreed to in writing, software 11 | ** distributed under the License is distributed on an "AS IS" BASIS, 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ** See the License for the specific language governing permissions and 14 | ** limitations under the License. 15 | */ 16 | 17 | #ifdef CONFIG_FOR_HTTPD_TEST 18 | #if CONFIG_FOR_HTTPD_TEST 19 | 20 | 21 | SetHandler apreq_big_request_test 22 | 23 | 24 | #endif 25 | #endif 26 | 27 | #define APACHE_HTTPD_TEST_HANDLER apreq_big_request_test_handler 28 | 29 | #include "apache_httpd_test.h" 30 | #include "apreq_module_apache2.h" 31 | #include "httpd.h" 32 | 33 | static int dump_table(void *count, const char *key, const char *value) 34 | { 35 | int *c = (int *) count; 36 | *c = *c + strlen(key) + strlen(value); 37 | return 1; 38 | } 39 | 40 | static int apreq_big_request_test_handler(request_rec *r) 41 | { 42 | apreq_handle_t *req; 43 | apr_table_t *params; 44 | int count = 0; 45 | 46 | if (strcmp(r->handler, "apreq_big_request_test") != 0) 47 | return DECLINED; 48 | 49 | req = apreq_handle_apache2(r); 50 | 51 | params = apreq_params(req, r->pool); 52 | apr_table_do(dump_table, &count, params, NULL); 53 | ap_set_content_type(r, "text/plain"); 54 | ap_rprintf(r, "%d", count); 55 | return OK; 56 | } 57 | 58 | APACHE_HTTPD_TEST_MODULE(apreq_big_request_test); 59 | -------------------------------------------------------------------------------- /libapreq2/docs/man/man3/apreq_parser_t.3: -------------------------------------------------------------------------------- 1 | .TH "apreq_parser_t" 3 "4 May 2005" "Version 2.05-dev" "libapreq2" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | apreq_parser_t \- 6 | .SH SYNOPSIS 7 | .br 8 | .PP 9 | \fC#include \fP 10 | .PP 11 | .SS "Data Fields" 12 | 13 | .in +1c 14 | .ti -1c 15 | .RI "\fBapreq_parser_function_t\fP \fBparser\fP" 16 | .br 17 | .ti -1c 18 | .RI "const char * \fBcontent_type\fP" 19 | .br 20 | .ti -1c 21 | .RI "\fBapr_pool_t\fP * \fBpool\fP" 22 | .br 23 | .ti -1c 24 | .RI "\fBapr_bucket_alloc_t\fP * \fBbucket_alloc\fP" 25 | .br 26 | .ti -1c 27 | .RI "\fBapr_size_t\fP \fBbrigade_limit\fP" 28 | .br 29 | .ti -1c 30 | .RI "const char * \fBtemp_dir\fP" 31 | .br 32 | .ti -1c 33 | .RI "\fBapreq_hook_t\fP * \fBhook\fP" 34 | .br 35 | .ti -1c 36 | .RI "void * \fBctx\fP" 37 | .br 38 | .in -1c 39 | .SH "Detailed Description" 40 | .PP 41 | A request body parser instance. 42 | .PP 43 | .SH "Field Documentation" 44 | .PP 45 | .SS "\fBapr_size_t\fP \fBapreq_parser_t::brigade_limit\fP" 46 | .PP 47 | the maximum in-memory bytes a brigade may use 48 | .SS "\fBapr_bucket_alloc_t\fP* \fBapreq_parser_t::bucket_alloc\fP" 49 | .PP 50 | bucket allocator used to create bucket brigades 51 | .SS "const char* \fBapreq_parser_t::content_type\fP" 52 | .PP 53 | the Content-Type request header 54 | .SS "void* \fBapreq_parser_t::ctx\fP" 55 | .PP 56 | internal context pointer used by the parser function 57 | .SS "\fBapreq_hook_t\fP* \fBapreq_parser_t::hook\fP" 58 | .PP 59 | linked list of hooks 60 | .SS "\fBapreq_parser_function_t\fP \fBapreq_parser_t::parser\fP" 61 | .PP 62 | the function which parses chunks of body data 63 | .SS "\fBapr_pool_t\fP* \fBapreq_parser_t::pool\fP" 64 | .PP 65 | a pool used by the parser 66 | .SS "const char* \fBapreq_parser_t::temp_dir\fP" 67 | .PP 68 | the directory used by the parser for temporary files 69 | 70 | .SH "Author" 71 | .PP 72 | Generated automatically by Doxygen for libapreq2 from the source code. 73 | -------------------------------------------------------------------------------- /libapreq2/module/t/cookie.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings FATAL => 'all'; 3 | 4 | use Apache::Test; 5 | 6 | use Apache::TestUtil; 7 | use Apache::TestRequest qw(GET_BODY GET_HEAD); 8 | 9 | plan tests => 5, have_lwp; 10 | 11 | require HTTP::Cookies; 12 | 13 | my $location = "/apreq_cookie_test"; 14 | 15 | { 16 | my $test = 'netscape'; 17 | my $key = 'apache'; 18 | my $value = 'ok'; 19 | my $cookie = qq{$key=$value}; 20 | ok t_cmp(GET_BODY("$location?test=$test&key=$key", Cookie => $cookie), 21 | $value, 22 | $test); 23 | } 24 | { 25 | my $test = 'rfc'; 26 | my $key = 'apache'; 27 | my $value = 'ok'; 28 | my $cookie = qq{\$Version="1"; $key="$value"; \$Path="$location"}; 29 | ok t_cmp(GET_BODY("$location?test=$test&key=$key", Cookie => $cookie), 30 | qq{"$value"}, 31 | $test); 32 | } 33 | { 34 | my $test = 'encoded value with space'; 35 | my $key = 'apache'; 36 | my $value = 'okie dokie'; 37 | my $cookie = "$key=" . join '', 38 | map {/ / ? '+' : sprintf '%%%.2X', ord} split //, $value; 39 | ok t_cmp(GET_BODY("$location?test=$test&key=$key", Cookie => $cookie), 40 | $value, 41 | $test); 42 | } 43 | { 44 | my $test = 'bake'; 45 | my $key = 'apache'; 46 | my $value = 'ok'; 47 | my $cookie = "$key=$value"; 48 | my ($header) = GET_HEAD("$location?test=$test&key=$key", 49 | Cookie => $cookie) =~ /^#Set-Cookie:\s+(.+)/m; 50 | 51 | ok t_cmp($header, $cookie, $test); 52 | } 53 | { 54 | my $test = 'bake2'; 55 | my $key = 'apache'; 56 | my $value = 'ok'; 57 | my $cookie = qq{\$Version="1"; $key="$value"; \$Path="$location"}; 58 | my ($header) = GET_HEAD("$location?test=$test&key=$key", 59 | Cookie => $cookie) =~ /^#Set-Cookie2:\s+(.+)/m; 60 | ok t_cmp($header, qq{$key="$value"; Version=1; path="$location"}, $test); 61 | } 62 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/apreq/upload.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings FATAL => 'all'; 3 | 4 | use Apache::Test; 5 | use Apache::TestUtil; 6 | use Apache::TestRequest qw(UPLOAD_BODY GET_BODY_ASSERT); 7 | use Cwd; 8 | require File::Basename; 9 | 10 | my $cwd = getcwd(); 11 | my $location = "/TestApReq__upload"; 12 | 13 | my %types = (perl => 'application/octet-stream', 14 | httpd => 'application/octet-stream', 15 | 'perltoc.pod' => 'text/x-pod', 16 | 'perlport.pod' => 'text/x-pod'); 17 | my @names = sort keys %types; 18 | my @methods = sort qw/slurp fh tempname link io/; 19 | 20 | plan tests => @names * @methods, have_lwp; 21 | 22 | foreach my $name (@names) { 23 | my $url = ( ($name =~ /\.pod$/) ? 24 | "getfiles-perl-pod/" : "/getfiles-binary-" ) . $name; 25 | my $content = GET_BODY_ASSERT($url); 26 | my $path = File::Spec->catfile($cwd, 't', $name); 27 | open my $fh, ">", $path or die "Cannot open $path: $!"; 28 | binmode $fh; 29 | print $fh $content; 30 | close $fh; 31 | } 32 | 33 | eval {require Digest::MD5;}; 34 | my $has_md5 = $@ ? 0 : 1; 35 | 36 | foreach my $file( map {File::Spec->catfile($cwd, 't', $_)} @names) { 37 | my $size = -s $file; 38 | my $cs = $has_md5 ? cs($file) : 0; 39 | my $basename = File::Basename::basename($file); 40 | 41 | for my $method ( @methods) { 42 | my $result = UPLOAD_BODY("$location?method=$method;has_md5=$has_md5", 43 | filename => $file); 44 | my $expected = <new->addfile($fh)->hexdigest; 61 | close $fh; 62 | return $md5; 63 | } 64 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | libapache2-mod-r-base (1.2.11-noble) noble0; urgency=low 2 | 3 | * Fix build for R-4.5 4 | 5 | -- Jeroen Ooms Wed, 18 Jun 2025 00:00:00 -0600 6 | 7 | libapache2-mod-r-base (1.2.9-xenial0) xenial0; urgency=low 8 | 9 | * Fixes integer overflow in receiveBin() for 1GB+ POST requests 10 | 11 | -- Jeroen Ooms Sat, 23 Apr 2016 00:00:00 -0600 12 | 13 | libapache2-mod-r-base (1.2.8-xenial0) xenial0; urgency=low 14 | 15 | * Remove apache2-mpm-prefork dependency (prefork is now included 16 | with apache2-dev / apache2-bin) 17 | 18 | -- Jeroen Ooms Sat, 23 Apr 2016 00:00:00 -0600 19 | 20 | libapache2-mod-r-base (1.2.7-trusty0) trusty; urgency=low 21 | 22 | * Add support for rpm 23 | 24 | -- Jeroen Ooms Wed, 24 Jun 2015 00:00:00 -0600 25 | 26 | libapache2-mod-r-base (1.2.6-trusty0) trusty; urgency=low 27 | 28 | * Add support for rpm 29 | 30 | -- Jeroen Ooms Sun, 17 Aug 2014 00:00:00 -0600 31 | 32 | libapache2-mod-r-base (1.2.5-saucy0) saucy; urgency=low 33 | 34 | * Various small fixes 35 | 36 | -- Jeroen Ooms Mon, 23 Dec 2013 00:00:00 -0600 37 | 38 | libapache2-mod-r-base (1.2.4-raring5) raring; urgency=low 39 | 40 | * Updates for compatibility with Apache 2.4 41 | 42 | -- Jeroen Ooms Tue, 15 Oct 2013 11:08:00 -0600 43 | 44 | libapache2-mod-r-base (1.1.14-ppa3) lucid; urgency=low 45 | 46 | * Binary package release for rApache 1.1.14 47 | 48 | -- Jeffrey Horner Wed, 12 Jan 2011 11:08:00 -0600 49 | libapache2-mod-r-base (1.1.13-ppa3) lucid; urgency=low 50 | 51 | * Binary package release for rApache 1.1.13 52 | 53 | -- Jeffrey Horner Thu, 09 Dec 2010 07:46:44 -0600 54 | 55 | libapache2-mod-r-base (1.1.10-ppa3) lucid; urgency=low 56 | 57 | * First binary package release with new name. 58 | 59 | -- Jeffrey Horner Fri, 01 Oct 2010 19:00:25 -0500 60 | -------------------------------------------------------------------------------- /libapreq2/module/apache/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = $(APACHE1_INCLUDES) @APR_INCLUDES@ 2 | TEST_CONFIG_SCRIPT = package Apache::TestMM; filter_args(); generate_script("t/TEST") 3 | 4 | pkgcfgdir = `@APACHE1_APXS@ -q SYSCONFDIR` 5 | pkglibdir = `@APACHE1_APXS@ -q LIBEXECDIR` 6 | pkgincludedir = `@APACHE1_APXS@ -q INCLUDEDIR`/@APREQ_LIBNAME@ 7 | 8 | if MAINTAINER_MODE 9 | 10 | APACHE1_INCLUDES = -isystem `@APACHE1_APXS@ -q INCLUDEDIR` 11 | 12 | else 13 | 14 | APACHE1_INCLUDES = -I`@APACHE1_APXS@ -q INCLUDEDIR` 15 | 16 | endif 17 | 18 | 19 | mod_apreq2_la_LDFLAGS = -export-dynamic -module -avoid-version \ 20 | `@APREQ_CONFIG@ --link-libtool --libs` @APR_LTFLAGS@ 21 | mod_apreq2_la_SOURCES = apreq_private_apache.h handle.c command.c 22 | 23 | 24 | if HAVE_APACHE1 25 | 26 | pkginclude_HEADERS = apreq_module_apache.h 27 | pkglib_LTLIBRARIES = mod_apreq2.la 28 | 29 | run_tests : t/TEST 30 | -cp -Rp .libs t 31 | MAKE=$(MAKE) @PERL@ t/TEST 32 | 33 | t/TEST : Makefile.am t/TEST.PL 34 | @PERL@ -MApache::TestMM -e '$(TEST_CONFIG_SCRIPT)' -- -apxs @APACHE1_APXS@ 35 | 36 | test :: all check run_tests 37 | 38 | test_clean : cmodules_clean 39 | -MAKE=$(MAKE) @PERL@ t/TEST -clean 40 | -rm -rf t/htdocs t/logs t/modules t/TEST t/core t/core.* t/cgi-bin/test_cgi t/cgi-bin/.libs t/.libs t/conf/extra.conf t/conf/ssl/ca t/conf/ssl/httpd-passphrase.pl 41 | 42 | cmodules_clean: 43 | -cd c-modules && $(MAKE) clean 44 | -rm c-modules/Makefile c-modules/*/Makefile c-modules/apache_httpd_test.h 45 | 46 | clean-local: test_clean 47 | 48 | 49 | install-exec-local : 50 | @echo "----------------------------------------------------------------------" 51 | @echo "Before you can use mod_apreq2, you must ensure that an appropriate" 52 | @echo "\"LoadModule\" line appears in your webserver's config file:" 53 | @echo "$(pkgcfgdir)/httpd.conf" 54 | @echo 55 | @echo "LoadModule apreq_module $(pkglibdir)/mod_apreq2.so" 56 | @echo "----------------------------------------------------------------------" 57 | 58 | endif 59 | -------------------------------------------------------------------------------- /libapreq2/docs/html/pages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: Page Index 5 | 6 | 7 | 13 | 14 | 15 |

libapreq2 Related Pages

Here is a list of all related documentation pages: 31 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /libapreq2/include/groups.dox.in: -------------------------------------------------------------------------------- 1 | /** 2 | * @mainpage 3 | * Project Website: http://httpd.apache.org/apreq/ 4 | * 5 | * @verbinclude README 6 | */ 7 | 8 | /** 9 | * @defgroup libapreq2 Apache Request Library 10 | * @brief libapreq2 Version @APREQ_DOTTED_VERSION@ 11 | * 12 | * libapreq2 is a shared library based on the Apache 13 | * Portable Runtime libraries libapr and libaprutil. 14 | * @see http://apr.apache.org/ 15 | * 16 | * @section apreq2_config Configuring libapreq2 Applications 17 | * This package includes apreq2-config, 18 | * a configuration script for building applications 19 | * with libapreq2. Run apreq2-config --help 20 | * to display its options. XXX add examples here XXX 21 | */ 22 | 23 | /** 24 | * @defgroup apreq_module Modules 25 | * @brief apreq2 modules included in @PACKAGE@-@VERSION@. 26 | * 27 | * XXX 28 | */ 29 | 30 | /** 31 | * @defgroup apreq_lang Language Bindings 32 | * @brief libapreq2 APIs for programming languages other than C 33 | * 34 | * XXX 35 | */ 36 | 37 | /** 38 | * @page apreq_license LICENSE 39 | * @verbinclude LICENSE 40 | */ 41 | 42 | /** 43 | * @page apreq_notice NOTICE 44 | * @verbinclude NOTICE 45 | */ 46 | 47 | /** 48 | * @page apreq_install INSTALL 49 | * @verbinclude INSTALL 50 | */ 51 | 52 | /** 53 | * @defgroup apreq_xs Perl 54 | * @brief XS Modules 55 | * @ingroup apreq_lang 56 | @manonly 57 | .SH "SEE ALSO" 58 | .IX Header "SEE ALSO" 59 | \&\fIapreq_xs_request\fR\|(3), \fIapreq_xs_upload\fR\|(3), \fIapreq_xs_cookie\fR\|(3) 60 | @endmanonly 61 | */ 62 | 63 | /** 64 | * @defgroup apreq_xs_request Apache2::Request 65 | * @ingroup apreq_xs 66 | * @htmlinclude Request.html 67 | */ 68 | 69 | /** 70 | * @defgroup apreq_xs_upload Apache2::Upload 71 | * @ingroup apreq_xs 72 | * @htmlinclude Upload.html 73 | */ 74 | 75 | /** 76 | * @defgroup apreq_xs_cookie Apache2::Cookie 77 | * @ingroup apreq_xs 78 | * @htmlinclude Cookie.html 79 | */ 80 | 81 | /** 82 | * @page apreq_faq FAQ 83 | * @htmlinclude FAQ.html 84 | */ 85 | -------------------------------------------------------------------------------- /libapreq2/docs/html/dir_000002.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: module/apache/ Directory Reference 5 | 6 | 7 | 13 | 14 | 15 | 17 |

apache Directory Reference

18 | 19 | 20 | 21 | 22 |

Files

file  apreq_module_apache.h [code]
23 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /libapreq2/library/t/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright 2003-2005 The Apache Software Foundation 3 | ** 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); 5 | ** you may not use this file except in compliance with the License. 6 | ** You may obtain a copy of the License at 7 | ** 8 | ** http://www.apache.org/licenses/LICENSE-2.0 9 | ** 10 | ** Unless required by applicable law or agreed to in writing, software 11 | ** distributed under the License is distributed on an "AS IS" BASIS, 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ** See the License for the specific language governing permissions and 14 | ** limitations under the License. 15 | */ 16 | 17 | #include "apreq_version.h" 18 | #include "at.h" 19 | 20 | static void version_string(dAT) 21 | { 22 | const char *vstring = apreq_version_string(); 23 | AT_not_null(vstring); 24 | AT_str_eq(vstring, APREQ_VERSION_STRING); 25 | } 26 | static void version_type(dAT) 27 | { 28 | apr_version_t v; 29 | apreq_version(&v); 30 | AT_int_eq(v.major, APREQ_MAJOR_VERSION); 31 | AT_int_eq(v.minor, APREQ_MINOR_VERSION); 32 | AT_int_eq(v.patch, APREQ_PATCH_VERSION); 33 | #ifdef APREQ_IS_DEV_VERSION 34 | AT_int_eq(v.is_dev, 1); 35 | #else 36 | AT_int_eq(v.is_dev, 0); 37 | #endif 38 | } 39 | 40 | int main(int argc, char *argv[]) 41 | { 42 | apr_pool_t *p; 43 | unsigned i, plan = 0; 44 | dAT; 45 | at_test_t test_list [] = { 46 | {"version_string", version_string, 2, "1"}, 47 | {"version_type", version_type, 4} 48 | }; 49 | 50 | apr_initialize(); 51 | atexit(apr_terminate); 52 | 53 | apr_pool_create(&p, NULL); 54 | 55 | AT = at_create(p, 0, at_report_stdout_make(p)); 56 | 57 | for (i = 0; i < sizeof(test_list) / sizeof(at_test_t); ++i) 58 | plan += test_list[i].plan; 59 | 60 | AT_begin(plan); 61 | 62 | for (i = 0; i < sizeof(test_list) / sizeof(at_test_t); ++i) 63 | AT_run(&test_list[i]); 64 | 65 | AT_end(); 66 | 67 | return 0; 68 | } 69 | -------------------------------------------------------------------------------- /libapreq2/docs/html/dir_000003.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: module/apache2/ Directory Reference 5 | 6 | 7 | 13 | 14 | 15 | 17 |

apache2 Directory Reference

18 | 19 | 20 | 21 | 22 |

Files

file  apreq_module_apache2.h [code]
23 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /m4/ax_with_apxs.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://www.gnu.org/software/autoconf-archive/ax_with_apxs.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_WITH_APXS([value-if-not-found], [path]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Locates an installed apxs binary, placing the result in the precious 12 | # variable $APXS. Accepts a preset $APXS, then --with-apxs, and failing 13 | # that searches for apxs in the given path (which defaults to the system 14 | # path). If apxs is found, $APXS is set to the full path of the binary; 15 | # otherwise it is set to VALUE-IF-NOT-FOUND, which defaults to apxs. 16 | # 17 | # Example: 18 | # 19 | # AX_WITH_APXS(missing) 20 | # 21 | # LICENSE 22 | # 23 | # Copyright (c) 2008 Dustin J. Mitchell 24 | # 25 | # Copying and distribution of this file, with or without modification, are 26 | # permitted in any medium without royalty provided the copyright notice 27 | # and this notice are preserved. This file is offered as-is, without any 28 | # warranty. 29 | 30 | #serial 10 31 | 32 | AC_DEFUN([AX_WITH_APXS], 33 | [ 34 | AC_ARG_VAR([APXS]) 35 | 36 | dnl unless APXS was supplied to us (as a precious variable) 37 | if test -z "$APXS" 38 | then 39 | AC_MSG_CHECKING(for --with-apxs) 40 | AC_ARG_WITH(apxs, 41 | AS_HELP_STRING([--with-apxs=APXS], 42 | [absolute path name of apxs executable]), 43 | [ if test "$withval" != "yes" 44 | then 45 | APXS="$withval" 46 | AC_MSG_RESULT($withval) 47 | else 48 | AC_MSG_RESULT(no) 49 | fi 50 | ], 51 | [ AC_MSG_RESULT(no) 52 | ]) 53 | fi 54 | 55 | dnl if it's still not found, check the paths, or use the fallback 56 | if test -z "$APXS" 57 | then 58 | AC_PATH_PROG([APXS], apxs, m4_ifval([$1],[$1],[apxs]), $2) 59 | fi 60 | ]) 61 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/apreq/big_input.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings FATAL => 'all'; 3 | 4 | # test the processing of variations of the key lengths and the keys 5 | # numbers 6 | 7 | use Apache::Test; 8 | use Apache::TestUtil; 9 | use Apache::TestRequest qw(GET_BODY POST_BODY); 10 | 11 | my $location = "/TestApReq__big_input"; 12 | 13 | my @key_len = (5, 100, 305); 14 | my @key_num = (5, 15, 26); 15 | my @keys = ('a'..'z'); 16 | 17 | my @big_key_len = (100, 500, 5000, 10000); 18 | my @big_key_num = (5, 15, 25); 19 | my @big_keys = ('a'..'z'); 20 | 21 | plan tests => @key_len * @key_num + @big_key_len * @big_key_num, have_lwp; 22 | 23 | 24 | # GET 25 | my $len = 0; 26 | for my $key_len (@key_len) { 27 | for my $key_num (@key_num) { 28 | my @query = (); 29 | 30 | for my $key (@keys[0..($key_num-1)]) { 31 | my $pair = "$key=" . 'd' x $key_len; 32 | $len += length $pair; 33 | push @query, $pair; 34 | } 35 | my $query = join "&", @query; 36 | $len += @query - 1; # the stick with two ends one '&' char off 37 | 38 | my $body = GET_BODY "$location?$query"; 39 | t_debug "# of keys : $key_num, key_len $key_len"; 40 | ok t_cmp($body, 41 | ( ($key_len + 3) * $key_num - 1), 42 | "GET long query"); 43 | } 44 | 45 | } 46 | 47 | # POST 48 | $len = 0; 49 | for my $big_key_len (@big_key_len) { 50 | for my $big_key_num (@big_key_num) { 51 | my @query = (); 52 | 53 | for my $big_key (@big_keys[0..($big_key_num-1)]) { 54 | my $pair = "$big_key=" . 'd' x $big_key_len; 55 | $len += length $pair; 56 | push @query, $pair; 57 | } 58 | my $query = join "&", @query; 59 | $len += @query - 1; # the stick with two ends one '&' char off 60 | 61 | my $body = POST_BODY $location, content => $query; 62 | t_debug "# of keys : $big_key_num, key_len $big_key_len"; 63 | ok t_cmp($body, 64 | ( ($big_key_len + 3) * $big_key_num - 1), 65 | "POST big data"); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /libapreq2/module/t/conf/ssl/proxyssl.conf.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #here we can test http <-> https 6 | 7 | #these are not on by default in the 1.x based mod_ssl 8 | 9 | SSLProxyEngine On 10 | 11 | SSLProxyProtocol +SSLv2 +SSLv3 +TLSv1 12 | SSLProxyCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL 13 | 14 | SSLProxyMachineCertificateFile @SSLCA@/asf/proxy/client_ok.pem 15 | #SSLProxyMachineCertificatePath @SSLCA@/asf/proxy 16 | 17 | SSLProxyCACertificateFile @SSLCA@/asf/certs/ca.crt 18 | SSLProxyCACertificatePath @ServerRoot@/conf/ssl 19 | SSLProxyCARevocationFile @SSLCA@/asf/crl/ca-bundle.crl 20 | SSLProxyVerify on 21 | SSLProxyVerifyDepth 10 22 | 23 | 24 | 25 | ProxyPass / https://@proxyssl_url@/ 26 | ProxyPassReverse / https://@proxyssl_url@/ 27 | 28 | 29 | 30 | #here we can test https <-> https 31 | 32 | SSLEngine on 33 | 34 | #these are not on by default in the 1.x based mod_ssl 35 | 36 | SSLProxyEngine On 37 | # ensure that client_ok.pem is picked first: 38 | SSLProxyMachineCertificateFile @SSLCA@/asf/proxy/client_ok.pem 39 | SSLProxyMachineCertificatePath @SSLCA@/asf/proxy 40 | SSLProxyCACertificateFile @SSLCA@/asf/certs/ca.crt 41 | SSLProxyVerify on 42 | SSLProxyCARevocationPath @SSLCA@/asf/crl 43 | 44 | 45 | 46 | ProxyPass / https://@proxyssl_url@/ 47 | ProxyPassReverse / https://@proxyssl_url@/ 48 | 49 | 50 | #here we can test https <-> http 51 | 52 | SSLEngine on 53 | 54 | ProxyPass / http://@servername@:@port@/ 55 | ProxyPassReverse / http://@servername@:@port@/ 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /libapreq2/docs/html/dir_000001.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: module/ Directory Reference 5 | 6 | 7 | 13 | 14 | 15 | 17 |

module Directory Reference

18 | 19 | 20 | 21 | 22 | 23 | 24 |

Directories

directory  apache
directory  apache2
25 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /libapreq2/module/apache2/apreq_private_apache2.h: -------------------------------------------------------------------------------- 1 | extern module AP_MODULE_DECLARE_DATA apreq_module; 2 | #define APREQ_FILTER_NAME "apreq2" 3 | 4 | struct dir_config { 5 | const char *temp_dir; 6 | apr_uint64_t read_limit; 7 | apr_size_t brigade_limit; 8 | }; 9 | 10 | /* The "warehouse", stored in r->request_config */ 11 | struct apache2_handle { 12 | apreq_handle_t handle; 13 | request_rec *r; 14 | apr_table_t *jar, *args; 15 | apr_status_t jar_status, args_status; 16 | ap_filter_t *f; 17 | }; 18 | 19 | /* Tracks the apreq filter state */ 20 | struct filter_ctx { 21 | apr_bucket_brigade *bb; /* input brigade that's passed to the parser */ 22 | apr_bucket_brigade *bbtmp; /* temporary copy of bb, destined for the spool */ 23 | apr_bucket_brigade *spool; /* copied prefetch data for downstream filters */ 24 | apreq_parser_t *parser; 25 | apreq_hook_t *hook_queue; 26 | apreq_hook_t *find_param; 27 | apr_table_t *body; 28 | apr_status_t body_status; 29 | apr_status_t filter_error; 30 | apr_uint64_t bytes_read; /* Total bytes read into this filter. */ 31 | apr_uint64_t read_limit; /* Max bytes the filter may show to parser */ 32 | apr_size_t brigade_limit; 33 | const char *temp_dir; 34 | }; 35 | 36 | apr_status_t apreq_filter_prefetch(ap_filter_t *f, apr_off_t readbytes); 37 | apr_status_t apreq_filter(ap_filter_t *f, 38 | apr_bucket_brigade *bb, 39 | ap_input_mode_t mode, 40 | apr_read_type_e block, 41 | apr_off_t readbytes); 42 | 43 | void apreq_filter_make_context(ap_filter_t *f); 44 | void apreq_filter_init_context(ap_filter_t *f); 45 | 46 | APR_INLINE 47 | static void apreq_filter_relocate(ap_filter_t *f) 48 | { 49 | request_rec *r = f->r; 50 | 51 | if (f != r->input_filters) { 52 | ap_filter_t *top = r->input_filters; 53 | ap_remove_input_filter(f); 54 | r->input_filters = f; 55 | f->next = top; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/response/TestAPI/cookie.pm: -------------------------------------------------------------------------------- 1 | package TestAPI::cookie; 2 | push our @ISA, "APR::Request::Cookie"; 3 | use strict; 4 | use warnings FATAL => 'all'; 5 | 6 | use Apache::Test; 7 | use Apache::TestUtil; 8 | 9 | use APR::Request::Cookie; 10 | use APR::Request::Apache2; 11 | use APR::Table; 12 | 13 | sub handler { 14 | my $r = shift; 15 | plan $r, tests => 30; 16 | $r->headers_in->{Cookie} = "foo=1;bar=2;foo=3;quux=4"; 17 | 18 | my $req = APR::Request::Apache2->handle($r); 19 | ok defined $req->jar; 20 | 21 | ok t_cmp $req->jar("foo"), 1, "scalar jar(foo)"; 22 | ok t_cmp $req->jar("bar"), 2, "scalar jar(bar)"; 23 | ok t_cmp $req->jar("quux"), 4, "scalar jar(quux)"; 24 | 25 | my @rv = $req->jar("foo"); 26 | ok t_cmp "@rv", "1 3", "list jar(foo)"; 27 | @rv = $req->jar("bar"); 28 | ok t_cmp "@rv", "2", "list jar(bar)"; 29 | @rv = $req->jar("quux"); 30 | ok t_cmp "@rv", "4", "list jar(quux)"; 31 | 32 | my $jar = $req->jar(); 33 | ok $jar->isa("APR::Request::Cookie::Table"); 34 | ok t_cmp $jar->{foo}, 1, '$jar->{foo} == 1'; 35 | ok t_cmp $jar->{bar}, 2, '$jar->{bar} == 2'; 36 | ok t_cmp $jar->{quux}, 4, '$jar->{quux} == 4'; 37 | 38 | my @k = qw/foo bar foo quux/; 39 | my @v = 1..4; 40 | 41 | ok t_cmp join(" ", keys %$jar), "foo bar foo quux", 'keys %$jar'; 42 | ok t_cmp join(" ", values %$jar), "1 2 3 4", 'values %$jar'; 43 | 44 | ok t_cmp join (" ", each %$jar), "$k[$_] $v[$_]", 'each %$jar: ' . $_ 45 | for 0..3; 46 | 47 | ok t_cmp join(" ", $jar->get("foo")), "1 3", '$jar->get("foo")'; 48 | 49 | ok not defined $jar->cookie_class("APR::Request::Cookie"); 50 | ok t_cmp $_->is_tainted, 1, "is tainted: $_" for values %$jar; 51 | $_->is_tainted(0) for values %$jar; 52 | ok t_cmp $_->is_tainted, 0, "not tainted: $_" for values %$jar; 53 | 54 | eval { $jar->cookie_class("APR::Request::Param") }; 55 | ok t_cmp qr/^Usage/, $@, "Bad class name"; 56 | 57 | ok t_cmp $jar->cookie_class(__PACKAGE__), "APR::Request::Cookie", "class upgrade"; 58 | ok $jar->{foo}->isa(__PACKAGE__); 59 | 60 | return 0; 61 | } 62 | 63 | 64 | 1; 65 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/response/TestAPI/param.pm: -------------------------------------------------------------------------------- 1 | package TestAPI::param; 2 | push our @ISA, "APR::Request::Param"; 3 | 4 | use strict; 5 | use warnings FATAL => 'all'; 6 | 7 | use Apache::Test; 8 | use Apache::TestUtil; 9 | 10 | use APR::Request::Param; 11 | use APR::Request::Apache2; 12 | 13 | 14 | sub handler { 15 | my $r = shift; 16 | plan $r, tests => 30; 17 | $r->args("foo=1;bar=2;foo=3;quux=4"); 18 | 19 | my $req = APR::Request::Apache2->handle($r); 20 | ok defined $req->args; 21 | ok t_cmp $req->args("foo"), 1, "scalar args(foo)"; 22 | ok t_cmp $req->args("bar"), 2, "scalar args(bar)"; 23 | ok t_cmp $req->args("quux"), 4, "scalar args(quux)"; 24 | 25 | my @rv = $req->args("foo"); 26 | ok t_cmp "@rv", "1 3", "list args(foo)"; 27 | @rv = $req->args("bar"); 28 | ok t_cmp "@rv", "2", "list args(bar)"; 29 | @rv = $req->args("quux"); 30 | ok t_cmp "@rv", "4", "list args(quux)"; 31 | 32 | my $args = $req->args(); 33 | ok $args->isa("APR::Request::Param::Table"); 34 | ok t_cmp $args->{foo}, 1, '$args->{foo} == 1'; 35 | ok t_cmp $args->{bar}, 2, '$args->{bar} == 2'; 36 | ok t_cmp $args->{quux}, 4, '$args->{quux} == 4'; 37 | 38 | my @k = qw/foo bar foo quux/; 39 | my @v = 1..4; 40 | 41 | ok t_cmp join(" ", keys %$args), "foo bar foo quux", 'keys %$args'; 42 | ok t_cmp join(" ", values %$args), "1 2 3 4", 'values %$args'; 43 | 44 | ok t_cmp join (" ", each %$args), "$k[$_] $v[$_]", 'each %$args: ' . $_ 45 | for 0..3; 46 | 47 | ok t_cmp join(" ", $args->get("foo")), "1 3", '$args->get("foo")'; 48 | 49 | ok not defined $args->param_class("APR::Request::Param"); 50 | ok t_cmp $_->is_tainted, 1, "is tainted: $_" for values %$args; 51 | $_->is_tainted(0) for values %$args; 52 | ok t_cmp $_->is_tainted, 0, "not tainted: $_" for values %$args; 53 | 54 | 55 | eval { $args->param_class("APR::Request::Cookie") }; 56 | ok t_cmp qr/^Usage/, $@, "Bad class name"; 57 | 58 | ok t_cmp $args->param_class(__PACKAGE__), "APR::Request::Param", "class upgrade"; 59 | ok $args->{foo}->isa(__PACKAGE__); 60 | 61 | return 0; 62 | } 63 | 64 | 65 | 1; 66 | -------------------------------------------------------------------------------- /libapreq2/module/t/big_request.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings FATAL => 'all'; 3 | 4 | use Apache::Test; 5 | use Apache::TestUtil; 6 | use Apache::TestConfig; 7 | use Apache::TestRequest qw(GET_BODY POST_BODY); 8 | 9 | my @key_len = (5, 100, 305); 10 | my @key_num = (5, 15, 26); 11 | my @keys = ('a'..'z'); 12 | 13 | my @big_key_len = (100, 500, 5000, 10000); 14 | my @big_key_num = (5, 15, 25); 15 | my @big_keys = ('a'..'z'); 16 | 17 | my $num_tests = @key_len * @key_num + @big_key_len * @big_key_num; 18 | $num_tests *= 2 if Apache::Test::have_ssl(); 19 | plan tests => $num_tests, have_lwp; 20 | 21 | my $location = "/apreq_big_request_test"; 22 | my $scheme = 'http'; 23 | 24 | START_TESTS: 25 | Apache::TestRequest::scheme($scheme); 26 | 27 | # GET 28 | for my $key_len (@key_len) { 29 | for my $key_num (@key_num) { 30 | my @query = (); 31 | my $len = 0; 32 | 33 | for my $key (@keys[0..($key_num-1)]) { 34 | my $pair = "$key=" . 'd' x $key_len; 35 | $len += length($pair) - 1; 36 | push @query, $pair; 37 | } 38 | my $query = join ";", @query; 39 | 40 | t_debug "# of keys : $key_num, key_len $key_len"; 41 | my $body = GET_BODY "$location?$query"; 42 | ok t_cmp($body, 43 | $len, 44 | "GET long query"); 45 | } 46 | 47 | } 48 | 49 | # POST 50 | for my $big_key_len (@big_key_len) { 51 | for my $big_key_num (@big_key_num) { 52 | my @query = (); 53 | my $len = 0; 54 | 55 | for my $big_key (@big_keys[0..($big_key_num-1)]) { 56 | my $pair = "$big_key=" . 'd' x $big_key_len; 57 | $len += length($pair) - 1; 58 | push @query, $pair; 59 | } 60 | my $query = join ";", @query; 61 | 62 | t_debug "# of keys : $big_key_num, big_key_len $big_key_len"; 63 | my $body = POST_BODY($location, content => $query); 64 | ok t_cmp($body, 65 | $len, 66 | "POST big data"); 67 | } 68 | 69 | } 70 | 71 | if (Apache::Test::have_ssl() and $scheme ne 'https') { 72 | $scheme = 'https'; 73 | goto START_TESTS; 74 | } 75 | -------------------------------------------------------------------------------- /libapreq2/docs/html/group__apreq__lang.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: Language Bindings 5 | 6 | 7 | 13 | 14 | 15 |

Language Bindings

libapreq2 APIs for programming languages other than C 16 | More... 17 | 18 | 19 | 20 | 21 | 22 | 23 |

24 |


Modules

 Perl
 XS Modules.
25 |

Detailed Description

26 | libapreq2 APIs for programming languages other than C 27 |

28 | XXX

37 | 38 | 39 | -------------------------------------------------------------------------------- /libapreq2/docs/html/globals_enum.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: Data Fields 5 | 6 | 7 | 13 | 14 | 15 | 16 | 17 |

18 |

24 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /libapreq2/docs/html/modules.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: Module Index 5 | 6 | 7 | 13 | 14 | 15 |

libapreq2 Modules

Here is a list of all modules: 31 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /libapreq2/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | errstatus=0 8 | dirmode="" 9 | 10 | usage="\ 11 | Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." 12 | 13 | # process command line arguments 14 | while test $# -gt 0 ; do 15 | case "${1}" in 16 | -h | --help | --h* ) # -h for help 17 | echo "${usage}" 1>&2; exit 0 ;; 18 | -m ) # -m PERM arg 19 | shift 20 | test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } 21 | dirmode="${1}" 22 | shift ;; 23 | -- ) shift; break ;; # stop option processing 24 | -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option 25 | * ) break ;; # first non-opt arg 26 | esac 27 | done 28 | 29 | for file 30 | do 31 | if test -d "$file"; then 32 | shift 33 | else 34 | break 35 | fi 36 | done 37 | 38 | case $# in 39 | 0) exit 0 ;; 40 | esac 41 | 42 | case $dirmode in 43 | '') 44 | if mkdir -p -- . 2>/dev/null; then 45 | echo "mkdir -p -- $*" 46 | exec mkdir -p -- "$@" 47 | fi ;; 48 | *) 49 | if mkdir -m "$dirmode" -p -- . 2>/dev/null; then 50 | echo "mkdir -m $dirmode -p -- $*" 51 | exec mkdir -m "$dirmode" -p -- "$@" 52 | fi ;; 53 | esac 54 | 55 | for file 56 | do 57 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 58 | shift 59 | 60 | pathcomp= 61 | for d 62 | do 63 | pathcomp="$pathcomp$d" 64 | case "$pathcomp" in 65 | -* ) pathcomp=./$pathcomp ;; 66 | esac 67 | 68 | if test ! -d "$pathcomp"; then 69 | echo "mkdir $pathcomp" 70 | 71 | mkdir "$pathcomp" || lasterr=$? 72 | 73 | if test ! -d "$pathcomp"; then 74 | errstatus=$lasterr 75 | else 76 | if test ! -z "$dirmode"; then 77 | echo "chmod $dirmode $pathcomp" 78 | 79 | lasterr="" 80 | chmod "$dirmode" "$pathcomp" || lasterr=$? 81 | 82 | if test ! -z "$lasterr"; then 83 | errstatus=$lasterr 84 | fi 85 | fi 86 | fi 87 | fi 88 | 89 | pathcomp="$pathcomp/" 90 | done 91 | done 92 | 93 | exit $errstatus 94 | 95 | # Local Variables: 96 | # mode: shell-script 97 | # sh-indentation: 3 98 | # End: 99 | # mkinstalldirs ends here 100 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/t/apreq/cookie.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings FATAL => 'all'; 3 | 4 | use Apache::Test; 5 | 6 | use Apache::TestUtil; 7 | use Apache::TestRequest qw(GET_BODY GET_HEAD); 8 | 9 | plan tests => 7, have_lwp;#under_construction; # have_lwp 10 | 11 | require HTTP::Cookies; 12 | 13 | my $location = "/TestApReq__cookie"; 14 | 15 | { 16 | my $test = 'new'; 17 | my $value = 'bar'; 18 | ok t_cmp(GET_BODY("$location?test=new"), 19 | $value, 20 | $test); 21 | } 22 | { 23 | my $test = 'new'; 24 | my $value = 'bar'; 25 | ok t_cmp(GET_BODY("$location?test=new;expires=%2B3M"), 26 | $value, 27 | $test); 28 | } 29 | { 30 | my $test = 'netscape'; 31 | my $key = 'apache'; 32 | my $value = 'ok'; 33 | my $cookie = qq{$key=$value}; 34 | ok t_cmp(GET_BODY("$location?test=$test&key=$key", Cookie => $cookie), 35 | $value, 36 | $test); 37 | } 38 | { 39 | my $test = 'rfc'; 40 | my $key = 'apache'; 41 | my $value = 'ok'; 42 | my $cookie = qq{\$Version="1"; $key="$value"; \$Path="$location"}; 43 | ok t_cmp(GET_BODY("$location?test=$test&key=$key", Cookie => $cookie), 44 | qq{"$value"}, 45 | $test); 46 | } 47 | { 48 | my $test = 'encoded value with space'; 49 | my $key = 'apache'; 50 | my $value = 'okie dokie'; 51 | my $cookie = "$key=" . join '', 52 | map {/ / ? '+' : sprintf '%%%.2X', ord} split //, $value; 53 | ok t_cmp(GET_BODY("$location?test=$test&key=$key", Cookie => $cookie), 54 | $value, 55 | $test); 56 | } 57 | { 58 | my $test = 'bake'; 59 | my $key = 'apache'; 60 | my $value = 'ok'; 61 | my $cookie = "$key=$value"; 62 | my ($header) = GET_HEAD("$location?test=$test&key=$key", 63 | Cookie => $cookie) =~ /^#Set-Cookie:\s+(.+)/m; 64 | 65 | ok t_cmp($header, $cookie, $test); 66 | } 67 | { 68 | my $test = 'bake2'; 69 | my $key = 'apache'; 70 | my $value = 'ok'; 71 | my $cookie = qq{\$Version="1"; $key="$value"; \$Path="$location"}; 72 | my ($header) = GET_HEAD("$location?test=$test&key=$key", 73 | Cookie => $cookie) =~ /^#Set-Cookie2:\s+(.+)/m; 74 | ok t_cmp($header, qq{$key="$value"; Version=1; path="$location"}, $test); 75 | } 76 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/APR/Request/Request.pod: -------------------------------------------------------------------------------- 1 | =head1 NAME 2 | 3 | APR::Request - wrapper for libapreq2's module/handle API. 4 | 5 | 6 | 7 | 8 | =head1 SYNOPSIS 9 | 10 | use APR::Request; 11 | 12 | my $req = $derived_class->handle( ... ); 13 | $param = $req->param("foo"); 14 | $cookie = $req->jar("bar"); 15 | 16 | 17 | =head1 DESCRIPTION 18 | 19 | The C<< APR::Request >> module provides the base methods 20 | for interfacing with libapreq2's module API. It also provides 21 | a few utility functions and constants. 22 | 23 | 24 | 25 | 26 | =head1 METHODS 27 | 28 | APR::Request 29 | 30 | 31 | =head2 jar_status 32 | 33 | 34 | =head2 args_status 35 | 36 | 37 | =head2 body_status 38 | 39 | 40 | =head2 param_status 41 | 42 | 43 | =head2 parse 44 | 45 | 46 | =head2 jar 47 | 48 | 49 | =head2 args 50 | 51 | 52 | =head2 body 53 | 54 | 55 | =head2 param 56 | 57 | 58 | =head2 uploads (APR::Request::Param::Table???) 59 | 60 | 61 | =head2 pool 62 | 63 | 64 | =head2 bucket_alloc 65 | 66 | 67 | =head2 read_limit 68 | 69 | 70 | =head2 brigade_limit 71 | 72 | 73 | =head2 temp_dir 74 | 75 | 76 | =head2 disable_uploads 77 | 78 | Engage the disable_uploads hook for this request. 79 | 80 | =head2 upload_hook 81 | 82 | 83 | =head2 import 84 | 85 | 86 | 87 | 88 | =head1 SUBROUTINES 89 | 90 | APR::Request 91 | 92 | 93 | =head2 encode 94 | 95 | 96 | =head2 decode 97 | 98 | 99 | 100 | 101 | =head1 SEE ALSO 102 | 103 | L<< APR::Request::Error >>, L<< APR::Request::Param >>, 104 | L<< APR::Request::Cookie >> 105 | 106 | 107 | 108 | 109 | =head1 COPYRIGHT 110 | 111 | Copyright 2003-2005 The Apache Software Foundation 112 | 113 | Licensed under the Apache License, Version 2.0 (the "License"); 114 | you may not use this file except in compliance with the License. 115 | You may obtain a copy of the License at 116 | 117 | http://www.apache.org/licenses/LICENSE-2.0 118 | 119 | Unless required by applicable law or agreed to in writing, software 120 | distributed under the License is distributed on an "AS IS" BASIS, 121 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 122 | See the License for the specific language governing permissions and 123 | limitations under the License. 124 | -------------------------------------------------------------------------------- /libapreq2/docs/html/group__apreq__module.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: Modules 5 | 6 | 7 | 13 | 14 | 15 |

Modules

apreq2 modules included in libapreq2-2.05-dev. 16 | More... 17 | 18 | 19 | 20 | 21 | 22 | 23 |

24 |


Modules

 Apache 2.X Filter Module
 mod_apreq2 - DSO that ties libapreq2 to Apache HTTPD 2.X.
25 |

Detailed Description

26 | apreq2 modules included in libapreq2-2.05-dev. 27 |

28 | XXX

37 | 38 | 39 | -------------------------------------------------------------------------------- /libapreq2/glue/perl/xsbuilder/maps/apreq_functions.map: -------------------------------------------------------------------------------- 1 | ########## Apache::Request:: Functions ########## 2 | #################### APR::Request stuff #################### 3 | 4 | MODULE=APR::Request PACKAGE=APR::Request PREFIX=apreq_ 5 | apreq_cp1252_to_utf8 6 | #apreq_hook_add 7 | 8 | MODULE=APR::Request::Apache2 PACKAGE=APR::Request::Apache2 PREFIX=APR__Request__Apache2_ 9 | apreq_xs_handle_apache2_t *:DEFINE_handle | apreq_handle_apache2 (r) | const char *:class, request_rec *:r 10 | 11 | MODULE=APR::Request::CGI PACKAGE=APR::Request::CGI PREFIX=APR__Request__CGI_ 12 | apreq_xs_handle_cgi_t *:DEFINE_handle | apreq_handle_cgi (p) | const char *:class, apr_pool_t *:p 13 | 14 | 15 | #################### APR::Request::Cookie stuff #################### 16 | MODULE=APR::Request::Cookie PACKAGE=APR::Request::Cookie PREFIX=apreq_cookie_ 17 | apreq_cookie_expires 18 | 19 | MODULE=APR::Request::Cookie PACKAGE=APR::Request::Cookie::Table PREFIX=APR__Request__Cookie__Table_ 20 | DEFINE_get | apreq_xs_cookie_table_FETCH | 21 | DEFINE_FETCH | apreq_xs_cookie_table_FETCH | 22 | DEFINE_NEXTKEY | apreq_xs_cookie_table_NEXTKEY | 23 | DEFINE_FIRSTKEY | apreq_xs_cookie_table_NEXTKEY | 24 | DEFINE_do | apreq_xs_cookie_table_do | 25 | 26 | 27 | #################### APR::Request::Param stuff #################### 28 | 29 | MODULE=APR::Request PACKAGE=APR::Request PREFIX=APR__Request_ 30 | DEFINE_parse | apreq_xs_parse | 31 | DEFINE_jar | apreq_xs_jar | 32 | DEFINE_args | apreq_xs_args | 33 | DEFINE_body | apreq_xs_body | 34 | DEFINE_param | apreq_xs_param | 35 | 36 | MODULE=APR::Request::Param PACKAGE=APR::Request::Param::Table PREFIX=APR__Request__Param__Table_ 37 | DEFINE_get | apreq_xs_param_table_FETCH | 38 | DEFINE_FETCH | apreq_xs_param_table_FETCH | 39 | DEFINE_NEXTKEY | apreq_xs_param_table_NEXTKEY | 40 | DEFINE_FIRSTKEY | apreq_xs_param_table_NEXTKEY | 41 | DEFINE_do | apreq_xs_param_table_do | 42 | 43 | MODULE=APR::Request::Param PACKAGE=APR::Request::Brigade PREFIX=APR__Request__Brigade_ 44 | DEFINE_new | apreq_xs_brigade_copy | 45 | DEFINE_TIEHANDLE | apreq_xs_brigade_copy | 46 | DEFINE_READ | apreq_xs_brigade_read | 47 | DEFINE_READLINE | apreq_xs_brigade_readline | 48 | 49 | MODULE=APR::Request::Param PACKAGE=APR::Request::Brigade::IO PREFIX=APR__Request__Brigade__IO_ 50 | DEFINE_read | apreq_xs_brigade_read | 51 | DEFINE_readline | apreq_xs_brigade_readline | 52 | -------------------------------------------------------------------------------- /test/useR2007.css: -------------------------------------------------------------------------------- 1 | body { 2 | font: .7em verdana, arial, sans-serif; 3 | margin-top: 10px; 4 | margin-left:10px; 5 | margin-right:10px; 6 | /* border: 1px solid black; */ 7 | } 8 | /* img { border: 1px; position: absolute; } */ 9 | * {margin:0; padding:0;} 10 | div#mainwrapper { 11 | /* min-width:760px; */ 12 | /* max-width:880px; */ 13 | margin-left:auto; 14 | margin-right:auto;} /* centers layout when > max width */ 15 | div#header { 16 | width:auto; 17 | } 18 | #threecolwrap { 19 | float:left; 20 | width:100%; 21 | } 22 | #twocolwrap { 23 | float:left; 24 | width:100%; 25 | display:inline; /* stops IE doubling margin on float*/ 26 | margin-right:-170px; /* CWS - neg margin move */ 27 | } 28 | #leftcol { 29 | float:left; 30 | width:175px; 31 | display:inline; /* stops IE doubling margin on float*/ 32 | /* border: 1px solid black; */ 33 | } 34 | #content { 35 | width:600px; 36 | margin-left:175px; 37 | margin-top: 0px; 38 | /* margin-right:170px; */ 39 | /* border: 1px solid black; */ 40 | } 41 | #rightcol { 42 | position: absolute; 43 | width:175px; 44 | margin-left: 775px; 45 | /* width:170px; */ 46 | /* width: auto;*/ 47 | /* border: 1px solid black; */ 48 | } 49 | #footer { 50 | width:100%; 51 | clear:both; 52 | float:left; 53 | text-align: right; 54 | font-size: .6em; 55 | /* border: 1px solid black; */ 56 | } 57 | div#yldiv { 58 | float:left; 59 | width:250px; 60 | display: none; 61 | } 62 | select { 63 | /* float: right; */ 64 | width: 100%; 65 | font-size: .9em; 66 | border: 1px solid grey; 67 | } 68 | div#formcontent { 69 | /*border: 1px solid black; */ 70 | 71 | } 72 | div.clearfix { 73 | /* border: 1px solid #CCC; */ 74 | margin-bottom: 10px; 75 | } 76 | label { 77 | float: left; 78 | font-size: .9em; 79 | font-weight: bold; 80 | width:100% 81 | } 82 | div#content h1,h2,h3 { 83 | text-align: center 84 | } 85 | div#content p,ul { 86 | margin: 2% 20% 2% 20%; 87 | font-size: 1.2em; 88 | } 89 | div#content li { 90 | margin-bottom: 3%; 91 | } 92 | div#showpdf { 93 | margin-left: 20px; 94 | } 95 | div#copyright { 96 | color: grey; 97 | text-align: center; 98 | font-size: .8em; 99 | margin: 10% 20% 0px 20%; 100 | } 101 | div#bibliography { 102 | margin-top: 10px; 103 | font: .8em verdana, arial, sans-serif; 104 | font-weight: bold; 105 | } 106 | -------------------------------------------------------------------------------- /libapreq2/build/doxygen.conf.in: -------------------------------------------------------------------------------- 1 | PROJECT_NAME = "@PACKAGE@" 2 | PROJECT_NUMBER = "@VERSION@" 3 | 4 | OUTPUT_DIRECTORY = docs 5 | OUTPUT_LANGUAGE = English 6 | 7 | BRIEF_MEMBER_DESC = YES 8 | REPEAT_BRIEF = YES 9 | 10 | TAB_SIZE = 8 11 | ALIASES = "req=@arg The request handle" 12 | OPTIMIZE_OUTPUT_FOR_C = YES 13 | 14 | INTERNAL_DOCS = NO 15 | 16 | GENERATE_TODOLIST = YES 17 | GENERATE_TESTLIST = YES 18 | GENERATE_BUGLIST = YES 19 | GENERATE_DEPRECATEDLIST= YES 20 | 21 | MAX_INITIALIZER_LINES = 30 22 | SHOW_USED_FILES = YES 23 | 24 | QUIET = NO 25 | WARNINGS = YES 26 | WARN_IF_UNDOCUMENTED = YES 27 | WARN_IF_DOC_ERROR = YES 28 | WARN_FORMAT = "$file:$line: $text" 29 | 30 | INPUT = . include module/apache module/apache2 31 | FILE_PATTERNS = *.h *.dox CHANGES STATUS 32 | RECURSIVE = NO 33 | EXTRACT_STATIC = YES 34 | EXCLUDE = 35 | EXCLUDE_SYMLINKS = NO 36 | EXCLUDE_PATTERNS = apreq_config* apreq_private* 37 | EXAMPLE_PATH = . 38 | EXAMPLE_PATTERNS = README INSTALL LICENSE NOTICE *.html *.man 39 | IMAGE_PATH = 40 | SOURCE_BROWSER = NO 41 | 42 | ALPHABETICAL_INDEX = NO 43 | COLS_IN_ALPHA_INDEX = 5 44 | IGNORE_PREFIX = 45 | 46 | GENERATE_HTML = YES 47 | HTML_HEADER = build/dox.head 48 | HTML_FOOTER = build/dox.foot 49 | HTML_STYLESHEET = build/dox.css 50 | HTML_ALIGN_MEMBERS = YES 51 | 52 | 53 | GENERATE_LATEX = NO 54 | GENERATE_RTF = NO 55 | GENERATE_MAN = YES 56 | MAN_LINKS = NO 57 | GENERATE_XML = NO 58 | GENERATE_AUTOGEN_DEF = NO 59 | GENERATE_PERLMOD = NO 60 | 61 | ENABLE_PREPROCESSING = YES 62 | MACRO_EXPANSION = YES 63 | EXPAND_ONLY_PREDEF = YES 64 | PREDEFINED = APREQ_DECLARE(x)=x \ 65 | APREQ_DECLARE_NONSTD(x)=x 66 | 67 | TAGFILES = docs/apr.tag=http://apr.apache.org/docs/apr \ 68 | docs/apu.tag=http://apr.apache.org/docs/apr-util 69 | GENERATE_TAGFILE = docs/apreq2.tag 70 | ALLEXTERNALS = NO 71 | EXTERNAL_GROUPS = NO 72 | PERL_PATH = @PERL@ 73 | 74 | HIDE_UNDOC_RELATIONS = YES 75 | 76 | SEARCHENGINE = NO 77 | -------------------------------------------------------------------------------- /tools/config_http.R: -------------------------------------------------------------------------------- 1 | APXS <- commandArgs(trailingOnly=TRUE)[1] 2 | HTTPD <- commandArgs(trailingOnly=TRUE)[2] 3 | options(warn=-1) 4 | NextAvailablePort <- function(){ 5 | start <- 8181 6 | while(TRUE){ 7 | if (start >= 65536) return(0) 8 | con <- try(socketConnection(port=start),silent=TRUE) 9 | if (inherits(con,'try-error')){ 10 | return(start) 11 | } 12 | close(con) 13 | start <- start + 1 14 | } 15 | } 16 | 17 | # 18 | # Variables that will get replaced in httpd.conf.in 19 | # 20 | DOCROOT <- paste(getwd(),'/test',sep='') 21 | PORT <- NextAvailablePort() 22 | BREWINSTALLED <- 'brew' %in% .packages(all.available=TRUE) 23 | 24 | unlink('test/httpd.conf') 25 | 26 | con <- file('test/httpd.conf',open='w+') 27 | lines <- readLines('test/httpd.conf.in') 28 | if (BREWINSTALLED){ 29 | lines <- append(lines,c( 30 | '\n', 31 | ' SetHandler r-script\n', 32 | ' RHandler brew::brew\n', 33 | '\n') ) 34 | } 35 | lines <- gsub('@PORT@',PORT,lines) 36 | lines <- gsub('@DOCROOT@',DOCROOT,lines) 37 | writeLines(lines,con) 38 | close(con) 39 | 40 | unlink('test/confs/load_modules') 41 | # Test if dir module is compiled into httpd 42 | if (length(grep('dir',readLines(pipe(paste(HTTPD,'-l')))))==0){ 43 | # No, we need to add it. grab LIBEXECDIR 44 | con <- file('test/confs/load_modules',open='a') 45 | libexecdir <- readLines(pipe(paste(APXS,'-q LIBEXECDIR')))[1] 46 | cat('LoadModule dir_module ',libexecdir,'/mod_dir.so\n',sep='',file=con) 47 | close(con) 48 | } else { 49 | print('mod_dir built in') 50 | } 51 | # Test if log_config module is compiled into httpd 52 | if (length(grep('log_config',readLines(pipe(paste(HTTPD,'-l')))))==0){ 53 | # No, we need to add it. grab LIBEXECDIR 54 | con <- file('test/confs/load_modules',open='a') 55 | libexecdir <- readLines(pipe(paste(APXS,'-q LIBEXECDIR')))[1] 56 | cat('LoadModule log_config_module ',libexecdir,'/mod_log_config.so\n',sep='',file=con) 57 | close(con) 58 | } else { 59 | print('mod_log_config built in') 60 | } 61 | # Test if mime module is compiled into httpd 62 | if (length(grep('mime',readLines(pipe(paste(HTTPD,'-l')))))==0){ 63 | # No, we need to add it. grab LIBEXECDIR 64 | con <- file('test/confs/load_modules',open='a') 65 | libexecdir <- readLines(pipe(paste(APXS,'-q LIBEXECDIR')))[1] 66 | cat('LoadModule mime_module ',libexecdir,'/mod_mime.so\n',sep='',file=con) 67 | close(con) 68 | } else { 69 | print('mod_mime built in') 70 | } 71 | -------------------------------------------------------------------------------- /test/brew/useR2007.css: -------------------------------------------------------------------------------- 1 | <% setContentType('text/css') %> 2 | body { 3 | font: .7em verdana, arial, sans-serif; 4 | margin-top: 10px; 5 | margin-left:10px; 6 | margin-right:10px; 7 | /* border: 1px solid black; */ 8 | } 9 | /* img { border: 1px; position: absolute; } */ 10 | * {margin:0; padding:0;} 11 | div#mainwrapper { 12 | /* min-width:760px; */ 13 | /* max-width:880px; */ 14 | margin-left:auto; 15 | margin-right:auto;} /* centers layout when > max width */ 16 | div#header { 17 | width:auto; 18 | } 19 | #threecolwrap { 20 | float:left; 21 | width:100%; 22 | } 23 | #twocolwrap { 24 | float:left; 25 | width:100%; 26 | display:inline; /* stops IE doubling margin on float*/ 27 | margin-right:-170px; /* CWS - neg margin move */ 28 | } 29 | #leftcol { 30 | float:left; 31 | width:175px; 32 | display:inline; /* stops IE doubling margin on float*/ 33 | border: 1px solid black; 34 | } 35 | #content { 36 | width:600px; 37 | margin-left:175px; 38 | margin-top: 0px; 39 | /* margin-right:170px; */ 40 | /* border: 1px solid black; */ 41 | } 42 | #rightcol { 43 | position: absolute; 44 | width:175px; 45 | margin-left: 775px; 46 | /* width:170px; */ 47 | /* width: auto;*/ 48 | /* border: 1px solid black; */ 49 | } 50 | #footer { 51 | width:100%; 52 | clear:both; 53 | float:left; 54 | text-align: right; 55 | font-size: .6em; 56 | /* border: 1px solid black; */ 57 | } 58 | div#yldiv { 59 | float:left; 60 | width:250px; 61 | display: none; 62 | } 63 | select { 64 | /* float: right; */ 65 | width: 100%; 66 | font-size: .9em; 67 | border: 1px solid grey; 68 | } 69 | div#formcontent { 70 | /*border: 1px solid black; */ 71 | 72 | } 73 | div#rightcol div.clearfix { 74 | /* border: 1px solid #CCC; */ 75 | margin-bottom: 10px; 76 | } 77 | div#rightcol form label { 78 | float: left; 79 | font-size: .9em; 80 | font-weight: bold; 81 | width:100% 82 | } 83 | div#content h1,h2,h3 { 84 | text-align: center 85 | } 86 | div#content p,ul { 87 | margin: 2% 20% 2% 20%; 88 | font-size: 1.2em; 89 | } 90 | div#content li { 91 | margin-bottom: 3%; 92 | } 93 | div#showpdf { 94 | margin-left: 20px; 95 | } 96 | div#copyright { 97 | color: grey; 98 | text-align: center; 99 | font-size: .8em; 100 | margin: 10% 20% 0px 20%; 101 | } 102 | div#bibliography { 103 | margin-top: 10px; 104 | font: .8em verdana, arial, sans-serif; 105 | font-weight: bold; 106 | } 107 | -------------------------------------------------------------------------------- /libapreq2/Makefile.PL: -------------------------------------------------------------------------------- 1 | require 5.006; 2 | use strict; 3 | use warnings; 4 | 5 | use Getopt::Long qw(GetOptions); 6 | use Config; 7 | 8 | use constant PERL_PATH => $Config{perlpath}; # XXX 9 | use constant WIN32 => ($^O =~ /Win32/); 10 | 11 | sub test_prereq { 12 | system (PERL_PATH, "build/version_check.pl", @_) == 0 13 | or warn "Please upgrade $_[0] first.\n"; 14 | } 15 | 16 | test_prereq perl => PERL_PATH; 17 | 18 | my %opts; 19 | undef @opts{qw(with-apache2-apxs with-apache1-apxs with-apache2-src 20 | with-perl with-apache2-httpd 21 | with-apr-config with-apu-config apxs)}; 22 | undef $opts{'with-apache2'} if (WIN32); 23 | 24 | my @flags = qw/enable-maintainer-mode enable-perl-glue disable-perl-glue/; 25 | my %args; 26 | # grab from @ARGV only the options that we expect 27 | GetOptions(\%args, (map "$_=s", keys %opts), @flags); 28 | 29 | $args{"with-perl"} = PERL_PATH; 30 | my $opts = ""; 31 | $opts .= "--enable-maintainer-mode " if $args{"enable-maintainer-mode"}; 32 | 33 | unless (exists $args{"disable-perl-glue"}) { 34 | $opts .= "--enable-perl-glue "; 35 | test_prereq "mod_perl"; 36 | test_prereq "Apache::Test"; 37 | test_prereq "ExtUtils::MakeMaker"; 38 | test_prereq "ExtUtils::XSBuilder"; 39 | test_prereq "Test::More"; 40 | } 41 | 42 | delete @args{@flags}; 43 | $args{"with-apache2-apxs"} = delete $args{apxs} 44 | if exists $args{apxs} and not exists $args{"with-apache2-apxs"}; 45 | 46 | $args{"with-perl-opts"} = "@ARGV" if @ARGV; 47 | 48 | if (WIN32) { 49 | require File::Basename; 50 | unless ($args{'with-apache2'}) { 51 | my @candidates = qw(with-apache2-apxs with-apache2-httpd 52 | with-apr-config with-apu-config); 53 | foreach my $opt(@candidates) { 54 | next unless $args{$opt}; 55 | (my $d = File::Basename::dirname($args{$opt})) =~ s{(\\|/)bin}{}; 56 | if (-d $d) { 57 | delete $args{$opt}; 58 | $args{'with-apache2'} = $d; 59 | last; 60 | } 61 | } 62 | } 63 | my @opts = map{qq/--$_="$args{$_}"/} keys %args; 64 | my @args = (PERL_PATH, 'win32/Configure.pl', @opts); 65 | print "@args\n"; 66 | system(@args) == 0 or die "system @args failed: $?"; 67 | } 68 | else { 69 | $opts .= join " ", map {qq/--$_="$args{$_}"/} keys %args; 70 | 71 | my $cmd = "./configure $opts"; 72 | print "$cmd\n"; 73 | exec $cmd; 74 | } 75 | -------------------------------------------------------------------------------- /libapreq2/docs/html/group__apreq__xs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: Perl 5 | 6 | 7 | 13 | 14 | 15 |

Perl
16 | 17 | [Language Bindings] 18 |

XS Modules. 19 | More... 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

Modules

 Apache2::Request
 Apache2::Upload
 Apache2::Cookie
29 |

Detailed Description

30 | XS Modules. 31 |

32 |

41 | 42 | 43 | -------------------------------------------------------------------------------- /test/AppServer.R: -------------------------------------------------------------------------------- 1 | # 2 | # A simple system for supporting many web applications 3 | # installed under BASEDIR. 4 | # 5 | # The apache config might look something like this: 6 | # 7 | # RFileHandler /var/www/rApache/AppServer.R::AppServer 8 | # 9 | # 10 | 11 | BASEDIR <- '/var/www/rApache' 12 | 13 | # The Appserver function searches the URI for a segment that matches 14 | # a directory under BASEDIR. If it exists, and a file handler.R is present, it 15 | # is sourced in a new environment and a function called handler is expected to exist. 16 | # If so, it is called and the return value is returned from AppServer(). 17 | 18 | AppServer <- function(){ 19 | 20 | setContentType('text/html') 21 | 22 | setwd(BASEDIR) 23 | 24 | #cat(SERVER$uri,file=stderr()) 25 | 26 | # First split the uri by "/", first element will always be "". 27 | uri <- strsplit(SERVER$uri,"/")[[1]][-1] 28 | 29 | # bad uri 30 | if (length(uri) == 0){ 31 | cat(paste("Empty URI",SERVER$uri),file=stderr()) 32 | return(OK) 33 | } 34 | 35 | # Find the list of dirs; we call them apps. 36 | apps <- rownames(subset(file.info(dir()), isdir==TRUE)) 37 | 38 | # No apps to consider 39 | if (length(apps) == 0){ 40 | cat(paste("Empty List of Applications for URI:",SERVER$uri),file=stderr()) 41 | return(OK) 42 | } 43 | 44 | # returns a vector of uri index positions where apps are found in uri. 45 | i <- match(apps,uri,nomatch=0) 46 | 47 | # First non-zero index position of i is our first app found 48 | appIndex <- which(i > 0)[1] 49 | 50 | # No app exists in uri 51 | if (is.na(appIndex)){ 52 | cat(paste("No Applications for URI:",SERVER$uri,"Apps:",apps),file=stderr()) 53 | return(OK) 54 | } 55 | 56 | app <- apps[appIndex] 57 | 58 | # Now we have our app, but does a "handler.R" exist? 59 | if (!file.exists(paste(app,"handler.R",sep='/'))){ 60 | cat(paste("Missing handler.R for Application:",app,'(',dir(app),')'),file=stderr()) 61 | return(OK) 62 | } 63 | 64 | uriIndex <- i[appIndex] 65 | 66 | # Yes, now set up an environment from which to operate and go for it! 67 | 68 | appURI <- paste("/",paste(uri[1:uriIndex],collapse='/'),sep='') 69 | appPathInfo <- sub(appURI,'',SERVER$uri) 70 | setwd(app) 71 | 72 | # Source the handler 73 | sys.source("handler.R",envir=environment(AppServer)) 74 | 75 | # Was a handler function created? 76 | if (exists("handler",mode="function",envir=environment(AppServer))){ 77 | return(handler(appURI,appPathInfo)) 78 | } 79 | 80 | OK 81 | } 82 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # DARWIN has to be different than everyone else 2 | # and define their autoconf $shlibpath_var to be DYLD_LIBRARY_PATH 3 | SHLIBPATH_VAR=@SHLIBPATH_VAR@ 4 | 5 | ACLOCAL_AMFLAGS = -I m4 6 | 7 | APXS=@APXS@ 8 | HTTPD=@HTTPD@ 9 | DOCROOT=@DOCROOT@ 10 | 11 | APREQ=@APREQ@ 12 | APREQ_COMPILE=@APREQ_COMPILE@ 13 | APREQ_INSTALL=@APREQ_INSTALL@ 14 | APREQ_CLEAN=@APREQ_CLEAN@ 15 | APREQ_LIB_DIR=@APREQ_LIB_DIR@ 16 | APREQ_INCLUDES=@APREQ_INCLUDES@ 17 | APREQ_LINKLD=@APREQ_LINKLD@ 18 | 19 | RPROG=@RPROG@ 20 | RPROGBATCH=R_DEFAULT_PACKAGES=NULL @RPROG@ --vanilla --no-readline --slave -f 21 | R_HOME = `$(RPROG) RHOME` 22 | R_LD_LIBRARY_PATH = $(R_HOME)/lib 23 | RINCLUDES=@RINCLUDES@ 24 | RLINKLD=@RLINKLD@ 25 | 26 | INCLUDES = $(RINCLUDES) $(APREQ_INCLUDES) 27 | LDFLAGS = $(RLINKLD) $(APREQ_LINKLD) 28 | LD_LIBRARY_PATH=$(R_LD_LIBRARY_PATH):$(APREQ_LIB_DIR) 29 | 30 | all: mod_R.so $(DOCROOT)/httpd.conf 31 | 32 | mod_R.so: .apreq-config mod_R.c mod_R.h 33 | @echo 34 | @echo Compiling mod_R 35 | @echo 36 | $(APXS) $(INCLUDES) -c mod_R.c $(LDFLAGS) 37 | 38 | .apreq-config: 39 | @echo 40 | @echo Configuring libapreq2 41 | @echo 42 | $(APREQ_COMPILE) 43 | touch .apreq-config 44 | 45 | install: all 46 | $(APXS) -i -n R mod_R.la 47 | $(APREQ_INSTALL) 48 | 49 | $(DOCROOT)/httpd.conf: $(DOCROOT)/httpd.conf.in 50 | $(RPROGBATCH) tools/config_http.R --args $(APXS) $(HTTPD) 51 | 52 | itest: all 53 | @echo 54 | @echo Point your browser to http://localhost:8181/index.html 55 | @echo 56 | $(SHLIBPATH_VAR)=$(LD_LIBRARY_PATH) R_HOME=$(R_HOME) $(HTTPD) -X -f $(DOCROOT)/httpd.conf 57 | 58 | test: all $(DOCROOT)/httpd.conf 59 | 60 | stop: all 61 | $(SHLIBPATH_VAR)=$(LD_LIBRARY_PATH) R_HOME=$(R_HOME) $(HTTPD) -X -f $(DOCROOT)/httpd.conf -k stop 62 | 63 | valgrind: all 64 | $(SHLIBPATH_VAR)=$(LD_LIBRARY_PATH) R_HOME=$(R_HOME) valgrind $(HTTPD) -X -f $(DOCROOT)/httpd.conf 65 | 66 | debug: all 67 | @echo 68 | @echo Copy/paste the following line to gdb 69 | @echo 70 | @echo run -X -f $(DOCROOT)/httpd.conf 71 | @echo 72 | $(SHLIBPATH_VAR)=$(LD_LIBRARY_PATH) R_HOME=$(R_HOME) gdb $(HTTPD) 73 | 74 | clean: 75 | rm -rf $(OBJS) core mod_R.o mod_R.so *~ .libs *.o *.slo *.lo *.la .apreq-config 76 | $(APREQ_CLEAN) 77 | 78 | distclean: clean 79 | rm -rf mod_R.h Makefile .depend .install libtool config.log config.status test/httpd.conf test/access_log test/error_log test/httpd.pid test/accept.lock* aclocal.m4 autom4te.cache libapreq2/library/t/Makefile libapreq2/config.nice libapreq2/module/apache/Makefile 80 | $(APREQ_CLEAN) 81 | -------------------------------------------------------------------------------- /libapreq2/module/t/c-modules/apreq_request_test/mod_apreq_request_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright 2003-2005 The Apache Software Foundation 3 | ** 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); 5 | ** you may not use this file except in compliance with the License. 6 | ** You may obtain a copy of the License at 7 | ** 8 | ** http://www.apache.org/licenses/LICENSE-2.0 9 | ** 10 | ** Unless required by applicable law or agreed to in writing, software 11 | ** distributed under the License is distributed on an "AS IS" BASIS, 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ** See the License for the specific language governing permissions and 14 | ** limitations under the License. 15 | */ 16 | 17 | #ifdef CONFIG_FOR_HTTPD_TEST 18 | #if CONFIG_FOR_HTTPD_TEST 19 | 20 | 21 | APREQ2_ReadLimit 500K 22 | SetHandler apreq_request_test 23 | 24 | 25 | #endif 26 | #endif 27 | 28 | #define APACHE_HTTPD_TEST_HANDLER apreq_request_test_handler 29 | 30 | #include "apache_httpd_test.h" 31 | #include "apreq_module_apache2.h" 32 | #include "httpd.h" 33 | 34 | static int dump_table(void *ctx, const char *key, const char *value) 35 | { 36 | request_rec *r = ctx; 37 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, 38 | r, "%s => %s", key, value); 39 | ap_rprintf(r, "\t%s => %s\n", key, value); 40 | return 1; 41 | } 42 | 43 | static int apreq_request_test_handler(request_rec *r) 44 | { 45 | apreq_handle_t *req; 46 | const apr_table_t *t; 47 | apr_status_t s; 48 | 49 | if (strcmp(r->handler, "apreq_request_test") != 0) 50 | return DECLINED; 51 | 52 | req = apreq_handle_apache2(r); 53 | 54 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, 55 | r, "starting apreq_request_test"); 56 | 57 | s = ap_discard_request_body(r); 58 | 59 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, s, 60 | r, "discard request body"); 61 | 62 | ap_set_content_type(r, "text/plain"); 63 | ap_rputs("ARGS:\n",r); 64 | if (apreq_args(req, &t) == APR_SUCCESS) 65 | apr_table_do(dump_table, r, t, NULL); 66 | 67 | if (apreq_body(req, &t) == APR_SUCCESS) { 68 | ap_rputs("BODY:\n",r); 69 | apr_table_do(dump_table, r, t, NULL); 70 | } 71 | 72 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, 73 | r, "finished apreq_request_test"); 74 | 75 | return OK; 76 | } 77 | 78 | APACHE_HTTPD_TEST_MODULE(apreq_request_test); 79 | -------------------------------------------------------------------------------- /libapreq2/module/apache/t/c-modules/apreq_request_test/mod_apreq_request_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright 2003-2005 The Apache Software Foundation 3 | ** 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); 5 | ** you may not use this file except in compliance with the License. 6 | ** You may obtain a copy of the License at 7 | ** 8 | ** http://www.apache.org/licenses/LICENSE-2.0 9 | ** 10 | ** Unless required by applicable law or agreed to in writing, software 11 | ** distributed under the License is distributed on an "AS IS" BASIS, 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ** See the License for the specific language governing permissions and 14 | ** limitations under the License. 15 | */ 16 | 17 | #ifdef CONFIG_FOR_HTTPD_TEST 18 | #if CONFIG_FOR_HTTPD_TEST 19 | 20 | 21 | APREQ_ReadLimit 500K 22 | SetHandler apreq_request_test 23 | 24 | 25 | #endif 26 | #endif 27 | 28 | #define APACHE_HTTPD_TEST_HANDLER apreq_request_test_handler 29 | 30 | #include "apache_httpd_test.h" 31 | #include "apreq_module_apache.h" 32 | #include "httpd.h" 33 | 34 | static int dump_table(void *ctx, const char *key, const char *value) 35 | { 36 | request_rec *r = ctx; 37 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, 38 | r, "%s => %s", key, value); 39 | ap_rprintf(r, "\t%s => %s\n", key, value); 40 | return 1; 41 | } 42 | 43 | static int apreq_request_test_handler(request_rec *r) 44 | { 45 | apreq_handle_t *req; 46 | const apr_table_t *t; 47 | apr_status_t s; 48 | 49 | if (strcmp(r->handler, "apreq_request_test") != 0) 50 | return DECLINED; 51 | 52 | req = apreq_handle_apache2(r); 53 | 54 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, 55 | r, "starting apreq_request_test"); 56 | 57 | s = ap_discard_request_body(r); 58 | 59 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, s, 60 | r, "discard request body"); 61 | 62 | ap_set_content_type(r, "text/plain"); 63 | ap_rputs("ARGS:\n",r); 64 | if (apreq_args(req, &t) == APR_SUCCESS) 65 | apr_table_do(dump_table, r, t, NULL); 66 | 67 | if (apreq_body(req, &t) == APR_SUCCESS) { 68 | ap_rputs("BODY:\n",r); 69 | apr_table_do(dump_table, r, t, NULL); 70 | } 71 | 72 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, 73 | r, "finished apreq_request_test"); 74 | 75 | return OK; 76 | } 77 | 78 | APACHE_HTTPD_TEST_MODULE(apreq_request_test); 79 | -------------------------------------------------------------------------------- /libapreq2/docs/html/globals_eval.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: Data Fields 5 | 6 | 7 | 13 | 14 | 15 | 16 | 17 |

18 |

28 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /libapreq2/build/announcement.pl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl 2 | use warnings; 3 | use strict; 4 | 5 | our($PACKAGE_NAME, $PACKAGE_TITLE, $PACKAGE_VERSION, $LIBRARY_VERSION); 6 | foreach (qw/PACKAGE_TITLE PACKAGE_NAME PACKAGE_VERSION LIBRARY_VERSION/) { 7 | no strict 'refs'; 8 | my $opt = lc; 9 | $opt =~ tr/_/-/; 10 | chomp ($$_ = `./apreq2-config --$opt`); 11 | } 12 | sub slurp { 13 | my $file_name = shift; 14 | open my $fh, "<", $file_name or die "Can't open $file_name: $!"; 15 | read $fh, my $buf, -s $fh; 16 | return wantarray ? split /\n/, $buf : $buf; 17 | } 18 | 19 | my $MAIL_FROM = shift; 20 | my $RCPT_TO = join ",\n ", map "<$_>" , 21 | qw( 22 | announce@httpd.apache.org 23 | apreq-dev@httpd.apache.org 24 | announce@perl.apache.org 25 | modperl@perl.apache.org 26 | ); 27 | 28 | my ($LICENSE_VERSION) = grep s/^\s+Version (\d\.\d),.*$/$1/, slurp "LICENSE"; 29 | my $CPAN_DATA = join "", <>; 30 | 31 | $CPAN_DATA =~ /^has entered CPAN as(.+?)\nNo action is required/ms 32 | or die "Bad CPAN message:\n$CPAN_DATA"; 33 | $CPAN_DATA = $1; 34 | 35 | my $TITLE = "$PACKAGE_TITLE Released"; 36 | 37 | my $mail_header = < 'all'; 5 | 6 | use Apache2::RequestRec; 7 | use Apache2::RequestIO; 8 | use Apache2::Request (); 9 | use Apache2::Upload; 10 | use File::Spec; 11 | require File::Basename; 12 | 13 | sub handler { 14 | my $r = shift; 15 | my $req = Apache2::Request->new($r); 16 | my $temp_dir = File::Spec->tmpdir; 17 | 18 | my $method = $req->APR::Request::args('method'); 19 | my $has_md5 = $req->APR::Request::args('has_md5'); 20 | require Digest::MD5 if $has_md5; 21 | my $upload = $req->upload(($req->upload)[0]); 22 | my $type = $upload->type; 23 | my $basename = File::Basename::basename($upload->filename); 24 | my ($data, $fh); 25 | 26 | if ($method eq 'slurp') { 27 | $upload->slurp($data); 28 | } 29 | elsif ($method eq 'fh') { 30 | read $upload->fh, $data, $upload->size; 31 | } 32 | elsif ($method eq 'tempname') { 33 | my $name = $upload->tempname; 34 | open $fh, "<", $name or die "Can't open $name: $!"; 35 | binmode $fh; 36 | read $fh, $data, $upload->size; 37 | close $fh; 38 | } 39 | elsif ($method eq 'link') { 40 | my $link_file = File::Spec->catfile($temp_dir, "linkfile"); 41 | unlink $link_file if -f $link_file; 42 | $upload->link($link_file) or die "Can't link to $link_file: $!"; 43 | open $fh, "<", $link_file or die "Can't open $link_file: $!"; 44 | binmode $fh; 45 | read $fh, $data, $upload->size; 46 | close $fh; 47 | unlink $link_file if -f $link_file; 48 | } 49 | elsif ($method eq 'io') { 50 | read $upload->io, $data, $upload->size; 51 | } 52 | else { 53 | die "unknown method: $method"; 54 | } 55 | 56 | my $temp_file = File::Spec->catfile($temp_dir, $basename); 57 | unlink $temp_file if -f $temp_file; 58 | open my $wfh, ">", $temp_file or die "Can't open $temp_file: $!"; 59 | binmode $wfh; 60 | print $wfh $data; 61 | close $wfh; 62 | my $cs = $has_md5 ? cs($temp_file) : 0; 63 | 64 | $req->content_type('text/plain'); 65 | my $size = -s $temp_file; 66 | $r->print(<new->addfile($fh)->hexdigest; 82 | close $fh; 83 | return $md5; 84 | } 85 | 86 | 1; 87 | __END__ 88 | -------------------------------------------------------------------------------- /libapreq2/docs/html/globals_type.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: Data Fields 5 | 6 | 7 | 13 | 14 | 15 | 16 | 17 |

18 |

29 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /libapreq2/docs/html/annotated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | libapreq2-2.05-dev: libapreq2: Data Structures 5 | 6 | 7 | 13 | 14 | 15 |

libapreq2 Data Structures

Here are the data structures with brief descriptions: 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
apreq_cookie_tCookie type, supporting both Netscape and RFC cookie specifications
apreq_handle_t
apreq_hook_t
apreq_module_tVtable describing the necessary environment functions
apreq_param_t
apreq_parser_t
apreq_value_tLibapreq's pre-extensible string type
24 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /rpm/rapache.spec: -------------------------------------------------------------------------------- 1 | %{!?_httpd_confdir: %{expand: %%global _httpd_confdir %%{_sysconfdir}/httpd/conf.d}} 2 | # /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4 3 | # But httpd < 2.4 was a long long time ago. 4 | %{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.modules.d}} 5 | %{!?_httpd_moddir: %{expand: %%global _httpd_moddir %%{_libdir}/httpd/modules}} 6 | 7 | Name: rapache 8 | Version: 1.2.11 9 | Release: 1%{?dist} 10 | Source0: https://github.com/jeffreyhorner/rapache/archive/v%{version}.tar.gz 11 | License: ASL 2.0 12 | Summary: The mod_R module for the Apache httpd web server 13 | URL: http://www.rapache.net 14 | BuildRequires: httpd-devel 15 | BuildRequires: libapreq2-devel 16 | BuildRequires: R-devel 17 | BuildRequires: make, gcc 18 | Requires(post): /usr/sbin/sestatus 19 | Requires(post): policycoreutils-python-utils 20 | Requires(postun): policycoreutils-python-utils 21 | Requires: httpd 22 | Requires: R-core 23 | 24 | %description 25 | rApache is a project supporting web application development using the R 26 | statistical language and environment and the Apache web server. The current 27 | release runs on UNIX/Linux and Mac OS X operating systems. 28 | 29 | %prep 30 | %setup -q 31 | 32 | %build 33 | %configure --with-apache2-apxs=%{_httpd_apxs} 34 | %make_build 35 | 36 | %install 37 | mkdir -p %{buildroot}%{_httpd_moddir} 38 | install -p .libs/mod_R.so %{buildroot}%{_httpd_moddir} 39 | mkdir -p %{buildroot}%{_httpd_modconfdir} 40 | install -p ./rpm/99-rapache.conf %{buildroot}%{_httpd_modconfdir} 41 | mkdir -p %{buildroot}%{_httpd_confdir} 42 | install -p ./rpm/00-rapache.conf %{buildroot}%{_httpd_confdir} 43 | mkdir -p %{buildroot}/var/www/html/R 44 | install -p ./rpm/test %{buildroot}%{_localstatedir}/www/html/R/ 45 | 46 | %post 47 | semanage fcontext -a -t httpd_modules_t '%{_httpd_moddir}/mod_R.so' 2>/dev/null || : 48 | restorecon -R %{_httpd_moddir} || : 49 | 50 | %postun 51 | if [ $1 -eq 0 ]; then 52 | semanage fcontext -d -t httpd_modules_t '%{_httpd_moddir}/mod_R.so' 2>/dev/null || : 53 | fi 54 | 55 | # echo "Configuring SELinux. This takes a while..." 56 | # Perhaps leave this to the sysadmin: 57 | # setsebool -P httpd_setrlimit=1 httpd_can_network_connect_db=1 httpd_can_network_connect=1 httpd_can_connect_ftp=1 httpd_can_sendmail=1 || true 58 | # Restart to load module 59 | 60 | %files 61 | %license LICENSE 62 | %doc README.md 63 | %config(noreplace) %{_httpd_confdir}/00-rapache.conf 64 | %config(noreplace) %{_httpd_modconfdir}/99-rapache.conf 65 | %{_httpd_moddir}/mod_R.so 66 | %{_localstatedir}/www/html/R 67 | 68 | %changelog 69 | * Sat Jan 11 2020 Tom Callaway - 1.2.9-1 70 | - initial Fedora spec based on upstream work 71 | -------------------------------------------------------------------------------- /libapreq2/INSTALL: -------------------------------------------------------------------------------- 1 | PREREQUISITES: 2 | 3 | Please see the PREREQUISITES file. If you are building httpd-apreq-2 4 | directly from svn, you can generate the list of prerequisites: 5 | 6 | % perl build/version_check.pl 7 | 8 | 9 | INSTRUCTIONS: 10 | 11 | FreeBSD users must substitute "gmake" for "make" below. 12 | 13 | Unix build, where libtool/automake/autoconf works: 14 | 15 | % ./configure --with-apache2-apxs=/path/to/apache2/bin/apxs 16 | % make 17 | (optional)% make test 18 | % make install 19 | 20 | 21 | Or using the CPAN/perlish way (which includes the Apache::Request and 22 | Apache::Cookie modules): 23 | 24 | % perl Makefile.PL --with-apache2-apxs=/path/to/apache2/bin/apxs 25 | % make 26 | (optional)% make test 27 | % make install 28 | 29 | Developers and other folks using httpd-apreq-2 directly from svn need to 30 | execute "./buildconf" prior to running "./configure". 31 | 32 | 33 | Alternately, here's a recipe to install mod_apreq.c as a static apache module: 34 | 35 | 1) configure httpd to add mod_apreq.c to its filter modules: 36 | 37 | % cd /path/to/httpd-2.0 38 | % CPPFLAGS=-I/path/to/httpd-apreq-2/src \ 39 | HTTPD_LDFLAGS=/path/to/httpd-apreq-2/src/libapreq2.la \ 40 | ./configure --with-module=filters:/path/to/httpd-apreq-2/env/mod_apreq.c \ 41 | ...(add usual httpd+apr options here)... 42 | 43 | 2) compile and install everything using httpd-apreq-2's build system: 44 | 45 | % cd /path/to/httpd-apreq-2 46 | % ./configure --with-apache2-src=/path/to/httpd-2.0 47 | % make 48 | (optional)% make test 49 | % make install 50 | 51 | 52 | 53 | Win32 build: 54 | C:\httpd-apreq-2> perl Makefile.PL 55 | C:\httpd-apreq-2> nmake 56 | C:\httpd-apreq-2> nmake test 57 | C:\httpd-apreq-2> nmake mod_apreq 58 | C:\httpd-apreq-2> nmake perl_glue 59 | C:\httpd-apreq-2> nmake perl_test 60 | 61 | SVN (Subversion) ACCESS 62 | 63 | Development of httpd-apreq-2 can be followed through the svn repository: 64 | 65 | $ svn checkout http://svn.apache.org/repos/asf/httpd/apreq/trunk/ httpd-apreq-2 66 | 67 | Developers with commit access must use the https protocol instead; 68 | note that, if you are compiling svn from sources, you must 69 | supply the configure script with the appropriate switch to 70 | enable ssl. 71 | 72 | Subversion sources, and binaries for some platforms, may be obtained 73 | through the home page: 74 | 75 | http://subversion.tigris.org/ 76 | 77 | Documentation on using svn is available at 78 | 79 | http://svnbook.red-bean.com/ 80 | 81 | In particular, 82 | 83 | http://svnbook.red-bean.com/en/1.0/apa.html 84 | 85 | contains a guide for users familiar with cvs. 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /libapreq2/module/t/c-modules/apreq_cookie_test/mod_apreq_cookie_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright 2003-2005 The Apache Software Foundation 3 | ** 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); 5 | ** you may not use this file except in compliance with the License. 6 | ** You may obtain a copy of the License at 7 | ** 8 | ** http://www.apache.org/licenses/LICENSE-2.0 9 | ** 10 | ** Unless required by applicable law or agreed to in writing, software 11 | ** distributed under the License is distributed on an "AS IS" BASIS, 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ** See the License for the specific language governing permissions and 14 | ** limitations under the License. 15 | */ 16 | 17 | #ifdef CONFIG_FOR_HTTPD_TEST 18 | #if CONFIG_FOR_HTTPD_TEST 19 | 20 | 21 | SetHandler apreq_cookie_test 22 | 23 | 24 | #endif 25 | #endif 26 | 27 | #define APACHE_HTTPD_TEST_HANDLER apreq_cookie_test_handler 28 | 29 | #include "apache_httpd_test.h" 30 | #include "apreq_module_apache2.h" 31 | #include "apreq_util.h" 32 | #include "httpd.h" 33 | #include 34 | 35 | 36 | static int dump_table(void *ctx, const char *key, const char *value) 37 | { 38 | request_rec *r = ctx; 39 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, 40 | r, "[%s] => [%s]", key, value); 41 | return 1; 42 | } 43 | 44 | 45 | static int apreq_cookie_test_handler(request_rec *r) 46 | { 47 | apreq_handle_t *req; 48 | apr_status_t s; 49 | const char *test, *key; 50 | apreq_cookie_t *cookie; 51 | apr_size_t size; 52 | char *dest; 53 | const apr_table_t *args; 54 | 55 | if (strcmp(r->handler, "apreq_cookie_test") != 0) 56 | return DECLINED; 57 | 58 | req = apreq_handle_apache2(r); 59 | 60 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, 61 | "starting cookie tests"); 62 | 63 | apreq_args(req, &args); 64 | 65 | apr_table_do(dump_table, r, args, NULL); 66 | 67 | test = apr_table_get(args, "test"); 68 | key = apr_table_get(args, "key"); 69 | 70 | cookie = apreq_cookie(req, key); 71 | 72 | ap_set_content_type(r, "text/plain"); 73 | 74 | if (strcmp(test, "bake") == 0) { 75 | apr_table_add(r->headers_out, "Set-Cookie", 76 | apreq_cookie_as_string(cookie, r->pool)); 77 | } 78 | else if (strcmp(test, "bake2") == 0) { 79 | apr_table_add(r->headers_out, "Set-Cookie2", 80 | apreq_cookie_as_string(cookie, r->pool)); 81 | } 82 | else { 83 | size = strlen(cookie->v.data); 84 | dest = apr_palloc(r->pool, size + 1); 85 | s = apreq_decode(dest, &size, cookie->v.data, size); 86 | if (s == APR_SUCCESS) 87 | ap_rprintf(r, "%s", dest); 88 | } 89 | 90 | return OK; 91 | } 92 | 93 | APACHE_HTTPD_TEST_MODULE(apreq_cookie_test); 94 | -------------------------------------------------------------------------------- /test/brew/useR2007.rhtml: -------------------------------------------------------------------------------- 1 | <% setContentType('text/html') %> 2 | 4 | 5 | Brewing with Rapache: useR2007 example with Hmisc 6 | 7 | 8 | 9 | 10 | 11 |

Power and Sample Size Calculations with spower from Hmisc

12 |
13 |
14 |
15 |
16 |

The following example[1] demonstrates the flexibility of spower and 17 | related functions from Hmisc. We simulate a 2-arm (350 subjects/arm) 5-year follow-up 18 | study for wich the control group's survival distribution is Weibull with 1-year 19 | survival of .95 and 3-year survival of .7. All subjects are followed at least 20 | one year, and patients enter the study with linearly increasing probability 21 | starting with zero. Assume (1) there is no chance of dropin for the first 6 22 | months, then the probability increases linearly up to .15 at 5 years; (2) there 23 | is a linearly increasing chance of dropout up to .3 at 5 years; and (3) the 24 | treatment has no effect for the first 9 months, then it has a constant effect 25 | (hazard ratio of .75). 26 |

27 |
28 | [1] Alzola CF, Harrell FE: An Introduction to S and the Hmisc and Design Libraries . Freely available electronic book. 29 |
30 |
31 |
32 |
<% brew('test/brew/useR2007plot.rhtml') %>
33 | Characteristics of control and intervention groups with a lag in the treatment effect and with non-compliance in two directions. 34 |
35 | 36 |
37 | 38 |
39 | 40 |
41 |
42 |
43 |
44 |
45 | 46 |
47 |
48 |
49 | 50 |
51 | 52 |
53 | 54 | 56 | 57 |
58 | 59 | --------------------------------------------------------------------------------