cvs commit: modperl/src/modules/perl Apache.xs

2001-06-13 Thread dougm

dougm   01/06/13 21:36:22

  Modified:.Changes
   t/net/perl api.pl
   src/modules/perl Apache.xs
  Log:
  $r-custom_response($code, undef) will now unset the current CustomResponse
  
  Revision  ChangesPath
  1.595 +3 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.594
  retrieving revision 1.595
  diff -u -r1.594 -r1.595
  --- Changes   2001/06/13 21:27:45 1.594
  +++ Changes   2001/06/14 04:36:18 1.595
  @@ -10,6 +10,9 @@
   
   =item 1.25_01-dev
   
  +$r-custom_response($code, undef) will now unset the current CustomResponse
  +[Geoffrey Young [EMAIL PROTECTED]]
  +
   fix to compile with sfio+ithreads, thanks to Joe Schaefer for the spot
   
   win32 fixes for apache 1.3.20 [Randy Kobes [EMAIL PROTECTED]]
  
  
  
  1.46  +3 -1  modperl/t/net/perl/api.pl
  
  Index: api.pl
  ===
  RCS file: /home/cvs/modperl/t/net/perl/api.pl,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- api.pl2001/05/01 17:28:41 1.45
  +++ api.pl2001/06/14 04:36:20 1.46
  @@ -20,7 +20,7 @@
   my $is_win32 = WIN32;
   $tests += 2 unless $is_win32;
   my $test_get_set = Apache-can('set_handlers')  ($tests += 4);
  -my $test_custom_response = (MODULE_MAGIC_NUMBER = 19980324)  ($tests += 2);
  +my $test_custom_response = (MODULE_MAGIC_NUMBER = 19980324)  ($tests += 4);
   my $test_dir_config = $INC{'Apache/TestDirectives.pm'}  ($tests += 9);
   
   my $i;
  @@ -217,6 +217,8 @@
   if($test_custom_response) {
   test ++$i, $r-custom_response(403, no chance) || 1;
   test ++$i, $r-custom_response(403) =~ /chance/;
  +test ++$i, $r-custom_response(403, undef) || 1;
  +test ++$i, not defined $r-custom_response(403);
   }
   
   if($test_get_set) {
  
  
  
  1.122 +11 -2 modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.121
  retrieving revision 1.122
  diff -u -r1.121 -r1.122
  --- Apache.xs 2001/05/01 17:28:37 1.121
  +++ Apache.xs 2001/06/14 04:36:21 1.122
  @@ -238,7 +238,7 @@
   }
   #endif
   
  -static char *custom_response(request_rec *r, int status, char *string)
  +static char *custom_response(request_rec *r, int status, char *string, int reset)
   {
   core_dir_config *conf = (core_dir_config *)
get_module_config(r-per_dir_config, core_module);
  @@ -254,7 +254,10 @@
   
   idx = index_of_response(status);
   retval = conf-response_code_strings[idx];
  -if (string) {
  +if (reset) {
  +conf-response_code_strings[idx] = NULL;
  +}
  +else if (string) {
conf-response_code_strings[idx] = 
((is_url(string) || (*string == '/'))  (*string != '')) ? 
pstrdup(r-pool, string) : pstrcat(r-pool, \, string, NULL);
  @@ -751,6 +754,12 @@
   Apache r
   int status
   char *string
  +   
  +CODE:
  +RETVAL = custom_response(r, status, string, ST(2) == sv_undef);
  +
  +OUTPUT:
  +RETVAL
   
   int
   satisfies(r)
  
  
  



cvs commit: modperl/src/modules/perl Apache.xs

2001-06-13 Thread dougm

dougm   01/06/13 22:26:29

  Modified:.Changes
   src/modules/perl Apache.xs
  Log:
  croak if the filehandle passed to $r-send_fd is NULL
  
  Revision  ChangesPath
  1.598 +3 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.597
  retrieving revision 1.598
  diff -u -r1.597 -r1.598
  --- Changes   2001/06/14 04:49:07 1.597
  +++ Changes   2001/06/14 05:26:27 1.598
  @@ -10,6 +10,9 @@
   
   =item 1.25_01-dev
   
  +croak if the filehandle passed to $r-send_fd is NULL, otherwise
  +apache will segfault
  +
   if PREFIX is given to Makefile.PL add it to @INC at startup
   [Philippe M . Chiasson [EMAIL PROTECTED]]
   
  
  
  
  1.123 +4 -0  modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.122
  retrieving revision 1.123
  diff -u -r1.122 -r1.123
  --- Apache.xs 2001/06/14 04:36:21 1.122
  +++ Apache.xs 2001/06/14 05:26:28 1.123
  @@ -956,6 +956,10 @@
   long length
   
   CODE:
  +if (!f) {
  +croak(send_fd: NULL filehandle 
  +  (hint: did you check the return value of open?));
  +}
   RETVAL = send_fd_length(f, r, length);
   
   OUTPUT:
  
  
  



cvs commit: modperl/src/modules/perl Apache.xs

2000-12-29 Thread dougm

dougm   00/12/29 09:10:09

  Modified:.Changes
   src/modules/perl Apache.xs
  Log:
  allow $r-finfo to be modified
  
  Revision  ChangesPath
  1.565 +2 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.564
  retrieving revision 1.565
  diff -u -r1.564 -r1.565
  --- Changes   2000/12/23 02:23:07 1.564
  +++ Changes   2000/12/29 17:10:06 1.565
  @@ -10,6 +10,8 @@
   
   =item 1.24_02-dev
   
  +allow $r-finfo to be modified
  +
   if Perl is linked with -lpthread, then httpd needs to be linked with
   -lpthread, make sure that happens with USE_DSO=1, warn if USE_APXS=1
   
  
  
  
  1.119 +17 -1 modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.118
  retrieving revision 1.119
  diff -u -r1.118 -r1.119
  --- Apache.xs 2000/12/22 20:56:24 1.118
  +++ Apache.xs 2000/12/29 17:10:08 1.119
  @@ -1906,10 +1906,26 @@
   #  struct stat finfo;/* ST_MODE set to zero if no such file */
   
   SV *
  -finfo(r)
  +finfo(r, sv_statbuf=Nullsv)
   Apache r
  +SV *sv_statbuf
   
   CODE:
  +if (sv_statbuf) {
  +if (SvROK(sv_statbuf)  SvOBJECT(SvRV(sv_statbuf))) {
  +STRLEN sz;
  +char *buf = SvPV((SV*)SvRV(sv_statbuf), sz);
  +if (sz != sizeof(r-finfo)) {
  +croak("statbuf size mismatch, got %d, wanted %d",
  +  sz, sizeof(r-finfo));
  +}
  +memcpy(r-finfo, buf, sz);
  +}
  +else {
  +croak("statbuf is not an object");
  +}
  +}
  +
   statcache = r-finfo;
   if (r-finfo.st_mode) {
laststatval = 0;
  
  
  



cvs commit: modperl/src/modules/perl Apache.xs mod_perl.h perl_config.c

2000-09-27 Thread dougm

dougm   00/09/27 16:51:35

  Modified:.Changes ToDo
   src/modules/perl Apache.xs mod_perl.h perl_config.c
  Log:
  $r-get_basic_auth_pw will default $r-auth_type to "Basic" if not
  already set
  
  $r-auth_type is now writeable, e.g. $r-auth_type("Basic")
  
  Revision  ChangesPath
  1.530 +5 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.529
  retrieving revision 1.530
  diff -u -r1.529 -r1.530
  --- Changes   2000/09/27 19:44:20 1.529
  +++ Changes   2000/09/27 23:51:28 1.530
  @@ -10,6 +10,11 @@
   
   =item 1.24_01-dev
   
  +$r-get_basic_auth_pw will default $r-auth_type to "Basic" if not
  +already set
  +
  +$r-auth_type is now writeable, e.g. $r-auth_type("Basic")
  +
   fix $r-read() so it will not block if all data has already been read
   and so that Apache will not hang during ap_discard_request_body() on
   error or redirect after all data has been read
  
  
  
  1.258 +0 -3  modperl/ToDo
  
  Index: ToDo
  ===
  RCS file: /home/cvs/modperl/ToDo,v
  retrieving revision 1.257
  retrieving revision 1.258
  diff -u -r1.257 -r1.258
  --- ToDo  2000/09/27 21:26:24 1.257
  +++ ToDo  2000/09/27 23:51:29 1.258
  @@ -138,9 +138,6 @@
   - recursion triggered by internal_redirect() called by a pushed handler
   [Ashish Goyal [EMAIL PROTECTED]]
   
  -- auth stuff segfaults if AuthType isn't set
  -[Matt Sergeant [EMAIL PROTECTED]]
  -
   - Gerald's report of Embperl/sub-request/print breakage
   
   - /perl/perl-status?sig dumps core under hpux 10.20
  
  
  
  1.111 +5 -1  modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.110
  retrieving revision 1.111
  diff -u -r1.110 -r1.111
  --- Apache.xs 2000/09/27 19:44:23 1.110
  +++ Apache.xs 2000/09/27 23:51:33 1.111
  @@ -824,8 +824,9 @@
   char *val
   
   const char *
  -auth_type(r)
  +mod_perl_auth_type(r, val=NULL)
   Apacher
  +char *val
   
   const char *
   document_root(r, ...)
  @@ -887,6 +888,9 @@
   int ret;
   
   PPCODE:
  +if (!auth_type(r)) {
  +(void)mod_perl_auth_type(r, "Basic");
  +}
   ret = get_basic_auth_pw(r, sent_pw);
   XPUSHs(sv_2mortal((SV*)newSViv(ret)));
   if(ret == OK)
  
  
  
  1.104 +1 -0  modperl/src/modules/perl/mod_perl.h
  
  Index: mod_perl.h
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.h,v
  retrieving revision 1.103
  retrieving revision 1.104
  diff -u -r1.103 -r1.104
  --- mod_perl.h2000/09/22 18:51:59 1.103
  +++ mod_perl.h2000/09/27 23:51:34 1.104
  @@ -1185,6 +1185,7 @@
   perl_require_module("Apache", s)
   
   char *mod_perl_auth_name(request_rec *r, char *val);
  +char *mod_perl_auth_type(request_rec *r, char *val);
   
   module *perl_get_module_ptr(char *name, int len);
   void *perl_merge_server_config(pool *p, void *basev, void *addv);
  
  
  
  1.106 +18 -0 modperl/src/modules/perl/perl_config.c
  
  Index: perl_config.c
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/perl_config.c,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- perl_config.c 2000/09/27 15:37:33 1.105
  +++ perl_config.c 2000/09/27 23:51:34 1.106
  @@ -158,6 +158,24 @@
   #endif
   }
   
  +char *mod_perl_auth_type(request_rec *r, char *val)
  +{
  +#ifndef WIN32 
  +core_dir_config *conf = 
  +  (core_dir_config *)get_module_config(r-per_dir_config, core_module); 
  +
  +if(val) {
  + conf-auth_type = pstrdup(r-pool, val);
  + set_module_config(r-per_dir_config, core_module, (void*)conf); 
  + MP_TRACE_g(fprintf(stderr, "mod_perl: setting auth_type to %s\n", 
conf-auth_name));
  +}
  +
  +return conf-auth_type;
  +#else
  +return (char *) auth_type(r);
  +#endif
  +}
  +
   void mod_perl_dir_env(request_rec *r, perl_dir_config *cld)
   {
   if(MP_HASENV(cld)) {
  
  
  



cvs commit: modperl/src/modules/perl Apache.xs

2000-08-31 Thread dougm

dougm   00/08/31 13:54:23

  Modified:.Changes
   src/modules/perl Apache.xs
  Log:
  avoid duplicate buffer copy in {read,get}_client_block by reading
  directly into Perl's SV buffer
  
  Revision  ChangesPath
  1.511 +3 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.510
  retrieving revision 1.511
  diff -u -r1.510 -r1.511
  --- Changes   2000/08/31 05:54:10 1.510
  +++ Changes   2000/08/31 20:54:22 1.511
  @@ -10,6 +10,9 @@
   
   =item 1.24_01-dev
   
  +avoid duplicate buffer copy in {read,get}_client_block by reading
  +directly into Perl's SV buffer
  +
   modules/request test fix
   [Ken Williams [EMAIL PROTECTED]]
   
  
  
  
  1.107 +23 -18modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.106
  retrieving revision 1.107
  diff -u -r1.106 -r1.107
  --- Apache.xs 2000/08/31 05:49:06 1.106
  +++ Apache.xs 2000/08/31 20:54:23 1.107
  @@ -940,7 +940,7 @@
   void
   read_client_block(r, buffer, bufsiz)
   Apache   r
  -char*buffer
  +SV*buffer
   int  bufsiz
   
   PREINIT:
  @@ -948,29 +948,31 @@
   int rc;
   
   PPCODE:
  -buffer = (char*)safemalloc(bufsiz);
   if ((rc = setup_client_block(r, REQUEST_CHUNKED_ERROR)) != OK) {
aplog_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r-server, 
"mod_perl: setup_client_block failed: %d", rc);
XSRETURN_UNDEF;
   }
   
  -if(should_client_block(r)) {
  - nrd = get_client_block(r, buffer, bufsiz);
  - r-read_length = 0;
  +if (should_client_block(r)) {
  +SvUPGRADE(buffer, SVt_PV);
  +SvGROW(buffer, bufsiz+1);
  +nrd = get_client_block(r, SvPVX(buffer), bufsiz);
  +r-read_length = 0;
   } 
   
   if (nrd  0) {
  - XPUSHs(sv_2mortal(newSViv((long)nrd)));
  - sv_setpvn((SV*)ST(1), buffer, nrd);
  +XPUSHs(sv_2mortal(newSViv((long)nrd)));
   #ifdef PERL_STASH_POST_DATA
  -table_set(r-subprocess_env, "POST_DATA", buffer);
  +table_set(r-subprocess_env, "POST_DATA", SvPVX(buffer));
   #endif
  -safefree(buffer);
  - SvTAINTED_on((SV*)ST(1));
  +SvCUR_set(buffer, nrd);
  +*SvEND(buffer) = '\0';
  +SvPOK_on(buffer);
  +SvTAINTED_on(buffer);
   } 
   else {
  - ST(1) = sv_undef;
  +sv_setsv(buffer, sv_undef);
   }
   
   int
  @@ -985,22 +987,25 @@
   void
   get_client_block(r, buffer, bufsiz)
   Apache   r
  -char*buffer
  +SV*buffer
   int  bufsiz
   
   PREINIT:
   long nrd = 0;
   
   PPCODE:
  -buffer = (char*)palloc(r-pool, bufsiz);
  -nrd = get_client_block(r, buffer, bufsiz);
  +SvUPGRADE(buffer, SVt_PV);
  +SvGROW(buffer, bufsiz+1);
  +nrd = get_client_block(r, SvPVX(buffer), bufsiz);
   if ( nrd  0 ) {
  - XPUSHs(sv_2mortal(newSViv((long)nrd)));
  - sv_setpvn((SV*)ST(1), buffer, nrd);
  - SvTAINTED_on((SV*)ST(1));
  +XPUSHs(sv_2mortal(newSViv((long)nrd)));
  +SvCUR_set(buffer, nrd);
  +*SvEND(buffer) = '\0';
  +SvPOK_on(buffer);
  +SvTAINTED_on(buffer);
   } 
   else {
  - ST(1) = sv_undef;
  + sv_setsv(ST(1), sv_undef);
   }
   
   int
  
  
  



cvs commit: modperl/src/modules/perl Apache.xs

2000-08-30 Thread dougm

dougm   00/08/30 20:38:37

  Modified:.Changes
   src/modules/perl Apache.xs
  Log:
  add PerlCleanupHandler to the {get,set}_handlers table
  
  Revision  ChangesPath
  1.507 +3 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.506
  retrieving revision 1.507
  diff -u -r1.506 -r1.507
  --- Changes   2000/08/15 04:35:13 1.506
  +++ Changes   2000/08/31 03:38:35 1.507
  @@ -10,6 +10,9 @@
   
   =item 1.24_01-dev
   
  +add PerlCleanupHandler to the {get,set}_handlers table,
  +thanks Geoffrey Young for the spot
  +
   fix $r-args(undef), thanks to Greg Cope for the spot
   
   quotemeta path_info in Registry regexp
  
  
  
  1.104 +1 -0  modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.103
  retrieving revision 1.104
  diff -u -r1.103 -r1.104
  --- Apache.xs 2000/08/15 19:36:32 1.103
  +++ Apache.xs 2000/08/31 03:38:36 1.104
  @@ -101,6 +101,7 @@
   {HandlerDirEntry("PerlFixupHandler", PerlFixupHandler)},
   {HandlerDirEntry("PerlHandler", PerlHandler)},
   {HandlerDirEntry("PerlLogHandler", PerlLogHandler)},
  +{HandlerDirEntry("PerlCleanupHandler", PerlCleanupHandler)},
   { FALSE, NULL }
   };
   
  
  
  



cvs commit: modperl/src/modules/perl Apache.xs

2000-08-30 Thread dougm

dougm   00/08/30 20:39:45

  Modified:.Changes
   src/modules/perl Apache.xs
  Log:
  fix refcnt bug in $r-get_handlers
  
  Revision  ChangesPath
  1.508 +3 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.507
  retrieving revision 1.508
  diff -u -r1.507 -r1.508
  --- Changes   2000/08/31 03:38:35 1.507
  +++ Changes   2000/08/31 03:39:44 1.508
  @@ -10,6 +10,9 @@
   
   =item 1.24_01-dev
   
  +fix refcnt bug in $r-get_handlers,
  +thanks Geoffrey Young for the spot
  +
   add PerlCleanupHandler to the {get,set}_handlers table,
   thanks Geoffrey Young for the spot
   
  
  
  
  1.105 +1 -1  modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.104
  retrieving revision 1.105
  diff -u -r1.104 -r1.105
  --- Apache.xs 2000/08/31 03:38:36 1.104
  +++ Apache.xs 2000/08/31 03:39:45 1.105
  @@ -130,7 +130,7 @@
   base = (AV*)SvRV(*svp);
   for(i=0; i=AvFILL(base); i++) { 
SV *sv = *av_fetch(base, i, FALSE);
  - av_push(*dest, sv);
  + av_push(*dest, SvREFCNT_inc(sv));
   }
   }
   
  
  
  



cvs commit: modperl/src/modules/perl Apache.xs

2000-08-30 Thread dougm

dougm   00/08/30 22:49:07

  Modified:.Changes
   Apache   Apache.pm
   src/modules/perl Apache.xs
  Log:
  switch usage of hard_timeout() to soft_timeout()
  
  Revision  ChangesPath
  1.509 +4 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.508
  retrieving revision 1.509
  diff -u -r1.508 -r1.509
  --- Changes   2000/08/31 03:39:44 1.508
  +++ Changes   2000/08/31 05:49:04 1.509
  @@ -10,6 +10,10 @@
   
   =item 1.24_01-dev
   
  +switch usage of hard_timeout() to soft_timeout(), so if SIGALRM
  +happens during Apache::{print,read}, the script will continue run,
  +allowing proper cleanup (e.g. DESTROY)
  +
   fix refcnt bug in $r-get_handlers,
   thanks Geoffrey Young for the spot
   
  
  
  
  1.53  +4 -4  modperl/Apache/Apache.pm
  
  Index: Apache.pm
  ===
  RCS file: /home/cvs/modperl/Apache/Apache.pm,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- Apache.pm 2000/08/15 04:35:13 1.52
  +++ Apache.pm 2000/08/31 05:49:05 1.53
  @@ -68,7 +68,7 @@
   $_[1] ||= "";
   #$_[1] = " " x $bufsiz unless defined $_[1]; #XXX?
   
  -$r-hard_timeout("Apache-read");
  +$r-soft_timeout("Apache-read");
   
   while($bufsiz) {
$nrd = $r-read_client_block($buf, $bufsiz) || 0;
  @@ -113,7 +113,7 @@
return 0;
   }
   
  -$r-hard_timeout("Apache-read");
  +$r-soft_timeout("Apache-read");
   
   while($bufsiz) {
$nrd = $r-get_client_block($buf, $bufsiz) || 0;
  @@ -425,7 +425,7 @@
   looping until it gets all of C$bytes_to_read or a timeout happens.
   
   In addition, this method sets a timeout before reading with
  -C$r-Egthard_timeout.
  +C$r-Egtsoft_timeout.
   
   =item $r-get_remote_host
   
  @@ -909,7 +909,7 @@
   =item $r-print( @list )
   
   This method sends data to the client with C$r-Egtwrite_client, but first
  -sets a timeout before sending with C$r-Egthard_timeout. This method is
  +sets a timeout before sending with C$r-Egtsoft_timeout. This method is
   called instead of CORE::print when you use print() in your mod_perl programs.
   
   This method treats scalar references specially. If an item in @list is a
  
  
  
  1.106 +1 -1  modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- Apache.xs 2000/08/31 03:39:45 1.105
  +++ Apache.xs 2000/08/31 05:49:06 1.106
  @@ -1033,7 +1033,7 @@
   }
   else {
CV *cv = GvCV(gv_fetchpv("Apache::write_client", FALSE, SVt_PVCV));
  - hard_timeout("mod_perl: Apache-print", r);
  + soft_timeout("mod_perl: Apache-print", r);
PUSHMARK(mark);
   #ifdef PERL_OBJECT
(void)(*CvXSUB(cv))(cv, pPerl); /* Apache::write_client; */
  
  
  



Re: cvs commit: modperl/src/modules/perl Apache.xs

2000-08-15 Thread Doug MacEachern

On Mon, 14 Aug 2000, brian moseley wrote:

 On 15 Aug 2000 [EMAIL PROTECTED] wrote:
 
Log:
fix $r-args(undef)
 
 speaking of which... does $r-args handle multiple args with
 the same name correctly? the docs imply that it doesn't. i
 haven't tried it myself to see.

what do you mean?  args in or out?  $r-args($string) just does a blind
copy.  @args = $r-args just splits on ,=, it's up to the caller to deal
with multiple args of the same name.
 
 if i'm using Apache::Request, does setting a param get
 translated back down into $r-args? prolly not huh.

nope.
 
 i recently had the situation in webmail where i had to
 unescape, utf8-encode, and re-escape each param value, and
 then reformulate the query string. would have been cool if i
 could have just stepped through $r-param and set the values
 for each param, and then used $r-args at the very end.

yeah, i think i had to do something like that in webmail/calendar, there
might even be a comment like #should add something like this to libapreq
just haven't got around to it yet ;-/




Re: cvs commit: modperl/src/modules/perl Apache.xs

2000-08-15 Thread brian moseley

On Tue, 15 Aug 2000, Doug MacEachern wrote:

 what do you mean?  args in or out?  $r-args($string)
 just does a blind copy.  @args = $r-args just splits on
 ,=, it's up to the caller to deal with multiple args of
 the same name.

hm. what about %args = $r-args? won't that give me only the
last arg value? i suppose i should just do @args = $r-args.
thanks for the reminder.




Re: cvs commit: modperl/src/modules/perl Apache.xs

2000-08-15 Thread Doug MacEachern

On Tue, 15 Aug 2000, brian moseley wrote:
 
 hm. what about %args = $r-args? won't that give me only the
 last arg value? i suppose i should just do @args = $r-args.
 thanks for the reminder.

yeah.




Re: cvs commit: modperl/src/modules/perl Apache.xs

2000-08-15 Thread Ask Bjoern Hansen

On Tue, 15 Aug 2000, brian moseley wrote:

 On Tue, 15 Aug 2000, Doug MacEachern wrote:
 
  what do you mean?  args in or out?  $r-args($string)
  just does a blind copy.  @args = $r-args just splits on
  ,=, it's up to the caller to deal with multiple args of
  the same name.
 
 hm. what about %args = $r-args? won't that give me only the
 last arg value?

then the caller isn't dealing with it. ;-) (or he is, but as you
said ...)

 i suppose i should just do @args = $r-args. thanks for the
 reminder.


 - ask

-- 
ask bjoern hansen - http://www.netcetera.dk/~ask/
more than 70M impressions per day, http://valueclick.com




cvs commit: modperl/src/modules/perl Apache.xs

2000-08-14 Thread dougm

dougm   00/08/14 21:35:14

  Modified:.Changes
   Apache   Apache.pm
   src/modules/perl Apache.xs
  Log:
  fix $r-args(undef)
  
  Revision  ChangesPath
  1.506 +2 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.505
  retrieving revision 1.506
  diff -u -r1.505 -r1.506
  --- Changes   2000/08/10 02:33:19 1.505
  +++ Changes   2000/08/15 04:35:13 1.506
  @@ -10,6 +10,8 @@
   
   =item 1.24_01-dev
   
  +fix $r-args(undef), thanks to Greg Cope for the spot
  +
   quotemeta path_info in Registry regexp
   [Tobias Hoellrich [EMAIL PROTECTED]]
   
  
  
  
  1.52  +1 -1  modperl/Apache/Apache.pm
  
  Index: Apache.pm
  ===
  RCS file: /home/cvs/modperl/Apache/Apache.pm,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- Apache.pm 2000/06/15 08:13:36 1.51
  +++ Apache.pm 2000/08/15 04:35:13 1.52
  @@ -55,7 +55,7 @@
   sub args {
   my($r, $val) = @_;
   parse_args(wantarray, 
  -$val ? $r-query_string($val) : $r-query_string);
  +@_  1 ? $r-query_string($val) : $r-query_string);
   }
   
   *READ = \read unless defined READ;
  
  
  
  1.102 +7 -10 modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.101
  retrieving revision 1.102
  diff -u -r1.101 -r1.102
  --- Apache.xs 2000/08/10 02:33:21 1.101
  +++ Apache.xs 2000/08/15 04:35:14 1.102
  @@ -1888,21 +1888,18 @@
   OUTPUT:
   RETVAL
   
  -void
  +char *
   query_string(r, ...)
   Apache   r
   
  -PREINIT:
  -SV *sv = sv_newmortal();
  +CODE:
  +get_set_PVp(r-args,r-pool);
   
  -PPCODE: 
  -if(r-args)
  - sv_setpv(sv, r-args);
  -SvTAINTED_on(sv);
  -XPUSHs(sv);
  +OUTPUT:
  +RETVAL
   
  -if(items  1)
  -r-args = pstrdup(r-pool, (char *)SvPV(ST(1),na));
  +CLEANUP:
  +if (ST(0) != sv_undef) SvTAINTED_on(ST(0));
   
   #  /* Various other config info which may change with .htaccess files
   #   * These are config vectors, with one void* pointer for each module
  
  
  



Re: cvs commit: modperl/src/modules/perl Apache.xs

2000-08-14 Thread brian moseley

On 15 Aug 2000 [EMAIL PROTECTED] wrote:

   Log:
   fix $r-args(undef)

speaking of which... does $r-args handle multiple args with
the same name correctly? the docs imply that it doesn't. i
haven't tried it myself to see.

if i'm using Apache::Request, does setting a param get
translated back down into $r-args? prolly not huh.

i recently had the situation in webmail where i had to
unescape, utf8-encode, and re-escape each param value, and
then reformulate the query string. would have been cool if i
could have just stepped through $r-param and set the values
for each param, and then used $r-args at the very end.




cvs commit: modperl/src/modules/perl Apache.xs

2000-08-09 Thread ask

ask 00/08/09 18:45:39

  Modified:.Changes
   src/modules/perl Apache.xs
  Log:
  bug with Apache::print not dereferencing scalar referencess that are
  of type SVt_PVIV.
  Submitted by: T.J. Mather [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.504 +3 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.503
  retrieving revision 1.504
  diff -u -r1.503 -r1.504
  --- Changes   2000/08/02 15:53:11 1.503
  +++ Changes   2000/08/10 01:45:38 1.504
  @@ -10,6 +10,9 @@
   
   =item 1.24_01-dev
   
  +fixed bug with Apache::print not dereferencing scalar referencess that
  +are of type SVt_PVIV. [ T.J. Mather [EMAIL PROTECTED] / Ask ]
  +
   quotemeta path_info in Registry regexp
   [Tobias Hoellrich [EMAIL PROTECTED]]
   
  
  
  
  1.100 +2 -1  modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.99
  retrieving revision 1.100
  diff -u -r1.99 -r1.100
  --- Apache.xs 2000/07/25 17:59:48 1.99
  +++ Apache.xs 2000/08/10 01:45:39 1.100
  @@ -1080,7 +1080,8 @@
   
   for(i = 1; i = items - 1; i++) {
int sent = 0;
  -SV *sv = SvROK(ST(i))  (SvTYPE(SvRV(ST(i))) == SVt_PV) ?
  +SV *sv = SvROK(ST(i))  (SvTYPE(SvRV(ST(i))) == SVt_PV
  +|| SvTYPE(SvRV(ST(i))) == SVt_PVIV) ?
(SV*)SvRV(ST(i)) : ST(i);
buffer = SvPV(sv, len);
   #ifdef APACHE_SSL
  
  
  



cvs commit: modperl/src/modules/perl Apache.xs

2000-07-25 Thread cholet

cholet  00/07/25 10:59:49

  Modified:.Changes
   src/modules/perl Apache.xs
  Log:
  return code from stat() call was being ignored
  
  Revision  ChangesPath
  1.502 +3 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.501
  retrieving revision 1.502
  diff -u -r1.501 -r1.502
  --- Changes   2000/07/24 13:22:50 1.501
  +++ Changes   2000/07/25 17:59:45 1.502
  @@ -10,6 +10,9 @@
   
   =item 1.24_01-dev
   
  +flush r-finfo cache if r-filename fails
  +[Roger Espel Llima [EMAIL PROTECTED]]
  +
   fix per-dir merging of PerlSetupEnv [Eric Cholet [EMAIL PROTECTED]]
   
   INSTALL.raven update [Adam Qualset [EMAIL PROTECTED]]
  
  
  
  1.99  +3 -1  modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  --- Apache.xs 2000/06/05 18:18:49 1.98
  +++ Apache.xs 2000/07/25 17:59:48 1.99
  @@ -1870,7 +1870,9 @@
   get_set_PVp(r-filename,r-pool);
   #ifndef WIN32
   if(items  1)
  - stat(r-filename, r-finfo);
  + if ((laststatval = stat(r-filename, r-finfo))  0) {
  +r-finfo.st_mode = 0;
  + }
   #endif
   
   OUTPUT:
  
  
  



cvs commit: modperl/src/modules/perl Apache.xs

2000-06-05 Thread dougm

dougm   00/06/05 11:18:54

  Modified:.Changes
   src/modules/perl Apache.xs
  Log:
  fix $r-bytes_sent($bytes)
  
  Revision  ChangesPath
  1.498 +2 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.497
  retrieving revision 1.498
  diff -u -r1.497 -r1.498
  --- Changes   2000/06/05 18:16:23 1.497
  +++ Changes   2000/06/05 18:18:48 1.498
  @@ -10,6 +10,8 @@
   
   =item 1.24_01-dev
   
  +fix $r-bytes_sent($bytes)
  +
   support version parsing of 1.3.13-dev's httpd.h
   
   fix for 'sub handler : method {}' support when method is not found
  
  
  
  1.98  +4 -2  modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.97
  retrieving revision 1.98
  diff -u -r1.97 -r1.98
  --- Apache.xs 2000/05/23 18:15:46 1.97
  +++ Apache.xs 2000/06/05 18:18:49 1.98
  @@ -1507,8 +1507,10 @@
   
   RETVAL = last-bytes_sent;
   
  -if(items  1)
  -r-bytes_sent = (long)SvIV(ST(1));
  +if(items  1) {
  +long nbytes = last-bytes_sent = (long)SvIV(ST(1));
  +ap_bsetopt(last-connection-client, BO_BYTECT, nbytes);
  +}
   
   OUTPUT:
   RETVAL