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



Reply via email to