Permalink
Browse files

""

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@69 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent de3ccf6 commit 78ee43dfb645ad7adb65690cc48db1d53c0c8bb3 @klacke committed Jun 10, 2002
Showing with 54 additions and 23 deletions.
  1. +12 −0 LICENSE
  2. +2 −12 Makefile
  3. +2 −2 ebin/yaws.app
  4. +1 −1 scripts/Makefile
  5. +6 −2 src/Makefile
  6. +1 −0 src/yaws.erl
  7. +7 −5 src/yaws_server.erl
  8. +16 −0 src/yaws_vsn.template
  9. +1 −1 vsn.mk
  10. +6 −0 www/static.html
View
12 LICENSE
@@ -0,0 +1,12 @@
+
+This software (the yaws webserver) is free software.
+The software is Copyright (c) Claes Wikstrom <klacke@hyber.org>
+Any use or misuse of the source code is hereby freely allowed.
+
+1. Redistributions of source code must retain the above copyright
+ notice as well as this list of conditions.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice as well as this list of conditions.
+
+
View
@@ -1,22 +1,12 @@
SUBDIRS = src scripts
-all:
+all debug clean install:
@set -e ; \
for d in $(SUBDIRS) ; do \
- if [ -f $$d/Makefile ]; then ( cd $$d && $(MAKE) ) || exit 1 ; fi ; \
+ if [ -f $$d/Makefile ]; then ( cd $$d && $(MAKE) $@ ) || exit 1 ; fi ; \
done
-clean:
- @for d in $(SUBDIRS) ; do \
- if [ -f $$d/Makefile ]; then ( cd $$d && $(MAKE) clean ) fi ; \
- done
-
-
-install:
- @for d in $(SUBDIRS) ; do \
- if [ -f $$d/Makefile ]; then ( cd $$d && $(MAKE) install ) fi ; \
- done
touch:
find . -name '*' -print | xargs touch -m
View
@@ -1,7 +1,7 @@
{application,yaws,
[{description,"yaws WWW server"},
- {vsn,"0.40"},
- {modules,[yaws, yaws_app, yaws_config, yaws_server, yaws_sup, yaws_api, yaws_log, yaws_ls, yaws_debug, yaws_compile, yaws_ctl, yaws_ssl]},
+ {vsn,"0.42"},
+ {modules,[yaws, yaws_app, yaws_config, yaws_server, yaws_sup, yaws_api, yaws_log, yaws_ls, yaws_debug, yaws_compile, yaws_ctl, yaws_ssl, yaws_vsn]},
{registered, []},
{mod,{yaws_app,[]}},
{env, []},
View
@@ -1,7 +1,7 @@
include ../include.mk
-all: yaws.ss
+all debug: yaws.ss
@sh ./mangle `pwd`/.. $(ERL) yaws.ss ../bin/yaws
@chmod +x ../bin/yaws
@if [ -f $$HOME/yaws.conf ]; \
View
@@ -19,7 +19,8 @@ MODULES=yaws \
yaws_debug \
yaws_compile \
yaws_ctl \
- yaws_ssl
+ yaws_ssl \
+ yaws_vsn
EBIN_FILES=$(MODULES:%=../ebin/%.$(EMULATOR)) ../ebin/yaws.app
@@ -31,7 +32,10 @@ ERLC_FLAGS+=-W +debug_info $(DEBUG_FLAGS) -pa ../../yaws
-all: $(EBIN_FILES)
+all: yaws_vsn.erl $(EBIN_FILES)
+
+yaws_vsn.erl: yaws_vsn.template
+ . ../vsn.mk; sed "s/%VSN%/${YAWS_VSN}/" < yaws_vsn.template > yaws_vsn.erl
debug:
$(MAKE) TYPE=debug
View
@@ -521,3 +521,4 @@ mktags() ->
pids() ->
gen_server:call(yaws_server, pids).
+
View
@@ -40,6 +40,7 @@
path,
fullpath,
dir, %% relative dir where the path leads to
+ %% flat | unflat need flat for authentication
data, %% Binary | FileDescriptor | DirListing | undefined
mime = "text/html", %% MIME type
q, %% query for GET requests
@@ -1326,7 +1327,7 @@ make_date_header() ->
end.
%% FIXME read vsn from conf at compile time
make_server_header() ->
- ["Server: Yaws/0.32 Yet Another Web Server", crnl()].
+ ["Server: Yaws/", yaws_vsn:version(), " Yet Another Web Server", crnl()].
make_last_modified(_) ->
[];
make_last_modified(FI) ->
@@ -1437,7 +1438,7 @@ cache_file(GC, SC, Path, UT) when UT#urltype.type == regular ;
FI#file_info.size > GC#gconf.max_size_cached_file ->
UT;
true ->
- {ok, Bin} = file:read_file(UT#urltype.fullpath),
+ {ok, Bin} = prim_file:read_file(UT#urltype.fullpath),
UT2 = UT#urltype{data = Bin},
ets:insert(E, {{url, Path}, now_secs(), UT2}),
ets:insert(E, {{urlc, Path}, 1}),
@@ -1471,15 +1472,16 @@ do_url_type(Droot, Path) ->
maybe_return_dir(DR, FlatPath) ->
- case file:read_file_info([DR, FlatPath, "/index.yaws"]) of
+ ?Debug("maybe_return_dir(~p, ~p)", [DR, FlatPath]),
+ case prim_file:read_file_info([DR, FlatPath, "/index.yaws"]) of
{ok, FI} ->
#urltype{type = yaws,
finfo = FI,
mime = "text/html",
dir = FlatPath,
fullpath = ?f([DR, FlatPath,"/index.yaws"])};
_ ->
- case file:read_file_info([DR, FlatPath, "/index.html"]) of
+ case prim_file:read_file_info([DR, FlatPath, "/index.html"]) of
{ok, FI} ->
#urltype{type = regular,
finfo = FI,
@@ -1559,7 +1561,7 @@ ret_reg_split(DR, Comps, RevFile, Query) ->
File = lists:reverse(RevFile),
L = [DR, Dir, File],
?Debug("ret_reg_split: L =~p~n",[L]),
- case file:read_file_info(L) of
+ case prim_file:read_file_info(L) of
{ok, FI} when FI#file_info.type == regular ->
{X, Mime} = suffix_type(RevFile),
#urltype{type=X,
View
@@ -0,0 +1,16 @@
+%%%----------------------------------------------------------------------
+%%% File : yaws_vsn.template
+%%% Author : Klacke <klacke@bluetail.com>
+%%% Purpose :
+%%% Created : 10 Jun 2002 by Klacke <klacke@bluetail.com>
+%%%----------------------------------------------------------------------
+
+-module(yaws_vsn).
+-author('klacke@bluetail.com').
+
+-compile(export_all).
+
+version() -> "%VSN%".
+
+
+
View
2 vsn.mk
@@ -1 +1 @@
-YAWS_VSN=0.41
+YAWS_VSN=0.42
View
@@ -0,0 +1,6 @@
+<html>
+
+<p> no content
+
+</html>
+

0 comments on commit 78ee43d

Please sign in to comment.