httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "fkater@googlemail.com" <fka...@googlemail.com>
Subject external redirect
Date Fri, 23 Jan 2009 09:07:38 GMT
Hi,

I'd like to do an external redirect.

When I return HTTP_MOVED_TEMPORARILY from my request
handler, the client browser gets the standard "FOUND"
message which is ok so far.

However, when I also try to set the new "Location" this
always causes a segmentation fault:

char* uri=apr_pstrdup(r->pool,"http://localhost/abcdef");
apr_table_setn(r->headers_out,"Location",uri);

return HTTP_MOVED_TEMPORARILY;

I also tried to do this from the access-checker hook (for
testing), however it segfaults immediately:


static int done_once=false;

static int
_hook_access_checker(request_rec* r){

  if(done_once)
    return DECLINED;
  else{
    done_onc=true;

    /* ok (no segfault) but of course no redirection: */
    //return HTTP_MOVED_TEMPORARILY;
    
    /* seg fault: */
    char* uri=apr_pstrdup(r->pool,"http://localhost/abcdef");
    apr_table_setn(r->headers_out,"Location",uri);

    return HTTP_MOVED_TEMPORARILY;
  }
}

Thank You for any further hints...
 Felix




Mime
View raw message