Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Update the "fossil server DIRECTORY" operation so that it will serve static content contained in DIRECTORY in addition to Fossil repositories. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
87d6aa31965d7dd789d38e0faa28e313 |
| User & Date: | drh 2012-11-14 17:23:44.538 |
Context
|
2012-11-14
| ||
| 17:39 | Allow the "fossil ui" command to specify a directory as long as the "--notfound" option is also used. Give a better error message if these conditions are not met. ... (check-in: 4e368da19c user: drh tags: trunk) | |
| 17:23 | Update the "fossil server DIRECTORY" operation so that it will serve static content contained in DIRECTORY in addition to Fossil repositories. ... (check-in: 87d6aa3196 user: drh tags: trunk) | |
|
2012-11-13
| ||
| 15:04 | this ampersand should not have been escaped ... (check-in: 2017763c31 user: jan.nijtmans tags: trunk) | |
Changes
Changes to src/main.c.
| ︙ | ︙ | |||
1379 1380 1381 1382 1383 1384 1385 |
i = zPathInfo[0]!=0;
while( 1 ){
while( zPathInfo[i] && zPathInfo[i]!='/' ){ i++; }
zRepo = zToFree = mprintf("%s%.*s.fossil",g.zRepositoryName,i,zPathInfo);
/* To avoid mischief, make sure the repository basename contains no
| | > > | > > | | > > > > > > > > | 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 |
i = zPathInfo[0]!=0;
while( 1 ){
while( zPathInfo[i] && zPathInfo[i]!='/' ){ i++; }
zRepo = zToFree = mprintf("%s%.*s.fossil",g.zRepositoryName,i,zPathInfo);
/* To avoid mischief, make sure the repository basename contains no
** characters other than alphanumerics, "-", "/", "_", and "." beside
** "/" or ".".
*/
for(j=strlen(g.zRepositoryName)+1, k=0; zRepo[j] && k<i-1; j++, k++){
char c = zRepo[j];
if( !fossil_isalnum(c) && c!='-' && c!='/'
&& (c!='.' || zRepo[j+1]=='/' || zRepo[j-1]=='/' || zRepo[j+1]=='.')
){
zRepo[j] = '_';
}
}
if( zRepo[0]=='/' && zRepo[1]=='/' ){ zRepo++; j--; }
szFile = file_size(zRepo);
if( szFile<0 ){
assert( fossil_strcmp(&zRepo[j], ".fossil")==0 );
zRepo[j] = 0;
if( zPathInfo[i]=='/' && file_isdir(zRepo)==1 ){
fossil_free(zToFree);
i++;
continue;
}
if( file_isfile(zRepo) ){
Blob content;
blob_read_from_file(&content, zRepo);
cgi_set_content_type(mimetype_from_name(zRepo));
cgi_set_content(&content);
cgi_reply();
return;
}
zRepo[j] = '.';
}
if( szFile<1024 ){
set_base_url(0);
if( zNotFound ){
|
| ︙ | ︙ |