Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
11f6d250
Commit
11f6d250
authored
11 years ago
by
Martin Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Removed extensions file.
parent
3daf98c0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/modules/HTTPLoop/extensions
+0
-218
0 additions, 218 deletions
src/modules/HTTPLoop/extensions
src/modules/HTTPLoop/wwwserver.pike
+2
-23
2 additions, 23 deletions
src/modules/HTTPLoop/wwwserver.pike
with
2 additions
and
241 deletions
src/modules/HTTPLoop/extensions
deleted
100644 → 0
+
0
−
218
View file @
3daf98c0
# name="Extension database";
# doc="The database used to map from extension to mime-type (example: *.gif to image/gif)";
#
aif audio/x-aiff
aifc audio/x-aiff
aiff audio/x-aiff
au audio/basic
m3u audio/x-mpegurl
mid audio/midi
midi audio/midi
mod audio/x-mod
mp2 audio/x-mpeg
mp3 audio/x-mpeg
mp3url audio/x-mpegurl
mpa audio/x-mpeg
psid audio/x-psid
# This is the standard extension used by the RealVideo 5.0 encoder
rm audio/x-pn-realaudio
ra audio/x-pn-realaudio
ram audio/x-pn-realaudio
rpm audio/x-pn-realaudio-plugin
sid audio/x-psid
snd audio/basic
vox audio/voxware
wav audio/x-wav
fif image/fif
gif image/gif
ief image/ief
iff image/ilbm
ilbm image/ilbm
jpe image/jpeg
jpeg image/jpeg
jpg image/jpeg
pbm image/x-portable-bitmap
pgm image/x-portable-graymap
pict image/pict
pjpg image/jpeg
png image/png
pnm image/x-portable-anymap
ppm image/x-portable-pixmap
ras image/x-cmu-raster
rgb image/x-rgb
rs image/x-sun-raster
tga image/x-targa
tif image/tiff
tiff image/tiff
xbm image/x-xbitmap
xpm image/x-xpixmap
xwd image/x-xwindowdump
# AutoCad (AutoDesk)
dwf drawing/x-dwf
anim3 video/x-anim
anim5 video/x-anim
anim7 video/x-anim
anim8 video/x-anim
avi video/x-msvideo
fli video/x-fli
mov video/quicktime
movie video/x-sgi-movie
mpe video/mpeg
mpeg video/mpeg
mpg video/mpeg
qt video/quicktime
viv video/vnd.vivo
vivo video/vnd.vivo
vos video/vosaic
c text/x-c-code
cc text/x-c++-code
css text/css
etx text/x-setext
h text/x-include-file
htm text/html
html text/html
java text/plain
rtx text/richtext
rxml text/roxencode
sgm text/x-sgml
sgml text/x-sgml
shtml text/html
spider text/spidercode
spml text/spinnercode
spml text/spidercode
tsv text/tab-separated-values
txt text/plain
aab application/x-authorware-bin
aam application/x-authorware-map
aas application/x-authorware-seg
ai application/postscript
arj application/octet-stream
asn application/astound
asp application/x-asap
bcpio application/x-bcpio
bin application/octet-stream
cert application/x-x509-ca-cert
cer application/x-x509-ca-cert
cdf application/x-netcdf
cdr application/x-coreldraw
cdrw application/x-coreldraw
chat application/x-chat
class application/x-java-vm
com application/octet-stream
cpio application/x-cpio
csh application/x-csh
dll application/octet-stream
dnt application/donut
# Too general, but also too common to not be defined.
doc application/msword
donut application/donut
drv application/octet-stream
dvi application/x-dvi
eps application/postscript
evy application/x-envoy
exe application/octet-stream
gtar application/x-gtar
hdf application/x-hdf
hqx application/mac-binhex40
iw application/iconauthor
iwm application/iconauthor
jar application/x-java-archive
js application/x-javascript
latex application/x-latex
lha application/lha
lzh application/lha
man application/x-troff-man
map application/x-imagemap
me application/x-troff-me
mif application/x-mif
mm application/x-meme
ms application/x-troff-ms
msw application/binary
mw application/math
nc application/x-netcdf
oda application/oda
pdf application/pdf
pfr application/font-tdpfr
pl application/x-perl
# Oracle plug-ins
po application/x-form
pot application/mspowerpoint
ppt application/mspowerpoint
ppz application/mspowerpoint
pps application/mspowerpoint
ps application/postscript
quake application/x-qplug-plugin
roff application/x-troff
rtf application/rtf
sh application/x-sh
shar application/x-shar
sit application/x-stuffit
so application/octet-stream
spl application/futuresplash
spr application/x-sprite
sprite application/x-sprite
src application/x-wais-source
sv4cpic application/x-sv4cpio
sv4crc application/x-sv4crc
swf application/x-shockwave-flash
t application/x-troff
tar application/unix-tar
tcl application/x-tcl
tex application/x-tex
texi application/x-texinfo
texinfo application/x-texinfo
tgz application/unix-tar x-gzip
tr application/x-troff
tsp application/dsptype
user application/x-x509-user-cert
usr application/x-x509-user-cert
ustar application/x-ustar
vcd application/x-cdlink
vmd application/vocaltec-media-desc
vmf application/vocaltec-media-file
wpc application/wpc
xls application/vnd.ms-excel
zip application/zip
# This one hasn't been registred with IANA yet, but is added anyway.
# LivePicture PhotoVista RealSpace
ivr i-world/i-vrml
wrl x-world/x-vrml
wrml x-world/x-vrml
talk plugin/talker
# Diskmasher -- Amiga thingie
dms application/x-diskmasher
# Windows Write
wri application/x-write
ice x-conference/x-cooltalk
# MacroMedia Director (http://www.macromedia.com/)
dcr application/x-director
dir application/x-director
dxr application/x-director
# Netscape proxy config files.
nspc application/x-ns-proxy-autoconfig
pac application/x-ns-proxy-autoconfig
# Certificate Authority Certificate (recognized at least by Netscape)
ca_cert application/x-x509-ca-cert
# This is supposed to be just 'gzip' and 'compress', but Netscape
# barfs.. Fixed in Netscape 3.*, but quite a lot of people still run 2.*
Z STRIP x-compress
gz STRIP x-gzip
uu STRIP uuencode
b64 STRIP base64
This diff is collapsed.
Click to expand it.
src/modules/HTTPLoop/wwwserver.pike
+
2
−
23
View file @
11f6d250
import Stdio;
import Stdio;
mapping exts = ([]);
constant days = ({ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" });
constant days = ({ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" });
constant months = ({ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
constant months = ({ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" });
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" });
...
@@ -92,7 +91,7 @@ mixed handle(object o)
...
@@ -92,7 +91,7 @@ mixed handle(object o)
catch { readlink(f+file); islink = 1; };
catch { readlink(f+file); islink = 1; };
#endif
#endif
string ext = (file / ".") [-1];
string ext = (file / ".") [-1];
string ctype = (size >= 0 ?
exts[
ext
]
|| "text/plain" :
string ctype = (size >= 0 ?
MIME.ext_to_media_type(
ext
)
|| "text/plain" :
"Directory");
"Directory");
if(size < -1)
if(size < -1)
file += "/";
file += "/";
...
@@ -120,8 +119,7 @@ mixed handle(object o)
...
@@ -120,8 +119,7 @@ mixed handle(object o)
}
}
} else {
} else {
string ext = (f / ".") [-1];
string ext = (f / ".") [-1];
string ctype = exts[ext] || "text/plain";
string ctype = MIME.ext_to_media_type(ext) || "text/plain";
#if 1
o->reply_with_cache("HTTP/1.1 200 Ok\r\n"
o->reply_with_cache("HTTP/1.1 200 Ok\r\n"
"Content-type: "+ctype+"\r\n"
"Content-type: "+ctype+"\r\n"
"Content-Length: "+s[1]+"\r\n"
"Content-Length: "+s[1]+"\r\n"
...
@@ -131,17 +129,6 @@ mixed handle(object o)
...
@@ -131,17 +129,6 @@ mixed handle(object o)
"Connection: Keep-Alive\r\n"
"Connection: Keep-Alive\r\n"
"\r\n"+
"\r\n"+
read_bytes(f), 20);
read_bytes(f), 20);
#else
o->reply("HTTP/1.1 200 Ok\r\n"
"Content-type: "+ctype+"\r\n"
"Content-Length: "+s[1]+"\r\n"
"Last-Modified: "+http_date(s[4])+"\r\n"
"MIME-Version: 1.0\r\n"
"Server: Neo-FastSpeed\r\n"
"Connection: Keep-Alive\r\n"
"\r\n",
Stdio.File(f, "r"), s[1]);
#endif
destruct(o);
destruct(o);
}
}
}
}
...
@@ -155,14 +142,6 @@ int main(int argc, array (string) argv)
...
@@ -155,14 +142,6 @@ int main(int argc, array (string) argv)
thread_set_concurrency(100);
thread_set_concurrency(100);
#endif
#endif
port = Stdio.Port();
port = Stdio.Port();
array foo;
foreach(read_file((argv[0] - "wwwserver.pike") + "extensions")/"\n",
string s) {
if(sizeof(s) && s[0] != '#' && (foo = (s / "\t" - ({""}))) &&
sizeof(foo) == 2)
exts[foo[0]] = foo[1];
}
werror(sprintf("Found %d extensions...\n", sizeof(exts)));
if(!port->bind(PORT))
if(!port->bind(PORT))
{
{
werror("Bind failed.\n");
werror("Bind failed.\n");
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment