"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/mux_fcgi.c" between
haproxy-2.2.1.tar.gz and haproxy-2.2.2.tar.gz

About: HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments.

mux_fcgi.c  (haproxy-2.2.1):mux_fcgi.c  (haproxy-2.2.2)
skipping to change at line 1296 skipping to change at line 1296
if (!(params->mask & FCGI_SP_HTTPS)) { if (!(params->mask & FCGI_SP_HTTPS)) {
if (cli_conn) if (cli_conn)
params->https = ssl_sock_is_ssl(cli_conn); params->https = ssl_sock_is_ssl(cli_conn);
} }
#endif #endif
if ((params->mask & FCGI_SP_URI_MASK) != FCGI_SP_URI_MASK) { if ((params->mask & FCGI_SP_URI_MASK) != FCGI_SP_URI_MASK) {
/* one of scriptname, pathinfo or query_string is no set */ /* one of scriptname, pathinfo or query_string is no set */
struct ist path = http_get_path(params->uri); struct ist path = http_get_path(params->uri);
int len; int len;
/* Decode the path. it must first be copied to keep the URI
* untouched.
*/
chunk_memcat(params->p, path.ptr, path.len);
path.ptr = b_tail(params->p) - path.len;
path.ptr[path.len] = '\0';
len = url_decode(path.ptr, 0);
if (len < 0)
goto error;
path.len = len;
/* No scrit_name set but no valid path ==> error */ /* No scrit_name set but no valid path ==> error */
if (!(params->mask & FCGI_SP_SCRIPT_NAME) && !istlen(path)) if (!(params->mask & FCGI_SP_SCRIPT_NAME) && !istlen(path))
goto error; goto error;
/* Find limit between the path and the query-string */
for (len = 0; len < path.len && *(path.ptr + len) != '?'; len++);
/* If there is a query-string, Set it if not already set */ /* If there is a query-string, Set it if not already set */
if (!(params->mask & FCGI_SP_REQ_QS) && len < path.len) if (!(params->mask & FCGI_SP_REQ_QS)) {
params->qs = ist2(path.ptr+len+1, path.len-len-1); struct ist qs = istfind(path, '?');
/* Update the path length */
path.len -= qs.len;
/* Set the query-string skipping the '?', if any */
if (istlen(qs))
params->qs = istnext(qs);
}
/* If the script_name is set, don't try to deduce the path_info /* If the script_name is set, don't try to deduce the path_info
* too. The opposite is not true. * too. The opposite is not true.
*/ */
if (params->mask & FCGI_SP_SCRIPT_NAME) { if (params->mask & FCGI_SP_SCRIPT_NAME) {
params->mask |= FCGI_SP_PATH_INFO; params->mask |= FCGI_SP_PATH_INFO;
goto end; goto end;
} }
/* Decode the path. it must first be copied to keep the URI
* untouched.
*/
chunk_memcat(params->p, path.ptr, path.len);
path.ptr = b_tail(params->p) - path.len;
len = url_decode(ist0(path), 0);
if (len < 0)
goto error;
path.len = len;
/* script_name not set, preset it with the path for now */ /* script_name not set, preset it with the path for now */
params->scriptname = ist2(path.ptr, len); params->scriptname = path;
/* If there is no regex to match the pathinfo, just to the last /* If there is no regex to match the pathinfo, just to the last
* part and see if the index must be used. * part and see if the index must be used.
*/ */
if (!fconn->app->pathinfo_re) if (!fconn->app->pathinfo_re)
goto check_index; goto check_index;
/* If some special characters are found in the decoded path (\n /* If some special characters are found in the decoded path (\n
* or \0), the PATH_INFO regex cannot match. This is theorically * or \0), the PATH_INFO regex cannot match. This is theorically
* valid, but probably unexpected, to have such characters. So, * valid, but probably unexpected, to have such characters. So,
 End of changes. 5 change blocks. 
17 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)