Changeset 477
- Timestamp:
- 07/28/2005 10:22:53 AM (3 years ago)
- Files:
-
- 1 modified
-
branches/lighttpd-1.3.x/src/mod_fastcgi.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/lighttpd-1.3.x/src/mod_fastcgi.c
r470 r477 330 330 int fde_ndx; /* index into the fd-event buffer */ 331 331 332 size_t path_info_offset; /* start of path_info in uri.path */333 334 332 pid_t pid; 335 333 int got_proc; … … 2970 2968 buffer *fn; 2971 2969 fcgi_extension *extension = NULL; 2972 size_t path_info_offset;2973 2970 2974 2971 /* Possibly, we processed already this request */ … … 2991 2988 } 2992 2989 2993 path_info_offset = 0;2994 2995 2990 /* check if extension matches */ 2996 2991 for (k = 0; k < p->conf.exts->used; k++) { 2997 size_t ct_len; 2992 size_t ct_len; /* length of the config entry */ 2998 2993 2999 2994 extension = p->conf.exts->exts[k]; … … 3007 3002 /* check extension in the form "/fcgi_pattern" */ 3008 3003 if (*(extension->key->ptr) == '/' && strncmp(fn->ptr, extension->key->ptr, ct_len) == 0) { 3009 if (s_len > ct_len + 1) {3010 char *pi_offset;3011 3012 if (0 != (pi_offset = strchr(fn->ptr + ct_len + 1, '/'))) {3013 path_info_offset = pi_offset - fn->ptr;3014 }3015 }3016 3004 break; 3017 3005 } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) { … … 3053 3041 if (host->check_local == 0) { 3054 3042 handler_ctx *hctx; 3043 char *pathinfo; 3044 3055 3045 hctx = handler_ctx_init(); 3056 3046 3057 hctx->path_info_offset = path_info_offset;3058 3047 hctx->remote_conn = con; 3059 3048 hctx->plugin_data = p; … … 3073 3062 log_error_write(srv, __FILE__, __LINE__, "s", "handling it in mod_fastcgi"); 3074 3063 } 3064 3065 /* the prefix is the SCRIPT_NAME, 3066 * everthing from start to the next slash 3067 * this is important for check-local = "disable" 3068 * 3069 * if prefix = /admin.fcgi 3070 * 3071 * /admin.fcgi/foo/bar 3072 * 3073 * SCRIPT_NAME = /admin.fcgi 3074 * PATH_INFO = /foo/bar 3075 * 3076 * if prefix = /fcgi-bin/ 3077 * 3078 * /fcgi-bin/foo/bar 3079 * 3080 * SCRIPT_NAME = /fcgi-bin/foo 3081 * PATH_INFO = /bar 3082 * 3083 */ 3084 3085 /* the rewrite is only done for /prefix/? matches */ 3086 if (extension->key->ptr[0] == '/' && 3087 con->uri.path->used > extension->key->used && 3088 NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) { 3089 /* rewrite uri.path and pathinfo */ 3090 3091 buffer_copy_string(con->request.pathinfo, pathinfo); 3092 3093 con->uri.path->used -= con->request.pathinfo->used - 1; 3094 con->uri.path->ptr[con->uri.path->used - 1] = '\0'; 3095 } 3075 3096 } 3076 3097 return HANDLER_GO_ON; … … 3079 3100 hctx = handler_ctx_init(); 3080 3101 3081 hctx->path_info_offset = path_info_offset;3082 3102 hctx->remote_conn = con; 3083 3103 hctx->plugin_data = p;

