stas 2003/01/16 18:26:32
Modified: . Changes
xs/Apache/Response Apache__Response.h
xs/tables/current/ModPerl FunctionTable.pm
Log:
fix segfault in send_http_header when it's called before the response
phase
Revision Changes Path
1.102 +3 -0 modperl-2.0/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/modperl-2.0/Changes,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -r1.101 -r1.102
--- Changes 16 Jan 2003 02:38:09 -0000 1.101
+++ Changes 17 Jan 2003 02:26:31 -0000 1.102
@@ -10,6 +10,9 @@
=item 1.99_09-dev
+fix segfault in send_http_header when it's called before the response
+phase [Stas]
+
input stream filtering support was added + tests (plus renaming filter
tests so we can know from the test name what kind of filter is tested)
[Stas]
1.8 +11 -2 modperl-2.0/xs/Apache/Response/Apache__Response.h
Index: Apache__Response.h
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/Apache/Response/Apache__Response.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Apache__Response.h 19 May 2002 23:01:12 -0000 1.7
+++ Apache__Response.h 17 Jan 2003 02:26:31 -0000 1.8
@@ -15,7 +15,8 @@
/* XXX: should only be part of Apache::compat */
static MP_INLINE void
-mpxs_Apache__RequestRec_send_http_header(request_rec *r, const char *type)
+mpxs_Apache__RequestRec_send_http_header(pTHX_ request_rec *r,
+ const char *type)
{
MP_dRCFG;
@@ -23,7 +24,15 @@
ap_set_content_type(r, apr_pstrdup(r->pool, type));
}
- rcfg->wbucket->header_parse = 0; /* turn off PerlOptions +ParseHeaders */
+ if (rcfg->wbucket) {
+ /* turn off PerlOptions +ParseHeaders */
+ rcfg->wbucket->header_parse = 0;
+ }
+ else {
+ /* the response is not initialized yet */
+ Perl_croak(aTHX_ "send_http_header() can't be called before "
+ "the response phase");
+ }
}
static MP_INLINE void
1.95 +4 -0 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
Index: FunctionTable.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -r1.94 -r1.95
--- FunctionTable.pm 15 Jan 2003 06:07:10 -0000 1.94
+++ FunctionTable.pm 17 Jan 2003 02:26:32 -0000 1.95
@@ -5370,6 +5370,10 @@
'name' => 'mpxs_Apache__RequestRec_send_http_header',
'args' => [
{
+ 'type' => 'PerlInterpreter *',
+ 'name' => 'my_perl'
+ },
+ {
'type' => 'request_rec *',
'name' => 'r'
},