Permalink
Browse files

Merge pull request #24 from mpokrywka/master

Lotsastuff: My earlier changes, BenBE's changes, julthomas' fixes

I've reviewed your patches and there are no obvious issues for which I'd reject them; though there are some minor tweaks that might be applied later.

There are some patches with lines I'm not fully sure about, so be sure to check things on the mentioned commits for further comments.

There was no immediate problem that would recommend not merging certain changes but be vary there are some some uncertainties involved which should be rechecked.
  • Loading branch information...
BenBE committed Jul 15, 2011
2 parents c7b11f5 + 6e7b62d commit a931bebb1a78ab02f40afb3cc902c0d99f96f350
Showing with 337 additions and 314 deletions.
  1. +10 −6 README
  2. +18 −0 apr_shm_remove.h → ap_backports.h
  3. +309 −308 mod_upload_progress.c
View
16 README
@@ -7,14 +7,14 @@ http://www.drogomir.com/blog/2008/7/3/tweaking-rails-app-with-jquery-part-i (usi
http://www.railsillustrated.com/screencast-file-uploads-progress-in-rails-passenger.html (tutorial with screencast using prototype)
To install and activate module:
-apxs2 -c -i -a mod_upload_progress.c
+ apxs2 -c -i -a mod_upload_progress.c
--c -> compile
--i -> install (copy upload_progress_module.so to apache lib folder)
--a -> activate (add LoadModule line to httpd.conf)
+ -c -> compile
+ -i -> install (copy upload_progress_module.so to apache lib folder)
+ -a -> activate (add LoadModule line to httpd.conf)
To compile it on mac you may need to:
-sudo apxs -c -i -Wc,-arch -Wc,ppc7400 -Wl,-arch -Wl,ppc7400 -Wc,-arch -Wc,ppc64 -Wl,-arch -Wl,ppc64 -Wc,-arch -Wc,x86_64 -Wl,-arch -Wl,x86_64 -Wc,-arch -Wc,i386 -Wl,-arch -Wl,i386 mod_upload_progress.c
+ sudo apxs -c -i -Wc,-arch -Wc,ppc7400 -Wl,-arch -Wl,ppc7400 -Wc,-arch -Wc,ppc64 -Wl,-arch -Wl,ppc64 -Wc,-arch -Wc,x86_64 -Wl,-arch -Wl,x86_64 -Wc,-arch -Wc,i386 -Wl,-arch -Wl,i386 mod_upload_progress.c
Global config:
you can define maximum size for shared memory (default is 50kB):
@@ -24,7 +24,7 @@ Note:
If you get "(12)Cannot allocate memory: Upload Progress cache: could not create shared memory segment Configuration Failed"
error you should try to set memory size to smaller value.
-Config for vhost:
+Config for vhost (or global locations):
<Location />
# enable tracking uploads in /
TrackUploads On
@@ -56,3 +56,7 @@ Config for vhost:
Would return the JSON data:
{ "state" : "uploading", "received" : 35587, "size" : 716595, "speed" : 35587, "started_at": 1296568823, "uuid" : "12345678" }
+
+- Valid JSON-P callbacks
+ Callback names are now validated: length must be within 1..64 characters
+ identifier may contain alphanumeric characters and also ._$
@@ -1,3 +1,18 @@
+/**
+ * This macro is not present in Apache HTTP server version 2.2.3
+ * Red-Hat 5 / CentOS 5
+ */
+#ifndef ap_is_HTTP_VALID_RESPONSE
+# define ap_is_HTTP_VALID_RESPONSE(x) (((x) >= 100)&&((x) < 600))
+#endif
+
+/*
+ * apr_time_from_msec is defined in APR 1.4.0 or later
+ */
+#if (APR_MAJOR_VERSION < 1) || ((APR_MAJOR_VERSION == 1) && (APR_MINOR_VERSION < 4))
+#define apr_time_from_msec(x) (x * 1000)
+#endif
+
/*
* The following is a patch ported from mod_fcgid for Apache 2.0 releases
* which don't provide a version of apr_shm_remove.
@@ -8,6 +23,7 @@
*/
/* BEGIN OF PATCH ---------------------------------------------------------- */
/* apr version 0.x not support apr_shm_remove, I have to copy it from apr version 1.x */
+#if (APR_MAJOR_VERSION < 1)
#if APR_HAS_SHARED_MEMORY
@@ -102,3 +118,5 @@ static apr_status_t modup_backport_apr_shm_remove(const char *filename, apr_pool
/* END OF PATCH ------------------------------------------------------------ */
#endif
+/* (APR_MAJOR_VERSION < 1) */
+#endif
Oops, something went wrong.

0 comments on commit a931beb

Please sign in to comment.