Skip to content

Commit

Permalink
Merge pull request #24 from mpokrywka/master
Browse files Browse the repository at this point in the history
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 a931beb
Show file tree
Hide file tree
Showing 3 changed files with 337 additions and 314 deletions.
16 changes: 10 additions & 6 deletions README
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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) http://www.railsillustrated.com/screencast-file-uploads-progress-in-rails-passenger.html (tutorial with screencast using prototype)


To install and activate module: To install and activate module:
apxs2 -c -i -a mod_upload_progress.c apxs2 -c -i -a mod_upload_progress.c


-c -> compile -c -> compile
-i -> install (copy upload_progress_module.so to apache lib folder) -i -> install (copy upload_progress_module.so to apache lib folder)
-a -> activate (add LoadModule line to httpd.conf) -a -> activate (add LoadModule line to httpd.conf)


To compile it on mac you may need to: 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: Global config:
you can define maximum size for shared memory (default is 50kB): you can define maximum size for shared memory (default is 50kB):
Expand All @@ -24,7 +24,7 @@ Note:
If you get "(12)Cannot allocate memory: Upload Progress cache: could not create shared memory segment Configuration Failed" 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. error you should try to set memory size to smaller value.


Config for vhost: Config for vhost (or global locations):
<Location /> <Location />
# enable tracking uploads in / # enable tracking uploads in /
TrackUploads On TrackUploads On
Expand Down Expand Up @@ -56,3 +56,7 @@ Config for vhost:


Would return the JSON data: Would return the JSON data:
{ "state" : "uploading", "received" : 35587, "size" : 716595, "speed" : 35587, "started_at": 1296568823, "uuid" : "12345678" } { "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 ._$
18 changes: 18 additions & 0 deletions apr_shm_remove.h → ap_backports.h
Original file line number Original file line Diff line number Diff line change
@@ -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 * The following is a patch ported from mod_fcgid for Apache 2.0 releases
* which don't provide a version of apr_shm_remove. * which don't provide a version of apr_shm_remove.
Expand All @@ -8,6 +23,7 @@
*/ */
/* BEGIN OF PATCH ---------------------------------------------------------- */ /* BEGIN OF PATCH ---------------------------------------------------------- */
/* apr version 0.x not support apr_shm_remove, I have to copy it from apr version 1.x */ /* 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 #if APR_HAS_SHARED_MEMORY


Expand Down Expand Up @@ -102,3 +118,5 @@ static apr_status_t modup_backport_apr_shm_remove(const char *filename, apr_pool
/* END OF PATCH ------------------------------------------------------------ */ /* END OF PATCH ------------------------------------------------------------ */


#endif #endif
/* (APR_MAJOR_VERSION < 1) */
#endif
Loading

0 comments on commit a931beb

Please sign in to comment.