summaryrefslogtreecommitdiff
path: root/mod_php3.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-05-11 12:52:17 +0000
committerZeev Suraski <zeev@php.net>1999-05-11 12:52:17 +0000
commit24dff20afa4e04451a9cab24aa1dcc168ceb3947 (patch)
tree97fa69c4059c71997e212c58bfcc0e4fec7d0355 /mod_php3.c
parentdc5ed5a3fb392333e3bee899f84fe832fc5aae68 (diff)
downloadphp-git-24dff20afa4e04451a9cab24aa1dcc168ceb3947.tar.gz
Support POST in Apache
Diffstat (limited to 'mod_php3.c')
-rw-r--r--mod_php3.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/mod_php3.c b/mod_php3.c
index 333bbc90fa..10a9262b00 100644
--- a/mod_php3.c
+++ b/mod_php3.c
@@ -108,7 +108,22 @@ static int zend_apache_ub_write(const char *str, uint str_length)
int sapi_apache_read_post(char *buffer, uint count_bytes SLS_DC)
{
- return 0;
+ uint total_read_bytes=0, read_bytes;
+ request_rec *r = (request_rec *) SG(server_context);
+ void (*handler)(int);
+
+ handler = signal(SIGPIPE, SIG_IGN);
+ while (total_read_bytes<count_bytes) {
+ hard_timeout("Read POST information", r); /* start timeout timer */
+ read_bytes = get_client_block(r, buffer+total_read_bytes, count_bytes-total_read_bytes);
+ reset_timeout(r);
+ if (read_bytes<=0) {
+ break;
+ }
+ total_read_bytes += read_bytes;
+ }
+ signal(SIGPIPE, handler);
+ return total_read_bytes;
}