Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | A cleaner way of dealing with the --baseurl problem. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | all-ui |
| Files: | files | file ages | folders |
| SHA1: |
8e4b8ba0e40416d54df024226c608f14 |
| User & Date: | drh 2016-12-01 15:40:11.827 |
Context
|
2016-12-01
| ||
| 16:27 | Fix the "fossil all ui" logic so that it still works for directory listings inside of chroot jails. ... (Closed-Leaf check-in: 226a0990d3 user: drh tags: all-ui) | |
| 15:40 | A cleaner way of dealing with the --baseurl problem. ... (check-in: 8e4b8ba0e4 user: drh tags: all-ui) | |
| 14:56 | Fix the "fossil all ui" command so that it works on Windows. But also comment out some very confused logic in process_on_web_page() that is associated with "--baseurl" option. This logic needs to be fixed prior to merging with trunk. ... (check-in: da1c769cd2 user: drh tags: all-ui) | |
Changes
Changes to src/main.c.
| ︙ | ︙ | |||
1286 1287 1288 1289 1290 1291 1292 |
*/
static void process_one_web_page(
const char *zNotFound, /* Redirect here on a 404 if not NULL */
Glob *pFileGlob, /* Deliver static files matching */
int allowRepoList /* Send repo list for "/" URL */
){
const char *zPathInfo = PD("PATH_INFO", "");
| < < < < < < < < < < < < < < | 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 |
*/
static void process_one_web_page(
const char *zNotFound, /* Redirect here on a 404 if not NULL */
Glob *pFileGlob, /* Deliver static files matching */
int allowRepoList /* Send repo list for "/" URL */
){
const char *zPathInfo = PD("PATH_INFO", "");
char *zPath = NULL;
int i;
const CmdOrPage *pCmd = 0;
const char *zBase = g.zRepositoryName;
/* Handle universal query parameters */
if( PB("utc") ){
g.fTimeFormat = 1;
}else if( PB("localtime") ){
g.fTimeFormat = 2;
}
/* If the repository has not been opened already, then find the
** repository based on the first element of PATH_INFO and open it.
*/
if( !g.repositoryOpen ){
char *zRepo; /* Candidate repository name */
char *zToFree = 0; /* Malloced memory that needs to be freed */
const char *zCleanRepo; /* zRepo with surplus leading "/" removed */
|
| ︙ | ︙ | |||
1391 1392 1393 1394 1395 1396 1397 |
zCleanRepo = file_cleanup_fullpath(zRepo);
if( szFile==0 && sqlite3_strglob("*/.fossil",zRepo)!=0 ){
szFile = file_size(zCleanRepo);
if( g.fHttpTrace ){
@ <!-- file_size(%h(zCleanRepo)) is %lld(szFile) -->
fprintf(stderr, "# file_size(%s) = %lld\n", zCleanRepo, szFile);
}
| < < < < < < < < < < < < | 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 |
zCleanRepo = file_cleanup_fullpath(zRepo);
if( szFile==0 && sqlite3_strglob("*/.fossil",zRepo)!=0 ){
szFile = file_size(zCleanRepo);
if( g.fHttpTrace ){
@ <!-- file_size(%h(zCleanRepo)) is %lld(szFile) -->
fprintf(stderr, "# file_size(%s) = %lld\n", zCleanRepo, szFile);
}
}
/* If no file named by zRepo exists, remove the added ".fossil" suffix
** and check to see if there is a file or directory with the same
** name as the raw PATH_INFO text.
*/
if( szFile<0 && i>0 ){
|
| ︙ | ︙ | |||
1480 1481 1482 1483 1484 1485 1486 |
}
return;
}
break;
}
/* Add the repository name (without the ".fossil" suffix) to the end
| | | > > | | | | > > > > > > > > | 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 |
}
return;
}
break;
}
/* Add the repository name (without the ".fossil" suffix) to the end
** of SCRIPT_NAME and g.zTop and g.zBaseURL and remove the repository
** name from the beginning of PATH_INFO.
*/
zNewScript = mprintf("%s%.*s", zOldScript, i, zPathInfo);
if( g.zTop ) g.zTop = mprintf("%s%.*s", g.zTop, i, zPathInfo);
if( g.zBaseURL ) g.zBaseURL = mprintf("%s%.*s", g.zBaseURL, i, zPathInfo);
cgi_replace_parameter("PATH_INFO", &zPathInfo[i+1]);
zPathInfo += i;
cgi_replace_parameter("SCRIPT_NAME", zNewScript);
db_open_repository(file_cleanup_fullpath(zRepo));
if( g.fHttpTrace ){
@ <!-- repository: "%h(zRepo)" -->
@ <!-- translated PATH_INFO: "%h(zPathInfo)" -->
@ <!-- translated SCRIPT_NAME: "%h(zNewScript)" -->
fprintf(stderr,
"# repository: [%s]\n"
"# translated PATH_INFO = [%s]\n"
"# translated SCRIPT_NAME = [%s]\n",
zRepo, zPathInfo, zNewScript);
if( g.zTop ){
@ <!-- translated g.zTop: "%h(g.zTop)" -->
fprintf(stderr, "# translated g.zTop = [%s]\n", g.zTop);
}
if( g.zBaseURL ){
@ <!-- translated g.zBaseURL: "%h(g.zBaseURL)" -->
fprintf(stderr, "# translated g.zBaseURL = [%s]\n", g.zBaseURL);
}
}
}
/* At this point, the appropriate repository database file will have
** been opened. Use the first element of PATH_INFO as the page name
** and deliver the appropriate page back to the user.
*/
|
| ︙ | ︙ |