Permalink
Browse files

prep for 1.80

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@1388 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent 586e861 commit fdfdd8edf4b8b1c71c6536ad56043a2cb1fb4596 @klacke committed Feb 12, 2009
Showing with 363 additions and 87 deletions.
  1. +8 −4 man/Makefile
  2. +2 −16 scripts/make-release
  3. +2 −1 win32/Makefile
  4. +12 −0 win32/README.developer
  5. +20 −0 win32/README.txt
  6. +104 −0 win32/include.mk
  7. +12 −12 win32/license.xml
  8. +183 −54 win32/yaws.c
  9. +20 −0 www/news
View
12 man/Makefile
@@ -12,10 +12,14 @@ install:
## for the win32 build, the rest of us know how to run man
pdf:
- man -t ./yaws.1 | ps2pdf yaws.1.pdf
- man -t ./yaws.conf.5 | ps2pdf yaws.conf.5.pdf
- man -t ./yaws_api.5 | ps2pdf yaws_api.5.pdf
+ man -t ./yaws.1 > xxx; ps2pdf xxx yaws.1.pdf
+ man -t ./yaws.conf.5 > xxx; ps2pdf xxx yaws.conf.5.pdf
+ man -t ./yaws_api.5 > xxx; ps2pdf xxx yaws_api.5.pdf
+ man -t ./yaws_soap_lib.5 > xxx; ps2pdf xxx yaws_soap_lib.5.pdf
+ rm xxx;
+clean:
+ rm *.pdf
-all debug clean:
+all debug:
View
18 scripts/make-release
@@ -13,7 +13,7 @@ if [ ! -f ./make-release ]; then
echo "need to be in scripts dir"; exit 1;
fi
-
+(cd ../win32; make clean all)
cd ../..
@@ -32,23 +32,9 @@ ln -s yaws-${YAWS_VSN} yaws
tar cfz yaws-${YAWS_VSN}.tar.gz yaws yaws-${YAWS_VSN}
echo release resides in `pwd`/yaws-${YAWS_VSN}.tar.gz
+echo release resides in `pwd`/win32/Yaws-${YAWS_VSN}-windows-installer.exe
exit 0
-
-
-cvs export -d tmp -r yaws-$Y .
-cd tmp
-mv yaws yaws-${YAWS_VSN}
-ln -s yaws-${YAWS_VSN} yaws
-tar cfz yaws-${YAWS_VSN}.tar.gz yaws yaws-${YAWS_VSN}
-
-#mv yaws-${YAWS_VSN}.tar.gz ..
-#cd ..
-
-echo release resides in `pwd`/yaws-${YAWS_VSN}.tar.gz
-
-
-
View
3 win32/Makefile
@@ -45,5 +45,6 @@ clean:
$(RM) *.o
$(RM) *.a
$(RM) *.exe
- $(RM) -rf ebin examples applications ssl src www include doc priv bin logs scripts vsn.mk LICENSE.txt
+ $(RM) -rf ebin examples applications ssl src www include doc priv bin logs scripts vsn.mk LICENSE.txt build.xml
+
View
12 win32/README.developer
@@ -0,0 +1,12 @@
+
+To compile this stuff, two things in particular are required.
+One is a copy of the install-builder. Since yaws is an open
+source project. We have a free license of bitrock installer.
+
+Download the bitrock installer and install it somewhere.
+http://www.bitrock.com/download_installbuilder_download.html
+
+Next is the mingw crosscompiler. On Ubuntu,debian,gentoo
+it's just a simple matter of installing mingw
+
+
View
20 win32/README.txt
@@ -1,2 +1,22 @@
win32 version of yaws
+
+For just running yaws, it works pretty much the same as on UNIX.
+Commands that don't work are --id, --heart and some more
+Try yaws --help for available options.
+
+Just starting
+
+> yaws -i
+
+Starts a basic yaws system with a yaws.conf taken from
+the install dir.
+
+It's actually possible to develop and edit yaws inside windows.
+Required tools are unxutils and perl installed.
+
+
+Enjoy,
+
+/klacke
+
View
104 win32/include.mk
@@ -0,0 +1,104 @@
+###-*-makefile-*- ; force emacs to enter makefile-mode
+
+
+PREFIX = /usr/local
+prefix = ${PREFIX}
+ETCDIR = ${prefix}/etc
+VARDIR = ${prefix}/var
+
+DVILATEX = latex
+PDFLATEX = pdflatex
+DVIPS = dvips
+EPSTOPDF =
+
+COND_DVILATEX =
+COND_PDFLATEX =
+
+ERL="erl"
+WERL=""
+ERLC="erlc"
+EMULATOR=beam
+DEFAULT_CHARSET=
+EPAM = ../priv/epam
+EXTRAINCLUDE =
+ERLBINDIR = /usr/lib/erlang/bin
+HAVE_SENDFILE = true
+
+ifdef debug
+ ERLC_FLAGS+=-Ddebug
+endif
+
+ifdef trace
+ ERLC_FLAGS=+trace
+endif
+
+ifdef export_all
+ ERLC_FLAGS+=-Dexport_all
+endif
+
+ifdef debug_info
+ ERLC_FLAGS+=+debug_info
+endif
+
+CC=gcc
+CFLAGS=-g -O2 -I/usr/include/security
+LINKER=gcc
+LDFLAGS=
+WIN32=
+BSDI=
+EXE=
+DLL=so
+OBJ=o
+OUT=-o
+FPIC=-fpic
+LIBS=
+
+ERTS_VSN=5.6.3
+KERNEL_VSN=2.12.3
+STDLIB_VSN=1.15.3
+SASL_VSN=2.1.5.3
+MNESIA_VSN=4.4.3
+
+
+ERLDIR=/usr/lib/erlang
+
+LD_SHARED=gcc -shared
+
+INSTALL=/usr/bin/install -c
+INSTALL_DATA=${INSTALL} -m 644
+
+
+
+EMULATOR=beam
+ifdef debug
+ ERLC_FLAGS+=-Ddebug
+endif
+
+ifdef trace
+ ERLC_FLAGS=+trace
+endif
+
+ifdef export_all
+ ERLC_FLAGS+=-Dexport_all
+endif
+
+
+# Hmm, don't know if you are supposed to like this better... ;-)
+APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/%VSN%/$$vsn/; s/%MODULES%/$$mods/; print; }'
+
+# Targets
+
+../ebin/%.app: %.app.src ../vsn.mk Makefile
+ perl -e $(APPSCRIPT) "$(VSN)" $(MODULES) < $< > $@
+
+../ebin/%.appup: %.appup
+ cp $< $@
+
+../ebin/%.$(EMULATOR): %.erl
+ $(ERLC) $(ERLC_FLAGS) -o ../ebin $<
+
+%.$(EMULATOR): %.erl
+ $(ERLC) $(ERLC_FLAGS) $<
+
+
+
View
24 win32/license.xml
@@ -1,12 +1,12 @@
-<license>
- <issueDate>2008-06-09</issueDate>
- <licenseSchemaVersion>1.2</licenseSchemaVersion>
- <licenseType>standard</licenseType>
- <majorVersion>5</majorVersion>
- <minorVersion>4</minorVersion>
- <organization>Tail-f Systems - Single Developer License - 19803661</organization>
- <patchVersion>8</patchVersion>
- <product>BitRock InstallBuilder Multiplatform Professional</product>
- <project></project>
- <signature>0ec4dd77e3c05dbd992cee4ec49cafc0</signature>
-</license>
+<license>
+ <issueDate>2008-04-14</issueDate>
+ <licenseSchemaVersion>1.2</licenseSchemaVersion>
+ <licenseType>standard</licenseType>
+ <majorVersion>5</majorVersion>
+ <minorVersion>4</minorVersion>
+ <organization>Claes Wikstrom - Open Source License</organization>
+ <patchVersion>5</patchVersion>
+ <product>BitRock InstallBuilder Multiplatform Enterprise</product>
+ <project>yaws</project>
+ <signature>b0f43380b13adfdb16e2cc2cfa330463</signature>
+</license>
View
237 win32/yaws.c
@@ -1,3 +1,7 @@
+/* win32 version of yaws starup script */
+/* Author: klacke@hyber.org (Jan 2009) */
+
+
#include <windows.h>
#include <stdio.h>
@@ -18,8 +22,7 @@ static void readreg() {
exit(1);
}
memset(path, 0, BSIZ);
- int ret = RegQueryValueEx(hKey, "DIR", NULL, NULL,
- path, &bsz);
+ int ret = RegQueryValueEx(hKey, "DIR", NULL, NULL, path, &bsz);
fpath = (unsigned char*)malloc(strlen(path));
int i;
for(i = 0; i<strlen(path); i++ ) {
@@ -41,88 +44,214 @@ int charg(char **argv, char *s1, char *s2, int p) {
}
+int runwait(char *execString) {
+
+ STARTUPINFO si = { sizeof(si) };
+ PROCESS_INFORMATION pi;
+
+ //printf("execString: %s \n", execString);
+
+ if(CreateProcess(0, execString, NULL, NULL, FALSE, 0, 0, 0, &si, &pi))
+ {
+ unsigned long ret = 0;
+
+ // wait for process to finish
+ WaitForSingleObject(pi.hProcess, INFINITE);
+ if (GetExitCodeProcess(pi.hProcess, &ret) == 0)
+ ret = 1;
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ return ret;
+ }
+ printf("Failed to create the process entirely\n");
+ return 1;
+}
+
+
+
+int nosh(char *s) {
+ char buf[BUFSIZ];
+ sprintf (buf, "erl -noshell -pa \"%s/ebin\" %s ", fpath, s);
+ return runwait(buf);
+}
+
+int help() {
+ printf("usage: "
+""
+" yaws -i | --interactive -- interactive (no daemon) mode"
+" yaws -w | --winteractive -- interactive (werl) "
+" yaws --daemon -- daemon mode"
+""
+""
+""
+" Auxiliary flags for the daemon: "
+" --id Id -- set system id"
+" --debug -- debug mode "
+" --conf File -- set config file"
+" --tracetraf -- trace traffic"
+" --tracehttp -- trace http traffic"
+" --traceout -- trace output to stdout"
+" --version -- print version"
+" --pa path -- add load path"
+" --mnesiadir dir -- start Mnesia in dir"
+" --sname xxx -- start with sname xxx"
+" --name xxx -- start with name xxx"
+" --runmod mod -- call mod:start/0 at startup"
+" --erlarg X -- pass argument X to $erl"
+""
+"ctl functions ... "
+" yaws --hup [--id ID] -- hup the daemon, reload conf"
+" yaws --stop [--id ID] -- stop the daemon "
+" yaws --debug-dump [--id ID] -- produce a debug dump "
+" yaws --status [--id ID] -- query the daemon status "
+" yaws --load Modules -- load modules "
+" yaws --ls -- list Yaws nodes and their status"
+" yaws --ctltrace traffic|http -- toggle trace of running daemon");
+
+ return(0);
+}
+
+
+
int main(int argc, char**argv) {
- int interactive = 0;
+ int interactive = 1;
int winteractive = 0;
+ int daemon = 0;
char *conf = NULL;
+ char *sname = NULL;
+ char *name = NULL;
int debug = 0;
char *runmod = NULL;
+ char *trace = NULL;
+ char *traceoutput = NULL;
+ char tbuf[BUFSIZ];
+ char paBuf[BUFSIZ];
+ char execString[BSIZ];
+ char mnesia[255];
+ char erlarg[255];
+ char *id = "default";
+
+ memset(paBuf, 0, BUFSIZ);
+ memset(tbuf, 0, BUFSIZ);
+ memset(execString, 0, BSIZ);
readreg();
+ sprintf(paBuf, " -pa \"%s/ebin\" ", fpath);
int p = 1;
while (p < argc) {
- if (charg(argv, "-i", "--interactive", p))
+ if (charg(argv, "-i", "--interactive", p)) {
interactive = 1;
- else if (charg(argv, "-w", "--winteractive", p))
+ }
+ else if (charg(argv, "-w", "--winteractive", p)) {
winteractive = 1;
- else if (charg(argv, "--debug", NULL, p))
+ }
+ else if (charg(argv, "-D", "--daemon", p)) {
+ interactive = winteractive = 0;
+ daemon = 1;
+ }
+ else if (charg(argv, "--debug", NULL, p)) {
debug = 1;
- else if (charg(argv, "-c", "--conf", p))
+ }
+ else if (charg(argv, "-t", "--tracetraf", p)) {
+ trace=" -yaws trace traffic ";
+ }
+ else if (charg(argv, "-T", "--tracehttp", p)) {
+ trace=" -yaws trace http ";
+ }
+ else if (charg(argv, "-x", "--traceout", p)) {
+ traceoutput = " -yaws traceoutput ";
+ }
+ else if (charg(argv, "--trace", NULL, p)) {
+ traceoutput = " -yaws traceoutput ";
+ trace = " -yaws trace traffic ";
+ }
+ else if (charg(argv, "--mnesiadir", "-M", p)) {
+ sprintf(mnesia, "-mnesia dir \"%s\" -run mnesia start ",argv[++p]);
+ }
+ else if (charg(argv, "-c", "--conf", p)) {
conf = argv[++p];
- else if (charg(argv, "--runmod", NULL, p))
+ }
+ else if (charg(argv, "--id", NULL, p)) {
+ id = argv[++p];
+ }
+ else if (charg(argv, "-pa", NULL, p)) {
+ sprintf(tbuf, " -pa \"%s\" ", argv[++p]);
+ strcat(paBuf, tbuf);
+ }
+ else if (charg(argv, "--runmod", "-r", p)) {
runmod = argv[++p];
+ }
+ else if (charg(argv, "--hup", "-h", p)) {
+ return nosh("-s yaws_ctl hup default");
+ }
+ else if (charg(argv, "--stop", "-s", p)) {
+ return nosh("-s yaws_ctl stop default");
+ }
+ else if (charg(argv, "--status", "-S", p)) {
+ return nosh("-s yaws_ctl status default");
+ }
+ else if (charg(argv, "--debug-dump", NULL, p)) {
+ return nosh("-s yaws_ctl debug_dump default ");
+ }
+ else if (charg(argv, "--version", "-v", p)) {
+ nosh("-s yaws printversion");
+ exit(0);
+ }
+ else if (charg(argv, "--sname", "-sname", p)) {
+ sname = argv[++p];
+ }
+ else if (charg(argv, "--name", "-name", p)) {
+ name = argv[++p];
+ }
+ else if (charg(argv, "--erlarg", "-erlarg", p)) {
+ sprintf(tbuf, " %s ", argv[++p]);
+ strcat(erlarg, tbuf);
+ }
else {
- fprintf(stderr, "Unknown arg: %s\n", argv[p]);
- exit(1);
+ return help();
}
p++;
}
- printf("interactive = %d\n"
- "winteractive = %d\n"
- "conf = %s\n"
- "debug = %d\n"
- "runmod = %s\n",
- interactive, winteractive,
- conf, debug, runmod);
-
-
- STARTUPINFO si = { sizeof(si) };
- PROCESS_INFORMATION pi;
- char szExe[] = "erl.exe -s test test";
- char execString[BSIZ];
- char paBuf[BSIZ];
- int i;
- int len;
- char yawsargs[BUFSIZ];
if (winteractive)
- sprintf(execString, "werl.exe ");
+ sprintf(execString, "werl.exe %s %s ", erlarg, paBuf);
else
- sprintf(execString, "erl.exe ");
-
- sprintf(paBuf, " -pa \"%s/ebin\" ", fpath);
- strcat(execString, paBuf);
+ sprintf(execString, "erl.exe %s %s ", erlarg, paBuf);
if (debug)
strcat(execString, " -boot start_sasl -yaws debug ");
- if (interactive == 0 && winteractive == 0)
- strcat(execString, " --detach ");
-
+ if ((interactive == 0 && winteractive == 0) || daemon == 1)
+ strcat(execString, " -detached ");
+
if (conf == NULL)
- sprintf(yawsargs, " -conf \"%s\\yaws.conf\" ", path);
+ sprintf(tbuf, " -conf \"%s\\yaws.conf\" ", path);
else
- sprintf(yawsargs, " -conf \"%s\" ", conf);
- strcat(execString, yawsargs);
+ sprintf(tbuf, " -conf \"%s\" ", conf);
+ strcat(execString, tbuf);
strcat(execString, " -run yaws -yaws id default ");
-
- printf("execString = %s\n", execString);
- if(CreateProcess(0, execString, NULL, NULL, FALSE, 0, 0, 0, &si, &pi))
- {
- unsigned long ret = 0;
-
- // wait for process to finish
- WaitForSingleObject(pi.hProcess, INFINITE);
- if (GetExitCodeProcess(pi.hProcess, &ret) == 0)
- ret = 1;
- CloseHandle(pi.hProcess);
- CloseHandle(pi.hThread);
- return ret;
- }
- printf("Failed to create the process entirely\n");
- return 1;
+ if (mnesia != NULL)
+ strcat(execString, mnesia);
+ if (trace != NULL)
+ strcat(execString, trace);
+ if (traceoutput != NULL)
+ strcat(execString, traceoutput);
+
+ if (sname != NULL) {
+ sprintf(tbuf," -sname %s ", sname);
+ strcat(execString, tbuf);
+ } else if (name != NULL) {
+ sprintf(tbuf, " -name %s ", name);
+ strcat(execString, tbuf);
+ }
+ if (runmod != NULL) {
+ sprintf(tbuf, " -runmod %s ", runmod);
+ strcat(execString, tbuf);
+ }
+
+ return runwait(execString);
}
View
20 www/news
@@ -1,3 +1,23 @@
+Thu Feb 12 22:58:16 CET 2009
+Full windows support with a proper .exe Windows installer (klacke)
+Added a timestamp check on the ssl cert/key files making it possible to just upload new cert/key files and do yaws --hup to automatically have the new cert/key files being used (klacke)
+Disgusting DOS attack discovered by Manuel Duran Aguete whereby if a neverendig series of headers are sent to yaws, we die of out of memory. Actual attack not described here. Contact me (klacke) if you're interested in the details
+and want a backport patch. I'm not reallu sure this is indeed the right procedure for announcing a DOS bug. (First time !!!)
+init_db patch cleanup by Liu Yubao
+patch by Liu Yubao to remove timeout in ssl accept
+add pkg-config support contributed by Olivier Girondel
+add --disable-sendfile option to configure, fix src/Makefile to clean yaws_configure.hrl (Steve)
+set HEART_COMMAND to allow a maximum of 5 restarts within any 60 second period (Steve)
+patch for queryparts that contain a question mark
+Document the --wait-started option for the yaws script (Steve)
+Fix the yaws script to allow --id ID to be passed after --wait-started (Steve)
+Allow optional wait time to be specified to yaws via --wait-started=<seconds> (Steve)
+added kpoll as default
+fix sendfile socket fd handling problems on 64-bit platforms (Steve)
+cygwin build patch by Davide marques
+stream content with a timeout patch from Davide Marques
+traffic trace was broken for certain types of requsts - found by wde
+
Tue Jan 20 20:19:16 CET 2009 version 1.79
This release fixes the completely broken 1.78 release. So at last, we have good\
sendfile support.

0 comments on commit fdfdd8e

Please sign in to comment.