You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Tianyin Xu <ti...@cs.ucsd.edu> on 2012/01/04 09:14:50 UTC

How are requested URIs translated into local resource names? (where is the "ap_run_translate_name" function?)

Hi, all,

Happy new year!!!

I'm trying to understand how are the requested URIs translated into local
resource names in Apache. For example, how does Apache know which resource
name the url "http"//XXX/image/test.png" points to. What if we use "Alias"
or "Redirect" directives?

I looked at the request.c file. It seems such job is done by the function
"ap_run_translate_name()" and "ap_run_map_to_storage()". However, I cannot
find the definition or implementation of these functions at all. It only
appears in exports.c and httpd.exp. Both of them are not the
definition/implementation of these functions.

Could anyone tell me how can I find the implementation of the function
"ap_run_translate_name" and "ap_run_map_to_storage"? Or give me some
direction or hints.

Thanks a lot for your help!!

Best regards,
Tianyin

-- 
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/

RE: How are requested URIs translated into local resource names? (where is the "ap_run_translate_name" function?)

Posted by Yehezkel Horowitz <ho...@checkpoint.com>.
You should look for 'core_map_to_storage' and 'ap_core_translate' in server/core.c

Yehezkel Horowitz
Check Point Software Technologies Ltd.
________________________________
From: tixu@eng.ucsd.edu [mailto:tixu@eng.ucsd.edu] On Behalf Of Tianyin Xu
Sent: Wednesday, January 04, 2012 10:15 AM
To: dev@httpd.apache.org
Subject: How are requested URIs translated into local resource names? (where is the "ap_run_translate_name" function?)

Hi, all,

Happy new year!!!

I'm trying to understand how are the requested URIs translated into local resource names in Apache. For example, how does Apache know which resource name the url "http"//XXX/image/test.png" points to. What if we use "Alias" or "Redirect" directives?

I looked at the request.c file. It seems such job is done by the function "ap_run_translate_name()" and "ap_run_map_to_storage()". However, I cannot find the definition or implementation of these functions at all. It only appears in exports.c and httpd.exp. Both of them are not the definition/implementation of these functions.

Could anyone tell me how can I find the implementation of the function "ap_run_translate_name" and "ap_run_map_to_storage"? Or give me some direction or hints.

Thanks a lot for your help!!

Best regards,
Tianyin

--
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/<http://cseweb.ucsd.edu/%7Etixu/>

Re: How are requested URIs translated into local resource names? (where is the "ap_run_translate_name" function?)

Posted by Nick Kew <ni...@webthing.com>.
On 4 Jan 2012, at 08:14, Tianyin Xu wrote:

> Could anyone tell me how can I find the implementation of the function "ap_run_translate_name" and "ap_run_map_to_storage"? Or give me some direction or hints.

These are functions to run hooks.  The actual work is implemented by modules
which use the hook to insert a function.

Look through the code for instances of ap_hook_translate_name and
ap_hook_map_to_storage.  The first argument to those is a function that
does the work.

Or buy the book!   http://www.apachetutor.org/

-- 
Nick Kew