You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by Jay Buffington <ja...@mlug.missouri.edu> on 2003/06/24 18:03:27 UTC

TEMP_DIR directive

Hi,

If I hardcode in a directory for TEMP_DIR like this everything works 
fine:
my $apr = Apache::Request->instance($r, HOOK_DATA=>$key,
                                                                         
     UPLOAD_HOOK=>$upload_hook,
                                                                         
     TEMP_DIR=>"/usr/local/shoebox/images/tmp/");


But if I use dir_config like this:
$r->log_error("setting tempdir to " . $r->dir_config('tempdir'));
my $apr = Apache::Request->instance($r, HOOK_DATA=>$key,
                                                                         
     UPLOAD_HOOK=>$upload_hook,
                                                                         
     TEMP_DIR=>$r->dir_config('tempdir'));

I get this in my error log:
[Tue Jun 24 10:55:23 2003] [error] setting tempdir to 
/usr/local/shoebox/images/tmp/
[Tue Jun 24 10:55:23 2003] [error] [client 192.168.0.100] [libapreq] 
could not create/open temp file


What gives?!

Thanks,
Jay Buffington


Re: TEMP_DIR directive

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Joe Schaefer <jo...@sunstarsys.com> writes:

[...]

> -                RETVAL->temp_dir = (char *)SvPV(ST(i+1), PL_na);
> +                RETVAL->temp_dir = apr_pstrdup(r->pool,SvPV(ST(i+1), PL_na));
                                        ^
                                        ^

OOPS, typo- drop the "r". It's called ap_pstrdup in apache-1.3.

-- 
Joe Schaefer


Re: TEMP_DIR directive

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Jay Buffington <ja...@mlug.missouri.edu> writes:

[...]

> What gives?!

It's a bug in Request.xs: line 316. See if this patch fixes it:

Index: Request/Request.xs
===================================================================
RCS file: /home/cvs/httpd-apreq/Request/Request.xs,v
retrieving revision 1.35
diff -u -r1.35 Request.xs
--- Request/Request.xs  14 Apr 2003 02:45:24 -0000      1.35
+++ Request/Request.xs  25 Jun 2003 00:25:17 -0000
@@ -313,7 +313,7 @@

           case 't':
             if (strcaseEQ(key, "temp_dir")) {
-                RETVAL->temp_dir = (char *)SvPV(ST(i+1), PL_na);
+                RETVAL->temp_dir = apr_pstrdup(r->pool,SvPV(ST(i+1), PL_na));
                 break;
             }

-- 
Joe Schaefer