Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8196fb77d1 | |||
| 4abf6642f7 | |||
| e3284dcfbc | |||
| f064ff6b3d | |||
| bfa5d8cc05 | |||
| 6614919c13 | |||
| 8379acdb7f | |||
| 160ddc258d | |||
| 01892d2766 | |||
| 222955a2e7 | |||
| 37b22c3559 | |||
| afbd522362 | |||
| a4bed3ab14 | |||
| 7468e7a36c | |||
| 145445c713 | |||
| 7fa9314c6b | |||
| 5d37b6c6ae | |||
| fe1f84e29d | |||
| 83e27a6653 | |||
| ee9c68b04e | |||
| c04874397b | |||
| 375604edd6 | |||
| 3e32f3784f | |||
| 5c4a54d998 | |||
| 3af3ac3f6f |
@@ -3,13 +3,16 @@
|
|||||||
include Makefile.dep
|
include Makefile.dep
|
||||||
|
|
||||||
|
|
||||||
#ifndef CXX
|
ifeq ($(OSTYPE), FreeBSD)
|
||||||
# temporarily workaround: forcing using clang (CXX is defined by the OS and is equal to g++)
|
CXX = clang++
|
||||||
CXX = clang++
|
else
|
||||||
#endif
|
CXX = g++-4.8
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ifndef CXXFLAGS
|
ifndef CXXFLAGS
|
||||||
CXXFLAGS = -Wall -O2 -fPIC -pthread -std=c++11 -I/usr/local/include -DEZC_USE_WINIX_LOGGER -DEZC_HAS_SPECIAL_STREAM
|
CXXFLAGS = -Wall -O0 -g -fPIC -pthread -std=c++11 -I/usr/local/include -I/usr/include/postgresql -DEZC_USE_WINIX_LOGGER -DEZC_HAS_SPECIAL_STREAM
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
@@ -51,12 +54,12 @@ winix.so: $(winix.src.files)
|
|||||||
@cd ../ezc/src ; $(MAKE) -e
|
@cd ../ezc/src ; $(MAKE) -e
|
||||||
@cd ../tito/src ; $(MAKE) -e
|
@cd ../tito/src ; $(MAKE) -e
|
||||||
@cd ../pikotools ; $(MAKE) -e
|
@cd ../pikotools ; $(MAKE) -e
|
||||||
$(CXX) -shared -rdynamic -Wl,-whole-archive -o winix.so $(CXXFLAGS) $(CXXWINIXINCLUDEFLAGS) core/*.o db/*.o functions/*.o templates/*.o notify/*.o ../ezc/src/ezc.a ../tito/src/tito.a ../pikotools/utf8/utf8.a ../pikotools/space/space.a ../pikotools/mainparser/mainparser.a ../pikotools/date/date.a $(LDFLAGS) -lfcgi -lpq -lz -lfetch -lpthread -Wl,-no-whole-archive
|
$(CXX) -shared -rdynamic -Wl,-whole-archive -o winix.so $(CXXFLAGS) $(CXXWINIXINCLUDEFLAGS) core/*.o db/*.o functions/*.o templates/*.o notify/*.o ../ezc/src/ezc.a ../tito/src/tito.a ../pikotools/utf8/utf8.a ../pikotools/space/space.a ../pikotools/mainparser/mainparser.a ../pikotools/date/date.a $(LDFLAGS) -lfcgi -lpq -lz -lpthread -lcurl -Wl,-no-whole-archive
|
||||||
|
|
||||||
|
|
||||||
winix: winix.so $(winix.src.files)
|
winix: winix.so $(winix.src.files)
|
||||||
@cd main ; $(MAKE) -e
|
@cd main ; $(MAKE) -e
|
||||||
$(CXX) -o winix $(CXXFLAGS) $(LDFLAGS) main/*.o winix.so
|
$(CXX) -o winix $(CXXFLAGS) $(LDFLAGS) main/*.o winix.so -lfcgi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -131,19 +134,19 @@ install: all
|
|||||||
# etc configs
|
# etc configs
|
||||||
rm -Rf $(winix_install_dir)/etc
|
rm -Rf $(winix_install_dir)/etc
|
||||||
mkdir -p $(winix_install_dir)/etc
|
mkdir -p $(winix_install_dir)/etc
|
||||||
cp -rf etc/ $(winix_install_dir)/etc/
|
cp -rf etc/* $(winix_install_dir)/etc/
|
||||||
# html templates
|
# html templates
|
||||||
rm -Rf $(winix_install_dir)/html
|
rm -Rf $(winix_install_dir)/html
|
||||||
mkdir -p $(winix_install_dir)/html
|
mkdir -p $(winix_install_dir)/html
|
||||||
cp -rf html/ $(winix_install_dir)/html/
|
cp -rf html/* $(winix_install_dir)/html/
|
||||||
# txt templates
|
# txt templates
|
||||||
rm -Rf $(winix_install_dir)/txt
|
rm -Rf $(winix_install_dir)/txt
|
||||||
mkdir -p $(winix_install_dir)/txt
|
mkdir -p $(winix_install_dir)/txt
|
||||||
cp -rf txt/ $(winix_install_dir)/txt/
|
cp -rf txt/* $(winix_install_dir)/txt/
|
||||||
# locales
|
# locales
|
||||||
rm -Rf $(winix_install_dir)/locale
|
rm -Rf $(winix_install_dir)/locale
|
||||||
mkdir -p $(winix_install_dir)/locale
|
mkdir -p $(winix_install_dir)/locale
|
||||||
cp -rf locale/ $(winix_install_dir)/locale/
|
cp -rf locale/* $(winix_install_dir)/locale/
|
||||||
# plugins
|
# plugins
|
||||||
rm -Rf $(winix_install_dir)/plugins
|
rm -Rf $(winix_install_dir)/plugins
|
||||||
mkdir -p $(winix_install_dir)/plugins
|
mkdir -p $(winix_install_dir)/plugins
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
+248
-220
@@ -1,6 +1,15 @@
|
|||||||
# DO NOT DELETE
|
# DO NOT DELETE
|
||||||
|
|
||||||
acceptbaseparser.o: acceptbaseparser.h
|
acceptbaseparser.o: acceptbaseparser.h misc.h item.h
|
||||||
|
acceptbaseparser.o: ../../pikotools/space/space.h
|
||||||
|
acceptbaseparser.o: ../../pikotools/textstream/types.h
|
||||||
|
acceptbaseparser.o: ../../pikotools/date/date.h requesttypes.h
|
||||||
|
acceptbaseparser.o: ../../pikotools/textstream/textstream.h
|
||||||
|
acceptbaseparser.o: ../../pikotools/convert/convert.h
|
||||||
|
acceptbaseparser.o: ../../pikotools/convert/inttostr.h
|
||||||
|
acceptbaseparser.o: ../../pikotools/membuffer/membuffer.h
|
||||||
|
acceptbaseparser.o: ../../pikotools/textstream/types.h
|
||||||
|
acceptbaseparser.o: ../../pikotools/utf8/utf8.h winix_const.h
|
||||||
app.o: app.h config.h ../../pikotools/space/spaceparser.h
|
app.o: app.h config.h ../../pikotools/space/spaceparser.h
|
||||||
app.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
app.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
||||||
app.o: htmlfilter.h system.h job.h basethread.h synchro.h
|
app.o: htmlfilter.h system.h job.h basethread.h synchro.h
|
||||||
@@ -12,7 +21,7 @@ app.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
|||||||
app.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
app.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
||||||
app.o: ../../pikotools/membuffer/membuffer.h
|
app.o: ../../pikotools/membuffer/membuffer.h
|
||||||
app.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
app.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
||||||
app.o: ../../winix/core/error.h ../../winix/db/dbitemquery.h
|
app.o: winix_const.h ../../winix/core/error.h ../../winix/db/dbitemquery.h
|
||||||
app.o: ../../winix/core/item.h ../../winix/db/dbitemcolumns.h
|
app.o: ../../winix/core/item.h ../../winix/db/dbitemcolumns.h
|
||||||
app.o: ../../winix/core/user.h ../../winix/core/group.h
|
app.o: ../../winix/core/user.h ../../winix/core/group.h
|
||||||
app.o: ../../winix/core/dircontainer.h ../../winix/core/ugcontainer.h log.h
|
app.o: ../../winix/core/dircontainer.h ../../winix/core/ugcontainer.h log.h
|
||||||
@@ -66,18 +75,18 @@ app.o: postmultiparser.h acceptencodingparser.h acceptbaseparser.h
|
|||||||
basethread.o: basethread.h synchro.h
|
basethread.o: basethread.h synchro.h
|
||||||
bbcodeparser.o: bbcodeparser.h htmlfilter.h
|
bbcodeparser.o: bbcodeparser.h htmlfilter.h
|
||||||
compress.o: compress.h requesttypes.h ../../pikotools/textstream/textstream.h
|
compress.o: compress.h requesttypes.h ../../pikotools/textstream/textstream.h
|
||||||
compress.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
compress.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
||||||
compress.o: ../../pikotools/convert/convert.h
|
compress.o: ../../pikotools/date/date.h ../../pikotools/convert/convert.h
|
||||||
compress.o: ../../pikotools/convert/inttostr.h
|
compress.o: ../../pikotools/convert/inttostr.h
|
||||||
compress.o: ../../pikotools/membuffer/membuffer.h
|
compress.o: ../../pikotools/membuffer/membuffer.h
|
||||||
compress.o: ../../pikotools/textstream/types.h log.h textstream.h
|
compress.o: ../../pikotools/textstream/types.h log.h textstream.h
|
||||||
compress.o: logmanipulators.h slog.h cur.h request.h item.h error.h config.h
|
compress.o: logmanipulators.h slog.h cur.h request.h item.h error.h config.h
|
||||||
compress.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
compress.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
compress.o: ../../pikotools/textstream/types.h htmlfilter.h
|
compress.o: htmlfilter.h ../../winix/templates/htmltextstream.h
|
||||||
compress.o: ../../winix/templates/htmltextstream.h
|
|
||||||
compress.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
compress.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
||||||
compress.o: ../../pikotools/space/spacetojson.h session.h user.h plugindata.h
|
compress.o: winix_const.h ../../pikotools/space/spacetojson.h session.h
|
||||||
compress.o: rebus.h ipban.h mount.h ../../winix/templates/locale.h
|
compress.o: user.h plugindata.h rebus.h ipban.h mount.h
|
||||||
|
compress.o: ../../winix/templates/locale.h
|
||||||
config.o: config.h ../../pikotools/space/spaceparser.h
|
config.o: config.h ../../pikotools/space/spaceparser.h
|
||||||
config.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
config.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
||||||
config.o: htmlfilter.h log.h textstream.h logmanipulators.h
|
config.o: htmlfilter.h log.h textstream.h logmanipulators.h
|
||||||
@@ -90,9 +99,9 @@ config.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
|||||||
config.o: requesttypes.h item.h error.h
|
config.o: requesttypes.h item.h error.h
|
||||||
config.o: ../../winix/templates/htmltextstream.h
|
config.o: ../../winix/templates/htmltextstream.h
|
||||||
config.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
config.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
||||||
config.o: ../../pikotools/space/spacetojson.h session.h user.h plugindata.h
|
config.o: winix_const.h ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
config.o: rebus.h ipban.h mount.h ../../winix/templates/locale.h plugin.h
|
config.o: plugindata.h rebus.h ipban.h mount.h ../../winix/templates/locale.h
|
||||||
config.o: pluginmsg.h system.h job.h basethread.h synchro.h dirs.h
|
config.o: plugin.h pluginmsg.h system.h job.h basethread.h synchro.h dirs.h
|
||||||
config.o: dircontainer.h ../../winix/db/db.h ../../winix/db/dbbase.h
|
config.o: dircontainer.h ../../winix/db/db.h ../../winix/db/dbbase.h
|
||||||
config.o: ../../winix/db/dbconn.h ../../winix/db/dbtextstream.h
|
config.o: ../../winix/db/dbconn.h ../../winix/db/dbtextstream.h
|
||||||
config.o: ../../winix/core/error.h ../../winix/db/dbitemquery.h
|
config.o: ../../winix/core/error.h ../../winix/db/dbitemquery.h
|
||||||
@@ -151,10 +160,11 @@ crypt.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
|||||||
crypt.o: ../../pikotools/membuffer/membuffer.h
|
crypt.o: ../../pikotools/membuffer/membuffer.h
|
||||||
crypt.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
crypt.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
||||||
crypt.o: requesttypes.h item.h error.h ../../winix/templates/htmltextstream.h
|
crypt.o: requesttypes.h item.h error.h ../../winix/templates/htmltextstream.h
|
||||||
crypt.o: ../../winix/core/textstream.h misc.h
|
crypt.o: ../../winix/core/textstream.h misc.h winix_const.h
|
||||||
crypt.o: ../../pikotools/space/spacetojson.h session.h plugindata.h rebus.h
|
crypt.o: ../../pikotools/space/spacetojson.h session.h plugindata.h rebus.h
|
||||||
crypt.o: ipban.h mount.h ../../winix/templates/locale.h
|
crypt.o: ipban.h mount.h ../../winix/templates/locale.h
|
||||||
dircontainer.o: dircontainer.h item.h ../../pikotools/space/space.h
|
dircontainer.o: dircontainer.h item.h ../../pikotools/space/space.h
|
||||||
|
dircontainer.o: ../../pikotools/textstream/types.h
|
||||||
dircontainer.o: ../../pikotools/date/date.h log.h textstream.h
|
dircontainer.o: ../../pikotools/date/date.h log.h textstream.h
|
||||||
dircontainer.o: logmanipulators.h ../../pikotools/textstream/textstream.h
|
dircontainer.o: logmanipulators.h ../../pikotools/textstream/textstream.h
|
||||||
dircontainer.o: ../../pikotools/convert/convert.h
|
dircontainer.o: ../../pikotools/convert/convert.h
|
||||||
@@ -163,24 +173,24 @@ dircontainer.o: ../../pikotools/membuffer/membuffer.h
|
|||||||
dircontainer.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
dircontainer.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
||||||
dircontainer.o: requesttypes.h error.h config.h
|
dircontainer.o: requesttypes.h error.h config.h
|
||||||
dircontainer.o: ../../pikotools/space/spaceparser.h
|
dircontainer.o: ../../pikotools/space/spaceparser.h
|
||||||
dircontainer.o: ../../pikotools/space/space.h
|
dircontainer.o: ../../pikotools/space/space.h htmlfilter.h
|
||||||
dircontainer.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
dircontainer.o: ../../winix/templates/htmltextstream.h
|
dircontainer.o: ../../winix/templates/htmltextstream.h
|
||||||
dircontainer.o: ../../winix/core/textstream.h misc.h
|
dircontainer.o: ../../winix/core/textstream.h misc.h
|
||||||
dircontainer.o: ../../pikotools/utf8/utf8.h
|
dircontainer.o: ../../pikotools/utf8/utf8.h winix_const.h
|
||||||
dircontainer.o: ../../pikotools/space/spacetojson.h session.h user.h
|
dircontainer.o: ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
dircontainer.o: plugindata.h rebus.h ipban.h mount.h
|
dircontainer.o: plugindata.h rebus.h ipban.h mount.h
|
||||||
dircontainer.o: ../../winix/templates/locale.h
|
dircontainer.o: ../../winix/templates/locale.h
|
||||||
dirs.o: dirs.h item.h ../../pikotools/space/space.h
|
dirs.o: dirs.h item.h ../../pikotools/space/space.h
|
||||||
dirs.o: ../../pikotools/date/date.h dircontainer.h ../../winix/db/db.h
|
dirs.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h
|
||||||
dirs.o: ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
dirs.o: dircontainer.h ../../winix/db/db.h ../../winix/db/dbbase.h
|
||||||
dirs.o: ../../winix/db/dbtextstream.h ../../winix/core/textstream.h misc.h
|
dirs.o: ../../winix/db/dbconn.h ../../winix/db/dbtextstream.h
|
||||||
dirs.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
dirs.o: ../../winix/core/textstream.h misc.h requesttypes.h
|
||||||
|
dirs.o: ../../pikotools/textstream/textstream.h
|
||||||
dirs.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
dirs.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
||||||
dirs.o: ../../pikotools/membuffer/membuffer.h
|
dirs.o: ../../pikotools/membuffer/membuffer.h
|
||||||
dirs.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
dirs.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
||||||
dirs.o: ../../winix/core/error.h ../../pikotools/space/spaceparser.h
|
dirs.o: winix_const.h ../../winix/core/error.h
|
||||||
dirs.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
dirs.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
dirs.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
dirs.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
||||||
dirs.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
dirs.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
||||||
dirs.o: ../../winix/core/group.h ../../winix/core/dircontainer.h
|
dirs.o: ../../winix/core/group.h ../../winix/core/dircontainer.h
|
||||||
@@ -201,14 +211,15 @@ dirs.o: lastcontainer.h
|
|||||||
groups.o: groups.h group.h ugcontainer.h ../../winix/db/db.h
|
groups.o: groups.h group.h ugcontainer.h ../../winix/db/db.h
|
||||||
groups.o: ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
groups.o: ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
||||||
groups.o: ../../winix/db/dbtextstream.h ../../winix/core/textstream.h misc.h
|
groups.o: ../../winix/db/dbtextstream.h ../../winix/core/textstream.h misc.h
|
||||||
groups.o: item.h ../../pikotools/space/space.h ../../pikotools/date/date.h
|
groups.o: item.h ../../pikotools/space/space.h
|
||||||
|
groups.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h
|
||||||
groups.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
groups.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
||||||
groups.o: ../../pikotools/convert/convert.h
|
groups.o: ../../pikotools/convert/convert.h
|
||||||
groups.o: ../../pikotools/convert/inttostr.h
|
groups.o: ../../pikotools/convert/inttostr.h
|
||||||
groups.o: ../../pikotools/membuffer/membuffer.h
|
groups.o: ../../pikotools/membuffer/membuffer.h
|
||||||
groups.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
groups.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
||||||
groups.o: ../../winix/core/error.h ../../pikotools/space/spaceparser.h
|
groups.o: winix_const.h ../../winix/core/error.h
|
||||||
groups.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
groups.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
groups.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
groups.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
||||||
groups.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
groups.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
||||||
groups.o: ../../winix/core/group.h ../../winix/core/dircontainer.h
|
groups.o: ../../winix/core/group.h ../../winix/core/dircontainer.h
|
||||||
@@ -218,17 +229,27 @@ groups.o: ../../winix/templates/htmltextstream.h
|
|||||||
groups.o: ../../pikotools/space/spacetojson.h session.h user.h plugindata.h
|
groups.o: ../../pikotools/space/spacetojson.h session.h user.h plugindata.h
|
||||||
groups.o: rebus.h ipban.h mount.h ../../winix/templates/locale.h
|
groups.o: rebus.h ipban.h mount.h ../../winix/templates/locale.h
|
||||||
htmlfilter.o: htmlfilter.h
|
htmlfilter.o: htmlfilter.h
|
||||||
httpsimpleparser.o: httpsimpleparser.h
|
httpsimpleparser.o: httpsimpleparser.h misc.h item.h
|
||||||
|
httpsimpleparser.o: ../../pikotools/space/space.h
|
||||||
|
httpsimpleparser.o: ../../pikotools/textstream/types.h
|
||||||
|
httpsimpleparser.o: ../../pikotools/date/date.h requesttypes.h
|
||||||
|
httpsimpleparser.o: ../../pikotools/textstream/textstream.h
|
||||||
|
httpsimpleparser.o: ../../pikotools/convert/convert.h
|
||||||
|
httpsimpleparser.o: ../../pikotools/convert/inttostr.h
|
||||||
|
httpsimpleparser.o: ../../pikotools/membuffer/membuffer.h
|
||||||
|
httpsimpleparser.o: ../../pikotools/textstream/types.h
|
||||||
|
httpsimpleparser.o: ../../pikotools/utf8/utf8.h winix_const.h
|
||||||
image.o: image.h basethread.h synchro.h textstream.h ../../winix/db/db.h
|
image.o: image.h basethread.h synchro.h textstream.h ../../winix/db/db.h
|
||||||
image.o: ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
image.o: ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
||||||
image.o: ../../winix/db/dbtextstream.h ../../winix/core/textstream.h misc.h
|
image.o: ../../winix/db/dbtextstream.h ../../winix/core/textstream.h misc.h
|
||||||
image.o: item.h ../../pikotools/space/space.h ../../pikotools/date/date.h
|
image.o: item.h ../../pikotools/space/space.h
|
||||||
|
image.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h
|
||||||
image.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
image.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
||||||
image.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
image.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
||||||
image.o: ../../pikotools/membuffer/membuffer.h
|
image.o: ../../pikotools/membuffer/membuffer.h
|
||||||
image.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
image.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
||||||
image.o: ../../winix/core/error.h ../../pikotools/space/spaceparser.h
|
image.o: winix_const.h ../../winix/core/error.h
|
||||||
image.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
image.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
image.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
image.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
||||||
image.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
image.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
||||||
image.o: ../../winix/core/group.h ../../winix/core/dircontainer.h
|
image.o: ../../winix/core/group.h ../../winix/core/dircontainer.h
|
||||||
@@ -283,42 +304,45 @@ image.o: ../../winix/templates/htmltextstream.h
|
|||||||
image.o: ../../winix/core/sessionmanager.h lock.h
|
image.o: ../../winix/core/sessionmanager.h lock.h
|
||||||
ipbancontainer.o: ipbancontainer.h ipban.h log.h textstream.h
|
ipbancontainer.o: ipbancontainer.h ipban.h log.h textstream.h
|
||||||
ipbancontainer.o: logmanipulators.h ../../pikotools/textstream/textstream.h
|
ipbancontainer.o: logmanipulators.h ../../pikotools/textstream/textstream.h
|
||||||
ipbancontainer.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
ipbancontainer.o: ../../pikotools/space/space.h
|
||||||
|
ipbancontainer.o: ../../pikotools/textstream/types.h
|
||||||
|
ipbancontainer.o: ../../pikotools/date/date.h
|
||||||
ipbancontainer.o: ../../pikotools/convert/convert.h
|
ipbancontainer.o: ../../pikotools/convert/convert.h
|
||||||
ipbancontainer.o: ../../pikotools/convert/inttostr.h
|
ipbancontainer.o: ../../pikotools/convert/inttostr.h
|
||||||
ipbancontainer.o: ../../pikotools/membuffer/membuffer.h
|
ipbancontainer.o: ../../pikotools/membuffer/membuffer.h
|
||||||
ipbancontainer.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
ipbancontainer.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
||||||
ipbancontainer.o: requesttypes.h item.h error.h config.h
|
ipbancontainer.o: requesttypes.h item.h error.h config.h
|
||||||
ipbancontainer.o: ../../pikotools/space/spaceparser.h
|
ipbancontainer.o: ../../pikotools/space/spaceparser.h
|
||||||
ipbancontainer.o: ../../pikotools/space/space.h
|
ipbancontainer.o: ../../pikotools/space/space.h htmlfilter.h
|
||||||
ipbancontainer.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
ipbancontainer.o: ../../winix/templates/htmltextstream.h
|
ipbancontainer.o: ../../winix/templates/htmltextstream.h
|
||||||
ipbancontainer.o: ../../winix/core/textstream.h misc.h
|
ipbancontainer.o: ../../winix/core/textstream.h misc.h
|
||||||
ipbancontainer.o: ../../pikotools/utf8/utf8.h
|
ipbancontainer.o: ../../pikotools/utf8/utf8.h winix_const.h
|
||||||
ipbancontainer.o: ../../pikotools/space/spacetojson.h session.h user.h
|
ipbancontainer.o: ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
ipbancontainer.o: plugindata.h rebus.h mount.h ../../winix/templates/locale.h
|
ipbancontainer.o: plugindata.h rebus.h mount.h ../../winix/templates/locale.h
|
||||||
item.o: item.h ../../pikotools/space/space.h ../../pikotools/date/date.h
|
item.o: item.h ../../pikotools/space/space.h
|
||||||
item.o: misc.h requesttypes.h ../../pikotools/textstream/textstream.h
|
item.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h misc.h
|
||||||
|
item.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
||||||
item.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
item.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
||||||
item.o: ../../pikotools/membuffer/membuffer.h
|
item.o: ../../pikotools/membuffer/membuffer.h
|
||||||
item.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
item.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
||||||
item.o: crypt.h run.h config.h ../../pikotools/space/spaceparser.h
|
item.o: winix_const.h crypt.h run.h config.h
|
||||||
item.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
item.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
item.o: htmlfilter.h user.h
|
item.o: htmlfilter.h user.h
|
||||||
job.o: job.h basethread.h synchro.h ../../pikotools/space/space.h plugin.h
|
job.o: job.h basethread.h synchro.h ../../pikotools/space/space.h
|
||||||
job.o: pluginmsg.h log.h textstream.h logmanipulators.h
|
job.o: ../../pikotools/textstream/types.h plugin.h pluginmsg.h log.h
|
||||||
job.o: ../../pikotools/textstream/textstream.h ../../pikotools/date/date.h
|
job.o: textstream.h logmanipulators.h ../../pikotools/textstream/textstream.h
|
||||||
job.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
job.o: ../../pikotools/date/date.h ../../pikotools/convert/convert.h
|
||||||
|
job.o: ../../pikotools/convert/inttostr.h
|
||||||
job.o: ../../pikotools/membuffer/membuffer.h
|
job.o: ../../pikotools/membuffer/membuffer.h
|
||||||
job.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
job.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
||||||
job.o: requesttypes.h item.h error.h config.h
|
job.o: requesttypes.h item.h error.h config.h
|
||||||
job.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
job.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
job.o: ../../pikotools/textstream/types.h htmlfilter.h
|
job.o: htmlfilter.h ../../winix/templates/htmltextstream.h
|
||||||
job.o: ../../winix/templates/htmltextstream.h ../../winix/core/textstream.h
|
job.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
||||||
job.o: misc.h ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
job.o: winix_const.h ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
job.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
job.o: plugindata.h rebus.h ipban.h mount.h ../../winix/templates/locale.h
|
||||||
job.o: ../../winix/templates/locale.h system.h dirs.h dircontainer.h
|
job.o: system.h dirs.h dircontainer.h ../../winix/db/db.h
|
||||||
job.o: ../../winix/db/db.h ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
job.o: ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
||||||
job.o: ../../winix/db/dbtextstream.h ../../winix/core/error.h
|
job.o: ../../winix/db/dbtextstream.h ../../winix/core/error.h
|
||||||
job.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
job.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
||||||
job.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
job.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
||||||
@@ -368,62 +392,62 @@ lastcontainer.o: lastcontainer.h ../../pikotools/date/date.h log.h
|
|||||||
lastcontainer.o: textstream.h logmanipulators.h
|
lastcontainer.o: textstream.h logmanipulators.h
|
||||||
lastcontainer.o: ../../pikotools/textstream/textstream.h
|
lastcontainer.o: ../../pikotools/textstream/textstream.h
|
||||||
lastcontainer.o: ../../pikotools/space/space.h
|
lastcontainer.o: ../../pikotools/space/space.h
|
||||||
|
lastcontainer.o: ../../pikotools/textstream/types.h
|
||||||
lastcontainer.o: ../../pikotools/convert/convert.h
|
lastcontainer.o: ../../pikotools/convert/convert.h
|
||||||
lastcontainer.o: ../../pikotools/convert/inttostr.h
|
lastcontainer.o: ../../pikotools/convert/inttostr.h
|
||||||
lastcontainer.o: ../../pikotools/membuffer/membuffer.h
|
lastcontainer.o: ../../pikotools/membuffer/membuffer.h
|
||||||
lastcontainer.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
lastcontainer.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
||||||
lastcontainer.o: requesttypes.h item.h error.h config.h
|
lastcontainer.o: requesttypes.h item.h error.h config.h
|
||||||
lastcontainer.o: ../../pikotools/space/spaceparser.h
|
lastcontainer.o: ../../pikotools/space/spaceparser.h
|
||||||
lastcontainer.o: ../../pikotools/space/space.h
|
lastcontainer.o: ../../pikotools/space/space.h htmlfilter.h
|
||||||
lastcontainer.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
lastcontainer.o: ../../winix/templates/htmltextstream.h
|
lastcontainer.o: ../../winix/templates/htmltextstream.h
|
||||||
lastcontainer.o: ../../winix/core/textstream.h misc.h
|
lastcontainer.o: ../../winix/core/textstream.h misc.h
|
||||||
lastcontainer.o: ../../pikotools/utf8/utf8.h
|
lastcontainer.o: ../../pikotools/utf8/utf8.h winix_const.h
|
||||||
lastcontainer.o: ../../pikotools/space/spacetojson.h session.h user.h
|
lastcontainer.o: ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
lastcontainer.o: plugindata.h rebus.h ipban.h mount.h
|
lastcontainer.o: plugindata.h rebus.h ipban.h mount.h
|
||||||
lastcontainer.o: ../../winix/templates/locale.h
|
lastcontainer.o: ../../winix/templates/locale.h
|
||||||
loadavg.o: loadavg.h log.h textstream.h logmanipulators.h
|
loadavg.o: loadavg.h log.h textstream.h logmanipulators.h
|
||||||
loadavg.o: ../../pikotools/textstream/textstream.h
|
loadavg.o: ../../pikotools/textstream/textstream.h
|
||||||
loadavg.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
loadavg.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
||||||
loadavg.o: ../../pikotools/convert/convert.h
|
loadavg.o: ../../pikotools/date/date.h ../../pikotools/convert/convert.h
|
||||||
loadavg.o: ../../pikotools/convert/inttostr.h
|
loadavg.o: ../../pikotools/convert/inttostr.h
|
||||||
loadavg.o: ../../pikotools/membuffer/membuffer.h
|
loadavg.o: ../../pikotools/membuffer/membuffer.h
|
||||||
loadavg.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
loadavg.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
||||||
loadavg.o: requesttypes.h item.h error.h config.h
|
loadavg.o: requesttypes.h item.h error.h config.h
|
||||||
loadavg.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
loadavg.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
loadavg.o: ../../pikotools/textstream/types.h htmlfilter.h
|
loadavg.o: htmlfilter.h ../../winix/templates/htmltextstream.h
|
||||||
loadavg.o: ../../winix/templates/htmltextstream.h
|
|
||||||
loadavg.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
loadavg.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
||||||
loadavg.o: ../../pikotools/space/spacetojson.h session.h user.h plugindata.h
|
loadavg.o: winix_const.h ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
loadavg.o: rebus.h ipban.h mount.h ../../winix/templates/locale.h
|
loadavg.o: plugindata.h rebus.h ipban.h mount.h
|
||||||
|
loadavg.o: ../../winix/templates/locale.h
|
||||||
lock.o: lock.h synchro.h
|
lock.o: lock.h synchro.h
|
||||||
log.o: log.h textstream.h logmanipulators.h
|
log.o: log.h textstream.h logmanipulators.h
|
||||||
log.o: ../../pikotools/textstream/textstream.h ../../pikotools/space/space.h
|
log.o: ../../pikotools/textstream/textstream.h ../../pikotools/space/space.h
|
||||||
log.o: ../../pikotools/date/date.h ../../pikotools/convert/convert.h
|
log.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h
|
||||||
log.o: ../../pikotools/convert/inttostr.h
|
log.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
||||||
log.o: ../../pikotools/membuffer/membuffer.h
|
log.o: ../../pikotools/membuffer/membuffer.h
|
||||||
log.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
log.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
||||||
log.o: requesttypes.h item.h error.h config.h
|
log.o: requesttypes.h item.h error.h config.h
|
||||||
log.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
log.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
log.o: ../../pikotools/textstream/types.h htmlfilter.h
|
log.o: htmlfilter.h ../../winix/templates/htmltextstream.h
|
||||||
log.o: ../../winix/templates/htmltextstream.h ../../winix/core/textstream.h
|
log.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
||||||
log.o: misc.h ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
log.o: winix_const.h ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
log.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
log.o: plugindata.h rebus.h ipban.h mount.h ../../winix/templates/locale.h
|
||||||
log.o: ../../winix/templates/locale.h timezones.h timezone.h
|
log.o: timezones.h timezone.h
|
||||||
misc.o: misc.h item.h ../../pikotools/space/space.h
|
misc.o: misc.h item.h ../../pikotools/space/space.h
|
||||||
misc.o: ../../pikotools/date/date.h requesttypes.h
|
misc.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h
|
||||||
misc.o: ../../pikotools/textstream/textstream.h
|
misc.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
||||||
misc.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
misc.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
||||||
misc.o: ../../pikotools/membuffer/membuffer.h
|
misc.o: ../../pikotools/membuffer/membuffer.h
|
||||||
misc.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h log.h
|
misc.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
||||||
misc.o: textstream.h logmanipulators.h slog.h cur.h request.h error.h
|
misc.o: winix_const.h log.h textstream.h logmanipulators.h slog.h cur.h
|
||||||
misc.o: config.h ../../pikotools/space/spaceparser.h
|
misc.o: request.h error.h config.h ../../pikotools/space/spaceparser.h
|
||||||
misc.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
misc.o: ../../pikotools/space/space.h htmlfilter.h
|
||||||
misc.o: htmlfilter.h ../../winix/templates/htmltextstream.h
|
misc.o: ../../winix/templates/htmltextstream.h ../../winix/core/textstream.h
|
||||||
misc.o: ../../winix/core/textstream.h ../../pikotools/space/spacetojson.h
|
misc.o: ../../pikotools/space/spacetojson.h session.h user.h plugindata.h
|
||||||
misc.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
misc.o: rebus.h ipban.h mount.h ../../winix/templates/locale.h
|
||||||
misc.o: ../../winix/templates/locale.h ../../winix/templates/templates.h
|
misc.o: ../../winix/templates/templates.h ../../ezc/src/ezc.h
|
||||||
misc.o: ../../ezc/src/ezc.h ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
misc.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||||
misc.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
misc.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||||
misc.o: ../../ezc/src/stringconv.h ../../winix/templates/patterncacher.h
|
misc.o: ../../ezc/src/stringconv.h ../../winix/templates/patterncacher.h
|
||||||
misc.o: ../../winix/core/item.h ../../winix/templates/indexpatterns.h
|
misc.o: ../../winix/core/item.h ../../winix/templates/indexpatterns.h
|
||||||
@@ -439,30 +463,31 @@ misc.o: ../../winix/db/dbitemquery.h ../../winix/db/dbitemcolumns.h
|
|||||||
misc.o: ../../winix/core/user.h ../../winix/core/group.h
|
misc.o: ../../winix/core/user.h ../../winix/core/group.h
|
||||||
misc.o: ../../winix/core/dircontainer.h ../../winix/core/ugcontainer.h
|
misc.o: ../../winix/core/dircontainer.h ../../winix/core/ugcontainer.h
|
||||||
mount.o: mount.h misc.h item.h ../../pikotools/space/space.h
|
mount.o: mount.h misc.h item.h ../../pikotools/space/space.h
|
||||||
mount.o: ../../pikotools/date/date.h requesttypes.h
|
mount.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h
|
||||||
mount.o: ../../pikotools/textstream/textstream.h
|
mount.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
||||||
mount.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
mount.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
||||||
mount.o: ../../pikotools/membuffer/membuffer.h
|
mount.o: ../../pikotools/membuffer/membuffer.h
|
||||||
mount.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
mount.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
||||||
|
mount.o: winix_const.h
|
||||||
mountparser.o: mountparser.h mount.h item.h ../../pikotools/space/space.h
|
mountparser.o: mountparser.h mount.h item.h ../../pikotools/space/space.h
|
||||||
mountparser.o: ../../pikotools/date/date.h dirs.h dircontainer.h
|
mountparser.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h
|
||||||
mountparser.o: ../../winix/db/db.h ../../winix/db/dbbase.h
|
mountparser.o: dirs.h dircontainer.h ../../winix/db/db.h
|
||||||
mountparser.o: ../../winix/db/dbconn.h ../../winix/db/dbtextstream.h
|
mountparser.o: ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
||||||
mountparser.o: ../../winix/core/textstream.h misc.h requesttypes.h
|
mountparser.o: ../../winix/db/dbtextstream.h ../../winix/core/textstream.h
|
||||||
mountparser.o: ../../pikotools/textstream/textstream.h
|
mountparser.o: misc.h requesttypes.h ../../pikotools/textstream/textstream.h
|
||||||
mountparser.o: ../../pikotools/convert/convert.h
|
mountparser.o: ../../pikotools/convert/convert.h
|
||||||
mountparser.o: ../../pikotools/convert/inttostr.h
|
mountparser.o: ../../pikotools/convert/inttostr.h
|
||||||
mountparser.o: ../../pikotools/membuffer/membuffer.h
|
mountparser.o: ../../pikotools/membuffer/membuffer.h
|
||||||
mountparser.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
mountparser.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
||||||
mountparser.o: ../../winix/core/error.h ../../pikotools/space/spaceparser.h
|
mountparser.o: winix_const.h ../../winix/core/error.h
|
||||||
mountparser.o: ../../pikotools/space/space.h
|
mountparser.o: ../../pikotools/space/spaceparser.h
|
||||||
mountparser.o: ../../pikotools/textstream/types.h
|
mountparser.o: ../../pikotools/space/space.h ../../winix/db/dbitemquery.h
|
||||||
mountparser.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
mountparser.o: ../../winix/core/item.h ../../winix/db/dbitemcolumns.h
|
||||||
mountparser.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
mountparser.o: ../../winix/core/user.h ../../winix/core/group.h
|
||||||
mountparser.o: ../../winix/core/group.h ../../winix/core/dircontainer.h
|
mountparser.o: ../../winix/core/dircontainer.h ../../winix/core/ugcontainer.h
|
||||||
mountparser.o: ../../winix/core/ugcontainer.h log.h textstream.h
|
mountparser.o: log.h textstream.h logmanipulators.h slog.h cur.h request.h
|
||||||
mountparser.o: logmanipulators.h slog.h cur.h request.h error.h config.h
|
mountparser.o: error.h config.h htmlfilter.h
|
||||||
mountparser.o: htmlfilter.h ../../winix/templates/htmltextstream.h
|
mountparser.o: ../../winix/templates/htmltextstream.h
|
||||||
mountparser.o: ../../pikotools/space/spacetojson.h session.h user.h
|
mountparser.o: ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
mountparser.o: plugindata.h rebus.h ipban.h ../../winix/templates/locale.h
|
mountparser.o: plugindata.h rebus.h ipban.h ../../winix/templates/locale.h
|
||||||
mountparser.o: ../../winix/notify/notify.h ../../winix/notify/notifypool.h
|
mountparser.o: ../../winix/notify/notify.h ../../winix/notify/notifypool.h
|
||||||
@@ -476,17 +501,17 @@ mountparser.o: ../../winix/core/basethread.h
|
|||||||
mountparser.o: ../../winix/notify/templatesnotify.h ../../winix/core/config.h
|
mountparser.o: ../../winix/notify/templatesnotify.h ../../winix/core/config.h
|
||||||
mountparser.o: ../../winix/core/users.h ugcontainer.h lastcontainer.h
|
mountparser.o: ../../winix/core/users.h ugcontainer.h lastcontainer.h
|
||||||
mounts.o: mounts.h mount.h error.h dirs.h item.h
|
mounts.o: mounts.h mount.h error.h dirs.h item.h
|
||||||
mounts.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
mounts.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
||||||
mounts.o: dircontainer.h ../../winix/db/db.h ../../winix/db/dbbase.h
|
mounts.o: ../../pikotools/date/date.h dircontainer.h ../../winix/db/db.h
|
||||||
mounts.o: ../../winix/db/dbconn.h ../../winix/db/dbtextstream.h
|
mounts.o: ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
||||||
mounts.o: ../../winix/core/textstream.h misc.h requesttypes.h
|
mounts.o: ../../winix/db/dbtextstream.h ../../winix/core/textstream.h misc.h
|
||||||
mounts.o: ../../pikotools/textstream/textstream.h
|
mounts.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
||||||
mounts.o: ../../pikotools/convert/convert.h
|
mounts.o: ../../pikotools/convert/convert.h
|
||||||
mounts.o: ../../pikotools/convert/inttostr.h
|
mounts.o: ../../pikotools/convert/inttostr.h
|
||||||
mounts.o: ../../pikotools/membuffer/membuffer.h
|
mounts.o: ../../pikotools/membuffer/membuffer.h
|
||||||
mounts.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
mounts.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
||||||
mounts.o: ../../winix/core/error.h ../../pikotools/space/spaceparser.h
|
mounts.o: winix_const.h ../../winix/core/error.h
|
||||||
mounts.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
mounts.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
mounts.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
mounts.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
||||||
mounts.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
mounts.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
||||||
mounts.o: ../../winix/core/group.h ../../winix/core/dircontainer.h
|
mounts.o: ../../winix/core/group.h ../../winix/core/dircontainer.h
|
||||||
@@ -541,19 +566,18 @@ mounts.o: ../../winix/templates/htmltextstream.h
|
|||||||
mounts.o: ../../winix/core/sessionmanager.h
|
mounts.o: ../../winix/core/sessionmanager.h
|
||||||
plugin.o: plugin.h pluginmsg.h log.h textstream.h logmanipulators.h
|
plugin.o: plugin.h pluginmsg.h log.h textstream.h logmanipulators.h
|
||||||
plugin.o: ../../pikotools/textstream/textstream.h
|
plugin.o: ../../pikotools/textstream/textstream.h
|
||||||
plugin.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
plugin.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
||||||
plugin.o: ../../pikotools/convert/convert.h
|
plugin.o: ../../pikotools/date/date.h ../../pikotools/convert/convert.h
|
||||||
plugin.o: ../../pikotools/convert/inttostr.h
|
plugin.o: ../../pikotools/convert/inttostr.h
|
||||||
plugin.o: ../../pikotools/membuffer/membuffer.h
|
plugin.o: ../../pikotools/membuffer/membuffer.h
|
||||||
plugin.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
plugin.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
||||||
plugin.o: requesttypes.h item.h error.h config.h
|
plugin.o: requesttypes.h item.h error.h config.h
|
||||||
plugin.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
plugin.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
plugin.o: ../../pikotools/textstream/types.h htmlfilter.h
|
plugin.o: htmlfilter.h ../../winix/templates/htmltextstream.h
|
||||||
plugin.o: ../../winix/templates/htmltextstream.h
|
|
||||||
plugin.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
plugin.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
||||||
plugin.o: ../../pikotools/space/spacetojson.h session.h user.h plugindata.h
|
plugin.o: winix_const.h ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
plugin.o: rebus.h ipban.h mount.h ../../winix/templates/locale.h system.h
|
plugin.o: plugindata.h rebus.h ipban.h mount.h ../../winix/templates/locale.h
|
||||||
plugin.o: job.h basethread.h synchro.h dirs.h dircontainer.h
|
plugin.o: system.h job.h basethread.h synchro.h dirs.h dircontainer.h
|
||||||
plugin.o: ../../winix/db/db.h ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
plugin.o: ../../winix/db/db.h ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
||||||
plugin.o: ../../winix/db/dbtextstream.h ../../winix/core/error.h
|
plugin.o: ../../winix/db/dbtextstream.h ../../winix/core/error.h
|
||||||
plugin.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
plugin.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
||||||
@@ -605,28 +629,28 @@ plugin.o: ../../winix/templates/htmltextstream.h
|
|||||||
plugin.o: ../../winix/core/sessionmanager.h
|
plugin.o: ../../winix/core/sessionmanager.h
|
||||||
plugindata.o: plugindata.h plugin.h pluginmsg.h log.h textstream.h
|
plugindata.o: plugindata.h plugin.h pluginmsg.h log.h textstream.h
|
||||||
plugindata.o: logmanipulators.h ../../pikotools/textstream/textstream.h
|
plugindata.o: logmanipulators.h ../../pikotools/textstream/textstream.h
|
||||||
plugindata.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
plugindata.o: ../../pikotools/space/space.h
|
||||||
|
plugindata.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h
|
||||||
plugindata.o: ../../pikotools/convert/convert.h
|
plugindata.o: ../../pikotools/convert/convert.h
|
||||||
plugindata.o: ../../pikotools/convert/inttostr.h
|
plugindata.o: ../../pikotools/convert/inttostr.h
|
||||||
plugindata.o: ../../pikotools/membuffer/membuffer.h
|
plugindata.o: ../../pikotools/membuffer/membuffer.h
|
||||||
plugindata.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
plugindata.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
||||||
plugindata.o: requesttypes.h item.h error.h config.h
|
plugindata.o: requesttypes.h item.h error.h config.h
|
||||||
plugindata.o: ../../pikotools/space/spaceparser.h
|
plugindata.o: ../../pikotools/space/spaceparser.h
|
||||||
plugindata.o: ../../pikotools/space/space.h
|
plugindata.o: ../../pikotools/space/space.h htmlfilter.h
|
||||||
plugindata.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
plugindata.o: ../../winix/templates/htmltextstream.h
|
plugindata.o: ../../winix/templates/htmltextstream.h
|
||||||
plugindata.o: ../../winix/core/textstream.h misc.h
|
plugindata.o: ../../winix/core/textstream.h misc.h
|
||||||
plugindata.o: ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
plugindata.o: ../../pikotools/utf8/utf8.h winix_const.h
|
||||||
plugindata.o: session.h user.h rebus.h ipban.h mount.h
|
plugindata.o: ../../pikotools/space/spacetojson.h session.h user.h rebus.h
|
||||||
plugindata.o: ../../winix/templates/locale.h system.h job.h basethread.h
|
plugindata.o: ipban.h mount.h ../../winix/templates/locale.h system.h job.h
|
||||||
plugindata.o: synchro.h dirs.h dircontainer.h ../../winix/db/db.h
|
plugindata.o: basethread.h synchro.h dirs.h dircontainer.h
|
||||||
plugindata.o: ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
plugindata.o: ../../winix/db/db.h ../../winix/db/dbbase.h
|
||||||
plugindata.o: ../../winix/db/dbtextstream.h ../../winix/core/error.h
|
plugindata.o: ../../winix/db/dbconn.h ../../winix/db/dbtextstream.h
|
||||||
plugindata.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
plugindata.o: ../../winix/core/error.h ../../winix/db/dbitemquery.h
|
||||||
plugindata.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
plugindata.o: ../../winix/core/item.h ../../winix/db/dbitemcolumns.h
|
||||||
plugindata.o: ../../winix/core/group.h ../../winix/core/dircontainer.h
|
plugindata.o: ../../winix/core/user.h ../../winix/core/group.h
|
||||||
plugindata.o: ../../winix/core/ugcontainer.h ../../winix/notify/notify.h
|
plugindata.o: ../../winix/core/dircontainer.h ../../winix/core/ugcontainer.h
|
||||||
plugindata.o: ../../winix/notify/notifypool.h
|
plugindata.o: ../../winix/notify/notify.h ../../winix/notify/notifypool.h
|
||||||
plugindata.o: ../../winix/templates/patterns.h ../../winix/templates/locale.h
|
plugindata.o: ../../winix/templates/patterns.h ../../winix/templates/locale.h
|
||||||
plugindata.o: ../../winix/templates/localefilter.h ../../ezc/src/ezc.h
|
plugindata.o: ../../winix/templates/localefilter.h ../../ezc/src/ezc.h
|
||||||
plugindata.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
plugindata.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||||
@@ -673,16 +697,17 @@ plugindata.o: ../../winix/templates/htmltextstream.h
|
|||||||
plugindata.o: ../../winix/core/sessionmanager.h
|
plugindata.o: ../../winix/core/sessionmanager.h
|
||||||
postmultiparser.o: postmultiparser.h error.h requesttypes.h
|
postmultiparser.o: postmultiparser.h error.h requesttypes.h
|
||||||
postmultiparser.o: ../../pikotools/textstream/textstream.h
|
postmultiparser.o: ../../pikotools/textstream/textstream.h
|
||||||
postmultiparser.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
postmultiparser.o: ../../pikotools/space/space.h
|
||||||
|
postmultiparser.o: ../../pikotools/textstream/types.h
|
||||||
|
postmultiparser.o: ../../pikotools/date/date.h
|
||||||
postmultiparser.o: ../../pikotools/convert/convert.h
|
postmultiparser.o: ../../pikotools/convert/convert.h
|
||||||
postmultiparser.o: ../../pikotools/convert/inttostr.h
|
postmultiparser.o: ../../pikotools/convert/inttostr.h
|
||||||
postmultiparser.o: ../../pikotools/membuffer/membuffer.h
|
postmultiparser.o: ../../pikotools/membuffer/membuffer.h
|
||||||
postmultiparser.o: ../../pikotools/textstream/types.h config.h
|
postmultiparser.o: ../../pikotools/textstream/types.h config.h
|
||||||
postmultiparser.o: ../../pikotools/space/spaceparser.h
|
postmultiparser.o: ../../pikotools/space/spaceparser.h
|
||||||
postmultiparser.o: ../../pikotools/space/space.h
|
postmultiparser.o: ../../pikotools/space/space.h htmlfilter.h misc.h item.h
|
||||||
postmultiparser.o: ../../pikotools/textstream/types.h htmlfilter.h misc.h
|
postmultiparser.o: ../../pikotools/utf8/utf8.h winix_const.h log.h
|
||||||
postmultiparser.o: item.h ../../pikotools/utf8/utf8.h log.h textstream.h
|
postmultiparser.o: textstream.h logmanipulators.h slog.h cur.h request.h
|
||||||
postmultiparser.o: logmanipulators.h slog.h cur.h request.h
|
|
||||||
postmultiparser.o: ../../winix/templates/htmltextstream.h
|
postmultiparser.o: ../../winix/templates/htmltextstream.h
|
||||||
postmultiparser.o: ../../winix/core/textstream.h
|
postmultiparser.o: ../../winix/core/textstream.h
|
||||||
postmultiparser.o: ../../pikotools/space/spacetojson.h session.h user.h
|
postmultiparser.o: ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
@@ -690,39 +715,38 @@ postmultiparser.o: plugindata.h rebus.h ipban.h mount.h
|
|||||||
postmultiparser.o: ../../winix/templates/locale.h
|
postmultiparser.o: ../../winix/templates/locale.h
|
||||||
rebus.o: log.h textstream.h logmanipulators.h
|
rebus.o: log.h textstream.h logmanipulators.h
|
||||||
rebus.o: ../../pikotools/textstream/textstream.h
|
rebus.o: ../../pikotools/textstream/textstream.h
|
||||||
rebus.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
rebus.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
||||||
rebus.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
rebus.o: ../../pikotools/date/date.h ../../pikotools/convert/convert.h
|
||||||
|
rebus.o: ../../pikotools/convert/inttostr.h
|
||||||
rebus.o: ../../pikotools/membuffer/membuffer.h
|
rebus.o: ../../pikotools/membuffer/membuffer.h
|
||||||
rebus.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
rebus.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
||||||
rebus.o: requesttypes.h item.h error.h config.h
|
rebus.o: requesttypes.h item.h error.h config.h
|
||||||
rebus.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
rebus.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
rebus.o: ../../pikotools/textstream/types.h htmlfilter.h
|
rebus.o: htmlfilter.h ../../winix/templates/htmltextstream.h
|
||||||
rebus.o: ../../winix/templates/htmltextstream.h ../../winix/core/textstream.h
|
rebus.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
||||||
rebus.o: misc.h ../../pikotools/utf8/utf8.h
|
rebus.o: winix_const.h ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
rebus.o: ../../pikotools/space/spacetojson.h session.h user.h plugindata.h
|
rebus.o: plugindata.h rebus.h ipban.h mount.h ../../winix/templates/locale.h
|
||||||
rebus.o: rebus.h ipban.h mount.h ../../winix/templates/locale.h
|
|
||||||
request.o: request.h requesttypes.h ../../pikotools/textstream/textstream.h
|
request.o: request.h requesttypes.h ../../pikotools/textstream/textstream.h
|
||||||
request.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
request.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
||||||
request.o: ../../pikotools/convert/convert.h
|
request.o: ../../pikotools/date/date.h ../../pikotools/convert/convert.h
|
||||||
request.o: ../../pikotools/convert/inttostr.h
|
request.o: ../../pikotools/convert/inttostr.h
|
||||||
request.o: ../../pikotools/membuffer/membuffer.h
|
request.o: ../../pikotools/membuffer/membuffer.h
|
||||||
request.o: ../../pikotools/textstream/types.h item.h error.h config.h
|
request.o: ../../pikotools/textstream/types.h item.h error.h config.h
|
||||||
request.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
request.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
request.o: ../../pikotools/textstream/types.h htmlfilter.h textstream.h
|
request.o: htmlfilter.h textstream.h ../../winix/templates/htmltextstream.h
|
||||||
request.o: ../../winix/templates/htmltextstream.h
|
|
||||||
request.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
request.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
||||||
request.o: ../../pikotools/space/spacetojson.h log.h logmanipulators.h slog.h
|
request.o: winix_const.h ../../pikotools/space/spacetojson.h log.h
|
||||||
request.o: cur.h session.h user.h plugindata.h rebus.h ipban.h mount.h
|
request.o: logmanipulators.h slog.h cur.h session.h user.h plugindata.h
|
||||||
request.o: ../../winix/templates/locale.h plugin.h pluginmsg.h system.h job.h
|
request.o: rebus.h ipban.h mount.h ../../winix/templates/locale.h plugin.h
|
||||||
request.o: basethread.h synchro.h dirs.h dircontainer.h ../../winix/db/db.h
|
request.o: pluginmsg.h system.h job.h basethread.h synchro.h dirs.h
|
||||||
request.o: ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
request.o: dircontainer.h ../../winix/db/db.h ../../winix/db/dbbase.h
|
||||||
request.o: ../../winix/db/dbtextstream.h ../../winix/core/error.h
|
request.o: ../../winix/db/dbconn.h ../../winix/db/dbtextstream.h
|
||||||
request.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
request.o: ../../winix/core/error.h ../../winix/db/dbitemquery.h
|
||||||
request.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
request.o: ../../winix/core/item.h ../../winix/db/dbitemcolumns.h
|
||||||
request.o: ../../winix/core/group.h ../../winix/core/dircontainer.h
|
request.o: ../../winix/core/user.h ../../winix/core/group.h
|
||||||
request.o: ../../winix/core/ugcontainer.h ../../winix/notify/notify.h
|
request.o: ../../winix/core/dircontainer.h ../../winix/core/ugcontainer.h
|
||||||
request.o: ../../winix/notify/notifypool.h ../../winix/templates/patterns.h
|
request.o: ../../winix/notify/notify.h ../../winix/notify/notifypool.h
|
||||||
request.o: ../../winix/templates/locale.h
|
request.o: ../../winix/templates/patterns.h ../../winix/templates/locale.h
|
||||||
request.o: ../../winix/templates/localefilter.h ../../ezc/src/ezc.h
|
request.o: ../../winix/templates/localefilter.h ../../ezc/src/ezc.h
|
||||||
request.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
request.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||||
request.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
request.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||||
@@ -767,57 +791,57 @@ request.o: ../../winix/templates/htmltextstream.h
|
|||||||
request.o: ../../winix/core/sessionmanager.h
|
request.o: ../../winix/core/sessionmanager.h
|
||||||
run.o: run.h log.h textstream.h logmanipulators.h
|
run.o: run.h log.h textstream.h logmanipulators.h
|
||||||
run.o: ../../pikotools/textstream/textstream.h ../../pikotools/space/space.h
|
run.o: ../../pikotools/textstream/textstream.h ../../pikotools/space/space.h
|
||||||
run.o: ../../pikotools/date/date.h ../../pikotools/convert/convert.h
|
run.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h
|
||||||
run.o: ../../pikotools/convert/inttostr.h
|
run.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
||||||
run.o: ../../pikotools/membuffer/membuffer.h
|
run.o: ../../pikotools/membuffer/membuffer.h
|
||||||
run.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
run.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
||||||
run.o: requesttypes.h item.h error.h config.h
|
run.o: requesttypes.h item.h error.h config.h
|
||||||
run.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
run.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
run.o: ../../pikotools/textstream/types.h htmlfilter.h
|
run.o: htmlfilter.h ../../winix/templates/htmltextstream.h
|
||||||
run.o: ../../winix/templates/htmltextstream.h ../../winix/core/textstream.h
|
run.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
||||||
run.o: misc.h ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
run.o: winix_const.h ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
run.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
run.o: plugindata.h rebus.h ipban.h mount.h ../../winix/templates/locale.h
|
||||||
run.o: ../../winix/templates/locale.h
|
|
||||||
session.o: session.h item.h ../../pikotools/space/space.h
|
session.o: session.h item.h ../../pikotools/space/space.h
|
||||||
session.o: ../../pikotools/date/date.h error.h user.h plugindata.h rebus.h
|
session.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h
|
||||||
session.o: textstream.h ipban.h misc.h requesttypes.h
|
session.o: error.h user.h plugindata.h rebus.h textstream.h ipban.h misc.h
|
||||||
session.o: ../../pikotools/textstream/textstream.h
|
session.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
||||||
session.o: ../../pikotools/convert/convert.h
|
session.o: ../../pikotools/convert/convert.h
|
||||||
session.o: ../../pikotools/convert/inttostr.h
|
session.o: ../../pikotools/convert/inttostr.h
|
||||||
session.o: ../../pikotools/membuffer/membuffer.h
|
session.o: ../../pikotools/membuffer/membuffer.h
|
||||||
session.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
session.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
||||||
|
session.o: winix_const.h
|
||||||
sessioncontainer.o: sessioncontainer.h session.h item.h
|
sessioncontainer.o: sessioncontainer.h session.h item.h
|
||||||
sessioncontainer.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
sessioncontainer.o: ../../pikotools/space/space.h
|
||||||
sessioncontainer.o: error.h user.h plugindata.h rebus.h textstream.h ipban.h
|
sessioncontainer.o: ../../pikotools/textstream/types.h
|
||||||
sessioncontainer.o: cur.h request.h requesttypes.h
|
sessioncontainer.o: ../../pikotools/date/date.h error.h user.h plugindata.h
|
||||||
sessioncontainer.o: ../../pikotools/textstream/textstream.h
|
sessioncontainer.o: rebus.h textstream.h ipban.h cur.h request.h
|
||||||
|
sessioncontainer.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
||||||
sessioncontainer.o: ../../pikotools/convert/convert.h
|
sessioncontainer.o: ../../pikotools/convert/convert.h
|
||||||
sessioncontainer.o: ../../pikotools/convert/inttostr.h
|
sessioncontainer.o: ../../pikotools/convert/inttostr.h
|
||||||
sessioncontainer.o: ../../pikotools/membuffer/membuffer.h
|
sessioncontainer.o: ../../pikotools/membuffer/membuffer.h
|
||||||
sessioncontainer.o: ../../pikotools/textstream/types.h config.h
|
sessioncontainer.o: ../../pikotools/textstream/types.h config.h
|
||||||
sessioncontainer.o: ../../pikotools/space/spaceparser.h
|
sessioncontainer.o: ../../pikotools/space/spaceparser.h
|
||||||
sessioncontainer.o: ../../pikotools/space/space.h
|
sessioncontainer.o: ../../pikotools/space/space.h htmlfilter.h
|
||||||
sessioncontainer.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
sessioncontainer.o: ../../winix/templates/htmltextstream.h
|
sessioncontainer.o: ../../winix/templates/htmltextstream.h
|
||||||
sessioncontainer.o: ../../winix/core/textstream.h misc.h
|
sessioncontainer.o: ../../winix/core/textstream.h misc.h
|
||||||
sessioncontainer.o: ../../pikotools/utf8/utf8.h
|
sessioncontainer.o: ../../pikotools/utf8/utf8.h winix_const.h
|
||||||
sessioncontainer.o: ../../pikotools/space/spacetojson.h mount.h log.h
|
sessioncontainer.o: ../../pikotools/space/spacetojson.h mount.h log.h
|
||||||
sessioncontainer.o: logmanipulators.h slog.h ../../winix/templates/locale.h
|
sessioncontainer.o: logmanipulators.h slog.h ../../winix/templates/locale.h
|
||||||
sessionmanager.o: sessionmanager.h sessioncontainer.h session.h item.h
|
sessionmanager.o: sessionmanager.h sessioncontainer.h session.h item.h
|
||||||
sessionmanager.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
sessionmanager.o: ../../pikotools/space/space.h
|
||||||
sessionmanager.o: error.h user.h plugindata.h rebus.h textstream.h ipban.h
|
sessionmanager.o: ../../pikotools/textstream/types.h
|
||||||
sessionmanager.o: cur.h request.h requesttypes.h
|
sessionmanager.o: ../../pikotools/date/date.h error.h user.h plugindata.h
|
||||||
|
sessionmanager.o: rebus.h textstream.h ipban.h cur.h request.h requesttypes.h
|
||||||
sessionmanager.o: ../../pikotools/textstream/textstream.h
|
sessionmanager.o: ../../pikotools/textstream/textstream.h
|
||||||
sessionmanager.o: ../../pikotools/convert/convert.h
|
sessionmanager.o: ../../pikotools/convert/convert.h
|
||||||
sessionmanager.o: ../../pikotools/convert/inttostr.h
|
sessionmanager.o: ../../pikotools/convert/inttostr.h
|
||||||
sessionmanager.o: ../../pikotools/membuffer/membuffer.h
|
sessionmanager.o: ../../pikotools/membuffer/membuffer.h
|
||||||
sessionmanager.o: ../../pikotools/textstream/types.h config.h
|
sessionmanager.o: ../../pikotools/textstream/types.h config.h
|
||||||
sessionmanager.o: ../../pikotools/space/spaceparser.h
|
sessionmanager.o: ../../pikotools/space/spaceparser.h
|
||||||
sessionmanager.o: ../../pikotools/space/space.h
|
sessionmanager.o: ../../pikotools/space/space.h htmlfilter.h
|
||||||
sessionmanager.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
sessionmanager.o: ../../winix/templates/htmltextstream.h
|
sessionmanager.o: ../../winix/templates/htmltextstream.h
|
||||||
sessionmanager.o: ../../winix/core/textstream.h misc.h
|
sessionmanager.o: ../../winix/core/textstream.h misc.h
|
||||||
sessionmanager.o: ../../pikotools/utf8/utf8.h
|
sessionmanager.o: ../../pikotools/utf8/utf8.h winix_const.h
|
||||||
sessionmanager.o: ../../pikotools/space/spacetojson.h mount.h
|
sessionmanager.o: ../../pikotools/space/spacetojson.h mount.h
|
||||||
sessionmanager.o: ipbancontainer.h lastcontainer.h system.h job.h
|
sessionmanager.o: ipbancontainer.h lastcontainer.h system.h job.h
|
||||||
sessionmanager.o: basethread.h synchro.h dirs.h dircontainer.h
|
sessionmanager.o: basethread.h synchro.h dirs.h dircontainer.h
|
||||||
@@ -884,47 +908,48 @@ sessionmanager.o: ../../winix/templates/changepatterns.h
|
|||||||
sessionmanager.o: ../../winix/templates/htmltextstream.h
|
sessionmanager.o: ../../winix/templates/htmltextstream.h
|
||||||
sessionmanager.o: ../../winix/core/sessionmanager.h
|
sessionmanager.o: ../../winix/core/sessionmanager.h
|
||||||
sessionparser.o: sessionparser.h session.h item.h
|
sessionparser.o: sessionparser.h session.h item.h
|
||||||
sessionparser.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
sessionparser.o: ../../pikotools/space/space.h
|
||||||
sessionparser.o: error.h user.h plugindata.h rebus.h textstream.h ipban.h
|
sessionparser.o: ../../pikotools/textstream/types.h
|
||||||
sessionparser.o: sessioncontainer.h cur.h request.h requesttypes.h
|
sessionparser.o: ../../pikotools/date/date.h error.h user.h plugindata.h
|
||||||
|
sessionparser.o: rebus.h textstream.h ipban.h sessioncontainer.h cur.h
|
||||||
|
sessionparser.o: request.h requesttypes.h
|
||||||
sessionparser.o: ../../pikotools/textstream/textstream.h
|
sessionparser.o: ../../pikotools/textstream/textstream.h
|
||||||
sessionparser.o: ../../pikotools/convert/convert.h
|
sessionparser.o: ../../pikotools/convert/convert.h
|
||||||
sessionparser.o: ../../pikotools/convert/inttostr.h
|
sessionparser.o: ../../pikotools/convert/inttostr.h
|
||||||
sessionparser.o: ../../pikotools/membuffer/membuffer.h
|
sessionparser.o: ../../pikotools/membuffer/membuffer.h
|
||||||
sessionparser.o: ../../pikotools/textstream/types.h config.h
|
sessionparser.o: ../../pikotools/textstream/types.h config.h
|
||||||
sessionparser.o: ../../pikotools/space/spaceparser.h
|
sessionparser.o: ../../pikotools/space/spaceparser.h
|
||||||
sessionparser.o: ../../pikotools/space/space.h
|
sessionparser.o: ../../pikotools/space/space.h htmlfilter.h
|
||||||
sessionparser.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
sessionparser.o: ../../winix/templates/htmltextstream.h
|
sessionparser.o: ../../winix/templates/htmltextstream.h
|
||||||
sessionparser.o: ../../winix/core/textstream.h misc.h
|
sessionparser.o: ../../winix/core/textstream.h misc.h
|
||||||
sessionparser.o: ../../pikotools/utf8/utf8.h
|
sessionparser.o: ../../pikotools/utf8/utf8.h winix_const.h
|
||||||
sessionparser.o: ../../pikotools/space/spacetojson.h mount.h users.h log.h
|
sessionparser.o: ../../pikotools/space/spacetojson.h mount.h users.h log.h
|
||||||
sessionparser.o: logmanipulators.h slog.h ../../winix/templates/locale.h
|
sessionparser.o: logmanipulators.h slog.h ../../winix/templates/locale.h
|
||||||
slog.o: slog.h cur.h request.h requesttypes.h
|
slog.o: slog.h cur.h request.h requesttypes.h
|
||||||
slog.o: ../../pikotools/textstream/textstream.h ../../pikotools/space/space.h
|
slog.o: ../../pikotools/textstream/textstream.h ../../pikotools/space/space.h
|
||||||
slog.o: ../../pikotools/date/date.h ../../pikotools/convert/convert.h
|
slog.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h
|
||||||
slog.o: ../../pikotools/convert/inttostr.h
|
slog.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
||||||
slog.o: ../../pikotools/membuffer/membuffer.h
|
slog.o: ../../pikotools/membuffer/membuffer.h
|
||||||
slog.o: ../../pikotools/textstream/types.h item.h error.h config.h
|
slog.o: ../../pikotools/textstream/types.h item.h error.h config.h
|
||||||
slog.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
slog.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
slog.o: ../../pikotools/textstream/types.h htmlfilter.h textstream.h
|
slog.o: htmlfilter.h textstream.h ../../winix/templates/htmltextstream.h
|
||||||
slog.o: ../../winix/templates/htmltextstream.h ../../winix/core/textstream.h
|
slog.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
||||||
slog.o: misc.h ../../pikotools/utf8/utf8.h
|
slog.o: winix_const.h ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
slog.o: ../../pikotools/space/spacetojson.h session.h user.h plugindata.h
|
slog.o: plugindata.h rebus.h ipban.h mount.h logmanipulators.h
|
||||||
slog.o: rebus.h ipban.h mount.h logmanipulators.h
|
|
||||||
slog.o: ../../winix/templates/locale.h
|
slog.o: ../../winix/templates/locale.h
|
||||||
synchro.o: synchro.h
|
synchro.o: synchro.h
|
||||||
system.o: system.h job.h basethread.h synchro.h ../../pikotools/space/space.h
|
system.o: system.h job.h basethread.h synchro.h ../../pikotools/space/space.h
|
||||||
system.o: dirs.h item.h ../../pikotools/date/date.h dircontainer.h
|
system.o: ../../pikotools/textstream/types.h dirs.h item.h
|
||||||
system.o: ../../winix/db/db.h ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
system.o: ../../pikotools/date/date.h dircontainer.h ../../winix/db/db.h
|
||||||
|
system.o: ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
||||||
system.o: ../../winix/db/dbtextstream.h ../../winix/core/textstream.h misc.h
|
system.o: ../../winix/db/dbtextstream.h ../../winix/core/textstream.h misc.h
|
||||||
system.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
system.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
||||||
system.o: ../../pikotools/convert/convert.h
|
system.o: ../../pikotools/convert/convert.h
|
||||||
system.o: ../../pikotools/convert/inttostr.h
|
system.o: ../../pikotools/convert/inttostr.h
|
||||||
system.o: ../../pikotools/membuffer/membuffer.h
|
system.o: ../../pikotools/membuffer/membuffer.h
|
||||||
system.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
system.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
||||||
system.o: ../../winix/core/error.h ../../pikotools/space/spaceparser.h
|
system.o: winix_const.h ../../winix/core/error.h
|
||||||
system.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
system.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
system.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
system.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
||||||
system.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
system.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
||||||
system.o: ../../winix/core/group.h ../../winix/core/dircontainer.h
|
system.o: ../../winix/core/group.h ../../winix/core/dircontainer.h
|
||||||
@@ -977,40 +1002,42 @@ system.o: ../../winix/functions/vim.h plugin.h pluginmsg.h sessionmanager.h
|
|||||||
system.o: sessioncontainer.h ipbancontainer.h
|
system.o: sessioncontainer.h ipbancontainer.h
|
||||||
threadmanager.o: threadmanager.h basethread.h synchro.h log.h textstream.h
|
threadmanager.o: threadmanager.h basethread.h synchro.h log.h textstream.h
|
||||||
threadmanager.o: logmanipulators.h ../../pikotools/textstream/textstream.h
|
threadmanager.o: logmanipulators.h ../../pikotools/textstream/textstream.h
|
||||||
threadmanager.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
threadmanager.o: ../../pikotools/space/space.h
|
||||||
|
threadmanager.o: ../../pikotools/textstream/types.h
|
||||||
|
threadmanager.o: ../../pikotools/date/date.h
|
||||||
threadmanager.o: ../../pikotools/convert/convert.h
|
threadmanager.o: ../../pikotools/convert/convert.h
|
||||||
threadmanager.o: ../../pikotools/convert/inttostr.h
|
threadmanager.o: ../../pikotools/convert/inttostr.h
|
||||||
threadmanager.o: ../../pikotools/membuffer/membuffer.h
|
threadmanager.o: ../../pikotools/membuffer/membuffer.h
|
||||||
threadmanager.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
threadmanager.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
||||||
threadmanager.o: requesttypes.h item.h error.h config.h
|
threadmanager.o: requesttypes.h item.h error.h config.h
|
||||||
threadmanager.o: ../../pikotools/space/spaceparser.h
|
threadmanager.o: ../../pikotools/space/spaceparser.h
|
||||||
threadmanager.o: ../../pikotools/space/space.h
|
threadmanager.o: ../../pikotools/space/space.h htmlfilter.h
|
||||||
threadmanager.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
threadmanager.o: ../../winix/templates/htmltextstream.h
|
threadmanager.o: ../../winix/templates/htmltextstream.h
|
||||||
threadmanager.o: ../../winix/core/textstream.h misc.h
|
threadmanager.o: ../../winix/core/textstream.h misc.h
|
||||||
threadmanager.o: ../../pikotools/utf8/utf8.h
|
threadmanager.o: ../../pikotools/utf8/utf8.h winix_const.h
|
||||||
threadmanager.o: ../../pikotools/space/spacetojson.h session.h user.h
|
threadmanager.o: ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
threadmanager.o: plugindata.h rebus.h ipban.h mount.h
|
threadmanager.o: plugindata.h rebus.h ipban.h mount.h
|
||||||
threadmanager.o: ../../winix/templates/locale.h
|
threadmanager.o: ../../winix/templates/locale.h
|
||||||
timezone.o: timezone.h ../../pikotools/date/date.h
|
timezone.o: timezone.h ../../pikotools/date/date.h
|
||||||
timezone.o: ../../pikotools/space/space.h misc.h item.h requesttypes.h
|
timezone.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
||||||
|
timezone.o: misc.h item.h requesttypes.h
|
||||||
timezone.o: ../../pikotools/textstream/textstream.h
|
timezone.o: ../../pikotools/textstream/textstream.h
|
||||||
timezone.o: ../../pikotools/convert/convert.h
|
timezone.o: ../../pikotools/convert/convert.h
|
||||||
timezone.o: ../../pikotools/convert/inttostr.h
|
timezone.o: ../../pikotools/convert/inttostr.h
|
||||||
timezone.o: ../../pikotools/membuffer/membuffer.h
|
timezone.o: ../../pikotools/membuffer/membuffer.h
|
||||||
timezone.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
timezone.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
||||||
|
timezone.o: winix_const.h
|
||||||
timezones.o: timezones.h timezone.h ../../pikotools/date/date.h
|
timezones.o: timezones.h timezone.h ../../pikotools/date/date.h
|
||||||
timezones.o: ../../pikotools/space/space.h
|
|
||||||
timezones.o: ../../pikotools/space/spaceparser.h
|
|
||||||
timezones.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
timezones.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
||||||
timezones.o: misc.h item.h requesttypes.h
|
timezones.o: ../../pikotools/space/spaceparser.h
|
||||||
|
timezones.o: ../../pikotools/space/space.h misc.h item.h requesttypes.h
|
||||||
timezones.o: ../../pikotools/textstream/textstream.h
|
timezones.o: ../../pikotools/textstream/textstream.h
|
||||||
timezones.o: ../../pikotools/convert/convert.h
|
timezones.o: ../../pikotools/convert/convert.h
|
||||||
timezones.o: ../../pikotools/convert/inttostr.h
|
timezones.o: ../../pikotools/convert/inttostr.h
|
||||||
timezones.o: ../../pikotools/membuffer/membuffer.h
|
timezones.o: ../../pikotools/membuffer/membuffer.h
|
||||||
timezones.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
timezones.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
||||||
timezones.o: log.h textstream.h logmanipulators.h slog.h cur.h request.h
|
timezones.o: winix_const.h log.h textstream.h logmanipulators.h slog.h cur.h
|
||||||
timezones.o: error.h config.h htmlfilter.h
|
timezones.o: request.h error.h config.h htmlfilter.h
|
||||||
timezones.o: ../../winix/templates/htmltextstream.h
|
timezones.o: ../../winix/templates/htmltextstream.h
|
||||||
timezones.o: ../../winix/core/textstream.h
|
timezones.o: ../../winix/core/textstream.h
|
||||||
timezones.o: ../../pikotools/space/spacetojson.h session.h user.h
|
timezones.o: ../../pikotools/space/spacetojson.h session.h user.h
|
||||||
@@ -1018,35 +1045,36 @@ timezones.o: plugindata.h rebus.h ipban.h mount.h
|
|||||||
timezones.o: ../../winix/templates/locale.h
|
timezones.o: ../../winix/templates/locale.h
|
||||||
user.o: user.h
|
user.o: user.h
|
||||||
users.o: users.h sessionmanager.h sessioncontainer.h session.h item.h
|
users.o: users.h sessionmanager.h sessioncontainer.h session.h item.h
|
||||||
users.o: ../../pikotools/space/space.h ../../pikotools/date/date.h error.h
|
users.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
||||||
users.o: user.h plugindata.h rebus.h textstream.h ipban.h cur.h request.h
|
users.o: ../../pikotools/date/date.h error.h user.h plugindata.h rebus.h
|
||||||
users.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
users.o: textstream.h ipban.h cur.h request.h requesttypes.h
|
||||||
|
users.o: ../../pikotools/textstream/textstream.h
|
||||||
users.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
users.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
||||||
users.o: ../../pikotools/membuffer/membuffer.h
|
users.o: ../../pikotools/membuffer/membuffer.h
|
||||||
users.o: ../../pikotools/textstream/types.h config.h
|
users.o: ../../pikotools/textstream/types.h config.h
|
||||||
users.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
users.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||||
users.o: ../../pikotools/textstream/types.h htmlfilter.h
|
users.o: htmlfilter.h ../../winix/templates/htmltextstream.h
|
||||||
users.o: ../../winix/templates/htmltextstream.h ../../winix/core/textstream.h
|
users.o: ../../winix/core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
||||||
users.o: misc.h ../../pikotools/utf8/utf8.h
|
users.o: winix_const.h ../../pikotools/space/spacetojson.h mount.h
|
||||||
users.o: ../../pikotools/space/spacetojson.h mount.h ipbancontainer.h
|
users.o: ipbancontainer.h lastcontainer.h system.h job.h basethread.h
|
||||||
users.o: lastcontainer.h system.h job.h basethread.h synchro.h dirs.h
|
users.o: synchro.h dirs.h dircontainer.h ../../winix/db/db.h
|
||||||
users.o: dircontainer.h ../../winix/db/db.h ../../winix/db/dbbase.h
|
users.o: ../../winix/db/dbbase.h ../../winix/db/dbconn.h
|
||||||
users.o: ../../winix/db/dbconn.h ../../winix/db/dbtextstream.h
|
users.o: ../../winix/db/dbtextstream.h ../../winix/core/error.h
|
||||||
users.o: ../../winix/core/error.h ../../winix/db/dbitemquery.h
|
users.o: ../../winix/db/dbitemquery.h ../../winix/core/item.h
|
||||||
users.o: ../../winix/core/item.h ../../winix/db/dbitemcolumns.h
|
users.o: ../../winix/db/dbitemcolumns.h ../../winix/core/user.h
|
||||||
users.o: ../../winix/core/user.h ../../winix/core/group.h
|
users.o: ../../winix/core/group.h ../../winix/core/dircontainer.h
|
||||||
users.o: ../../winix/core/dircontainer.h ../../winix/core/ugcontainer.h log.h
|
users.o: ../../winix/core/ugcontainer.h log.h logmanipulators.h slog.h
|
||||||
users.o: logmanipulators.h slog.h ../../winix/templates/locale.h
|
users.o: ../../winix/templates/locale.h ../../winix/notify/notify.h
|
||||||
users.o: ../../winix/notify/notify.h ../../winix/notify/notifypool.h
|
users.o: ../../winix/notify/notifypool.h ../../winix/templates/patterns.h
|
||||||
users.o: ../../winix/templates/patterns.h ../../winix/templates/locale.h
|
users.o: ../../winix/templates/locale.h ../../winix/templates/localefilter.h
|
||||||
users.o: ../../winix/templates/localefilter.h ../../ezc/src/ezc.h
|
users.o: ../../ezc/src/ezc.h ../../ezc/src/generator.h
|
||||||
users.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
users.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
||||||
users.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
users.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
||||||
users.o: ../../ezc/src/stringconv.h ../../winix/notify/notifythread.h
|
users.o: ../../winix/notify/notifythread.h ../../winix/core/basethread.h
|
||||||
users.o: ../../winix/core/basethread.h ../../winix/notify/templatesnotify.h
|
users.o: ../../winix/notify/templatesnotify.h ../../winix/core/config.h
|
||||||
users.o: ../../winix/core/config.h ../../winix/core/users.h ugcontainer.h
|
users.o: ../../winix/core/users.h ugcontainer.h mounts.h mountparser.h
|
||||||
users.o: mounts.h mountparser.h crypt.h run.h groups.h group.h loadavg.h
|
users.o: crypt.h run.h groups.h group.h loadavg.h image.h threadmanager.h
|
||||||
users.o: image.h threadmanager.h timezones.h timezone.h plugin.h pluginmsg.h
|
users.o: timezones.h timezone.h plugin.h pluginmsg.h
|
||||||
users.o: ../../winix/functions/functions.h
|
users.o: ../../winix/functions/functions.h
|
||||||
users.o: ../../winix/functions/functionbase.h ../../winix/core/request.h
|
users.o: ../../winix/functions/functionbase.h ../../winix/core/request.h
|
||||||
users.o: ../../winix/core/system.h ../../winix/core/synchro.h
|
users.o: ../../winix/core/system.h ../../winix/core/synchro.h
|
||||||
|
|||||||
+49
-25
@@ -1,14 +1,46 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <wchar.h>
|
||||||
#include "acceptbaseparser.h"
|
#include "acceptbaseparser.h"
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -28,28 +60,11 @@ void AcceptBaseParser::SkipWhite()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AcceptBaseParser::RemoveWhiteFromEnd(std::string & str)
|
|
||||||
{
|
|
||||||
if( str.empty() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
size_t i = str.size() - 1;
|
|
||||||
|
|
||||||
for( ; i!=0 && IsWhite(str[i]) ; --i);
|
|
||||||
|
|
||||||
if( !IsWhite(str[i]) )
|
|
||||||
++i;
|
|
||||||
|
|
||||||
if( i < str.size() )
|
|
||||||
str.erase(i); // erasing until the end of the string
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AcceptBaseParser::ReadParameter()
|
void AcceptBaseParser::ReadParameter()
|
||||||
{
|
{
|
||||||
param.clear();
|
param.clear();
|
||||||
|
|
||||||
SkipWhite();
|
SkipWhite();
|
||||||
|
|
||||||
while( *text!=0 && *text!=',' && *text!=';' )
|
while( *text!=0 && *text!=',' && *text!=';' )
|
||||||
@@ -58,14 +73,13 @@ void AcceptBaseParser::ReadParameter()
|
|||||||
++text;
|
++text;
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveWhiteFromEnd(param);
|
TrimWhite(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AcceptBaseParser::ReadQ()
|
void AcceptBaseParser::ReadQ()
|
||||||
{
|
{
|
||||||
q = 1.0;
|
q = 1.0;
|
||||||
|
|
||||||
SkipWhite();
|
SkipWhite();
|
||||||
|
|
||||||
if( *text != ';' )
|
if( *text != ';' )
|
||||||
@@ -83,7 +97,7 @@ void AcceptBaseParser::ReadQ()
|
|||||||
++text; // skipping '='
|
++text; // skipping '='
|
||||||
|
|
||||||
SkipWhite();
|
SkipWhite();
|
||||||
q = strtod(text, (char**)&text);
|
q = wcstod(text, (wchar_t**)&text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -97,7 +111,7 @@ void AcceptBaseParser::SkipParam()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AcceptBaseParser::Parse(const char * str)
|
void AcceptBaseParser::Parse(const wchar_t * str)
|
||||||
{
|
{
|
||||||
text = str;
|
text = str;
|
||||||
Init();
|
Init();
|
||||||
@@ -112,3 +126,13 @@ void AcceptBaseParser::Parse(const char * str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void AcceptBaseParser::Parse(const std::wstring & str)
|
||||||
|
{
|
||||||
|
Parse(str.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+42
-9
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_acceptbaseparser
|
#ifndef headerfile_winix_core_acceptbaseparser
|
||||||
@@ -13,35 +38,43 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// sample (you must create your own class derived from this one):
|
// sample (you must create your own class derived from this one):
|
||||||
// object.Parse(" text/html ; , ; q = 45, application / xhtml+xml ; q = 0.4 , application/xml ; q = 0.9 , */* ; q = 0.8 ");
|
// object.Parse(L" text/html ; , ; q = 45, application / xhtml+xml ; q = 0.4 , application/xml ; q = 0.9 , */* ; q = 0.8 ");
|
||||||
class AcceptBaseParser
|
class AcceptBaseParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void Parse(const char * str);
|
void Parse(const wchar_t * str);
|
||||||
|
void Parse(const std::wstring & str);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
virtual void Init() {} ;
|
virtual void Init() {} ;
|
||||||
virtual void Param(const std::string & param, double q) = 0;
|
virtual void Param(const std::wstring & param, double q) = 0;
|
||||||
|
|
||||||
bool IsWhite(int c);
|
bool IsWhite(int c);
|
||||||
void SkipWhite();
|
void SkipWhite();
|
||||||
void RemoveWhiteFromEnd(std::string & str);
|
|
||||||
void ReadParameter();
|
void ReadParameter();
|
||||||
void ReadQ();
|
void ReadQ();
|
||||||
void SkipParam();
|
void SkipParam();
|
||||||
|
|
||||||
|
|
||||||
const char * text;
|
const wchar_t * text;
|
||||||
std::string param;
|
std::wstring param;
|
||||||
double q;
|
double q;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_acceptencodingparser
|
#ifndef headerfile_winix_core_acceptencodingparser
|
||||||
@@ -14,6 +39,11 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class AcceptEncodingParser : public AcceptBaseParser
|
class AcceptEncodingParser : public AcceptBaseParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -30,7 +60,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ParseAndLog(const char * str)
|
void ParseAndLog(const wchar_t * str)
|
||||||
{
|
{
|
||||||
Parse(str);
|
Parse(str);
|
||||||
|
|
||||||
@@ -54,6 +84,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ParseAndLog(const std::wstring & str)
|
||||||
|
{
|
||||||
|
ParseAndLog(str.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void Init()
|
void Init()
|
||||||
@@ -63,14 +99,14 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Param(const std::string & param, double q)
|
void Param(const std::wstring & param, double q)
|
||||||
{
|
{
|
||||||
if( param=="deflate" && q!=0.0 )
|
if( param == L"deflate" && q!=0.0 )
|
||||||
{
|
{
|
||||||
accept_deflate = true;
|
accept_deflate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( param=="gzip" && q!=0.0 )
|
if( param == L"gzip" && q!=0.0 )
|
||||||
{
|
{
|
||||||
accept_gzip = true;
|
accept_gzip = true;
|
||||||
}
|
}
|
||||||
@@ -82,4 +118,7 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+598
-277
File diff suppressed because it is too large
Load Diff
+78
-28
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2010-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_app
|
#ifndef headerfile_winix_core_app
|
||||||
@@ -37,6 +62,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class App
|
class App
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -87,7 +118,7 @@ public:
|
|||||||
Functions functions;
|
Functions functions;
|
||||||
|
|
||||||
// false at the beginning
|
// false at the beginning
|
||||||
// !! moze to do loggera dac?
|
// !! IMPROVE ME moze to do loggera dac?
|
||||||
bool stdout_is_closed;
|
bool stdout_is_closed;
|
||||||
|
|
||||||
|
|
||||||
@@ -112,18 +143,23 @@ private:
|
|||||||
CookieParser cookie_parser;
|
CookieParser cookie_parser;
|
||||||
AcceptEncodingParser accept_encoding_parser;
|
AcceptEncodingParser accept_encoding_parser;
|
||||||
Compress compress;
|
Compress compress;
|
||||||
std::wstring clean_html, html_with_debug;
|
|
||||||
FCGX_Request fcgi_request;
|
FCGX_Request fcgi_request;
|
||||||
int fcgi_socket;
|
int fcgi_socket;
|
||||||
Synchro synchro;
|
Synchro synchro;
|
||||||
pthread_t signal_thread;
|
pthread_t signal_thread;
|
||||||
std::string url_to_fetch_on_exit;
|
std::string url_to_fetch_on_exit;
|
||||||
std::string source_a;
|
|
||||||
std::string sendh_t, sendh_t2, sendh_t3;
|
|
||||||
std::string sendfilea, sendfile2a;
|
|
||||||
std::string send_data_buf;
|
std::string send_data_buf;
|
||||||
PT::SpaceToJSON ajax_generic_serializer;
|
PT::SpaceToJSON json_generic_serializer;
|
||||||
|
TextStream<std::wstring> json_out_stream;
|
||||||
|
std::string aheader_name, aheader_value;
|
||||||
|
std::wstring html_filtered;
|
||||||
|
std::string output_8bit;
|
||||||
|
BinaryPage compressed_output;
|
||||||
|
|
||||||
|
bool InitFCGI(char * sock, char * sock_user, char * sock_group);
|
||||||
|
bool InitFCGIChmodChownSocket(char * sock, char * sock_user, char * sock_group);
|
||||||
|
bool DropPrivileges(char * user, char * group);
|
||||||
|
bool DropPrivileges(const char * user, uid_t uid, gid_t gid, bool additional_groups);
|
||||||
bool CheckAccessFromPlugins();
|
bool CheckAccessFromPlugins();
|
||||||
void ProcessRequestThrow();
|
void ProcessRequestThrow();
|
||||||
void ProcessRequest();
|
void ProcessRequest();
|
||||||
@@ -134,60 +170,74 @@ private:
|
|||||||
void CheckPostRedirect();
|
void CheckPostRedirect();
|
||||||
void MakePage();
|
void MakePage();
|
||||||
void Make();
|
void Make();
|
||||||
void SaveSessionsIfNeeded(); // !! wywalic do menagera sesji??
|
void SaveSessionsIfNeeded(); // !! IMPROVE ME wywalic do menagera sesji??
|
||||||
void LogAccess();
|
void LogAccess();
|
||||||
void SendData(const BinaryPage & page, FCGX_Stream * out);
|
void SendData(const BinaryPage & page, FCGX_Stream * out);
|
||||||
|
void CreateJSONAnswer();
|
||||||
|
|
||||||
void ReadRequest();
|
void ReadRequest();
|
||||||
void SendTextAnswer();
|
void SendTextAnswer();
|
||||||
void SendBinaryAnswer();
|
void SendBinaryAnswer();
|
||||||
void SendAnswer();
|
void SendAnswer();
|
||||||
|
|
||||||
void PrintEnv();
|
void LogEnvironmentVariables();
|
||||||
|
|
||||||
void SetEnv(const char * & env, const char * name);
|
void SetEnv(const char * name, std::wstring & env);
|
||||||
void ReadEnvVariables();
|
void ReadEnvVariables();
|
||||||
void ReadGetPostVars();
|
void ReadEnvRemoteIP();
|
||||||
|
void ReadPostVars();
|
||||||
|
|
||||||
void CheckIE();
|
void CheckIE();
|
||||||
void CheckKonqueror();
|
void CheckKonqueror();
|
||||||
void CheckRequestMethod();
|
void CheckRequestMethod();
|
||||||
void CheckFCGIRole();
|
|
||||||
void CheckSSL();
|
void CheckSSL();
|
||||||
void SetSubdomain();
|
void SetSubdomain();
|
||||||
|
|
||||||
|
|
||||||
|
Header GetHTTPStatusCode();
|
||||||
void PrepareSessionCookie();
|
void PrepareSessionCookie();
|
||||||
void AddDebugInfo(std::wstring & out);
|
void FilterContent();
|
||||||
void FilterCompressSend(bool compressing, int compress_encoding, const std::wstring & source_ref);
|
void SendHeaders();
|
||||||
bool SendHeadersStaticCreateResource();
|
void SendCookies();
|
||||||
void SendHeadersStatic();
|
bool AddHeader(const wchar_t * name, const wchar_t * value);
|
||||||
void SendHeaderContentType();
|
bool AddHeader(const std::wstring & name, const std::wstring & value);
|
||||||
void SendHeadersForbidden();
|
bool AddHeader(const wchar_t * name, const PT::WTextStream & value);
|
||||||
void SendHeadersRedirect();
|
bool AddHeader(const std::wstring & name, const PT::WTextStream & value);
|
||||||
void SendHeadersSendFile();
|
bool PrepareHeadersStaticCreateResource(PT::WTextStream & out_path);
|
||||||
void SendHeadersCompression(int compress_encoding);
|
void PrepareHeadersStatic();
|
||||||
void SendHeadersNormal(Header header);
|
void PrepareHeaderContentType();
|
||||||
void SendHeaders(bool compressing, int compress_encoding, Header header);
|
void PrepareHeadersForbidden();
|
||||||
|
void PrepareHeadersRedirect();
|
||||||
|
void PrepareHeadersSendFile();
|
||||||
|
void PrepareHeadersCompression(int compress_encoding);
|
||||||
|
void PrepareHeadersNormal(Header header, size_t output_size);
|
||||||
|
void PrepareHeaders(bool compressing, int compress_encoding, Header header, size_t output_size);
|
||||||
int SelectDeflateVersion();
|
int SelectDeflateVersion();
|
||||||
void SelectCompression(size_t source_len, bool & compression_allowed, int & compression_encoding);
|
void SelectCompression(size_t source_len, bool & compression_allowed, int & compression_encoding);
|
||||||
bool CanSendContent(Header header);
|
bool CanSendContent();
|
||||||
|
void ClearAfterRequest();
|
||||||
|
|
||||||
void LogUser(const char * msg, uid_t id);
|
void LogUser(const char * msg, uid_t id);
|
||||||
void LogGroup(const char * msg, gid_t id, bool put_logend = true);
|
void LogGroup(const char * msg, gid_t id, bool put_logend = true);
|
||||||
void LogUsers();
|
void LogUsers();
|
||||||
void LogEffectiveGroups(std::vector<gid_t> & tab);
|
void LogEffectiveGroups(std::vector<gid_t> & tab);
|
||||||
void LogGroups();
|
void LogGroups();
|
||||||
bool DropPrivileges(const std::string & user, uid_t uid, gid_t gid, bool additional_groups);
|
|
||||||
|
|
||||||
static void * SpecialThreadForSignals(void*);
|
static void * SpecialThreadForSignals(void*);
|
||||||
|
static size_t FetchPageOnExitCurlCallback(char *ptr, size_t size, size_t nmemb, void *userdata);
|
||||||
void FetchPageOnExit();
|
void FetchPageOnExit();
|
||||||
|
|
||||||
void CreateStaticTree();
|
void CreateStaticTree();
|
||||||
|
|
||||||
// !! dodac do session managera?
|
// !! IMPROVE ME
|
||||||
|
// !! move to the session manager?
|
||||||
time_t last_sessions_save;
|
time_t last_sessions_save;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+35
-3
@@ -1,16 +1,44 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2010-2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "basethread.h"
|
#include "basethread.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
BaseThread::BaseThread() : thread_signal(PTHREAD_COND_INITIALIZER)
|
BaseThread::BaseThread() : thread_signal(PTHREAD_COND_INITIALIZER)
|
||||||
{
|
{
|
||||||
@@ -237,3 +265,7 @@ pthread_attr_t attr;
|
|||||||
return res == 0;
|
return res == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+36
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_basethread
|
#ifndef headerfile_winix_core_basethread
|
||||||
@@ -14,6 +39,11 @@
|
|||||||
#include "synchro.h"
|
#include "synchro.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class BaseThread
|
class BaseThread
|
||||||
{
|
{
|
||||||
@@ -120,6 +150,9 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+37
-3
@@ -1,15 +1,44 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "bbcodeparser.h"
|
#include "bbcodeparser.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool BBCODEParser::Equal(const wchar_t * str1, const wchar_t * str2)
|
bool BBCODEParser::Equal(const wchar_t * str1, const wchar_t * str2)
|
||||||
@@ -590,3 +619,8 @@ void BBCODEParser::Uninit()
|
|||||||
if( has_open_ul_tag )
|
if( has_open_ul_tag )
|
||||||
(*out_string) += L"</ul>\n";
|
(*out_string) += L"</ul>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+35
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_bbcodeparser
|
#ifndef headerfile_winix_core_bbcodeparser
|
||||||
@@ -13,6 +38,9 @@
|
|||||||
#include "htmlfilter.h"
|
#include "htmlfilter.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class BBCODEParser : public HTMLFilter
|
class BBCODEParser : public HTMLFilter
|
||||||
@@ -90,4 +118,8 @@ class BBCODEParser : public HTMLFilter
|
|||||||
bool has_open_li_tag; // has open html <li> tag
|
bool has_open_li_tag; // has open html <li> tag
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+47
-6
@@ -1,16 +1,45 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "compress.h"
|
#include "compress.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Compress::Compress()
|
Compress::Compress()
|
||||||
@@ -153,7 +182,9 @@ return 0;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int Compress::MakeCompress(z_stream & strm, const char * source, size_t source_len, FCGX_Stream * out_stream, int encoding)
|
|
||||||
|
|
||||||
|
int Compress::MakeCompress(z_stream & strm, const char * source, size_t source_len, BinaryPage & out_stream, int encoding)
|
||||||
{
|
{
|
||||||
int ret, flush;
|
int ret, flush;
|
||||||
size_t have;
|
size_t have;
|
||||||
@@ -180,7 +211,7 @@ size_t have;
|
|||||||
|
|
||||||
have = buffer_max_len - strm.avail_out;
|
have = buffer_max_len - strm.avail_out;
|
||||||
last_out_size += have;
|
last_out_size += have;
|
||||||
FCGX_PutStr(buffer_out, have, out_stream);
|
out_stream.write(buffer_out, have);
|
||||||
}
|
}
|
||||||
while( strm.avail_out == 0 );
|
while( strm.avail_out == 0 );
|
||||||
|
|
||||||
@@ -203,6 +234,7 @@ return 0;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Compress::CopyToInputBuffer(BinaryPage::const_iterator & i, size_t len)
|
void Compress::CopyToInputBuffer(BinaryPage::const_iterator & i, size_t len)
|
||||||
{
|
{
|
||||||
for(size_t a=0 ; a<len ; ++a, ++i)
|
for(size_t a=0 ; a<len ; ++a, ++i)
|
||||||
@@ -331,12 +363,13 @@ void Compress::PutLog(size_t source_len, int encoding)
|
|||||||
3 - not inited (use Init() first)
|
3 - not inited (use Init() first)
|
||||||
100 - unknown
|
100 - unknown
|
||||||
*/
|
*/
|
||||||
int Compress::CompressAndPut(const char * source, size_t source_len, FCGX_Stream * out_stream, int encoding)
|
int Compress::Compressing(const char * source, size_t source_len, BinaryPage & out_stream, int encoding)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
z_stream * pstrm;
|
z_stream * pstrm;
|
||||||
|
|
||||||
last_out_size = 0;
|
last_out_size = 0;
|
||||||
|
out_stream.clear();
|
||||||
|
|
||||||
if( !ready_for_compress )
|
if( !ready_for_compress )
|
||||||
{
|
{
|
||||||
@@ -344,6 +377,8 @@ z_stream * pstrm;
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// !! CHECK ME
|
||||||
|
// it is correct to immediately return? what about headers in the compressed page?
|
||||||
if( source_len == 0 )
|
if( source_len == 0 )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -379,6 +414,8 @@ z_stream * pstrm;
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// !! CHECK ME
|
||||||
|
// it is correct to immediately return? what about headers in the compressed page?
|
||||||
if( in.empty() )
|
if( in.empty() )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -390,3 +427,7 @@ z_stream * pstrm;
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+37
-6
@@ -1,21 +1,49 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_compress
|
#ifndef headerfile_winix_core_compress
|
||||||
#define headerfile_winix_core_compress
|
#define headerfile_winix_core_compress
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <fcgiapp.h>
|
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#include "requesttypes.h"
|
#include "requesttypes.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Compress
|
class Compress
|
||||||
{
|
{
|
||||||
@@ -34,7 +62,7 @@ public:
|
|||||||
1 - deflate
|
1 - deflate
|
||||||
2 - gzip
|
2 - gzip
|
||||||
*/
|
*/
|
||||||
int CompressAndPut(const char * source, size_t source_len, FCGX_Stream * out_stream, int encoding = 2);
|
int Compressing(const char * source, size_t source_len, BinaryPage & out_stream, int encoding = 2);
|
||||||
int Compressing(const BinaryPage & in, BinaryPage & out, int encoding = 2);
|
int Compressing(const BinaryPage & in, BinaryPage & out, int encoding = 2);
|
||||||
|
|
||||||
|
|
||||||
@@ -45,7 +73,7 @@ private:
|
|||||||
bool InitDeflate();
|
bool InitDeflate();
|
||||||
bool InitGzip();
|
bool InitGzip();
|
||||||
|
|
||||||
int MakeCompress(z_stream & strm, const char * source, size_t source_len, FCGX_Stream * out_stream, int encoding);
|
int MakeCompress(z_stream & strm, const char * source, size_t source_len, BinaryPage & out_stream, int encoding);
|
||||||
int MakeCompress(z_stream & strm, const BinaryPage & page, BinaryPage & out, int encoding);
|
int MakeCompress(z_stream & strm, const BinaryPage & page, BinaryPage & out, int encoding);
|
||||||
z_stream * SelectStream(int encoding);
|
z_stream * SelectStream(int encoding);
|
||||||
void ResetStream(z_stream * pstrm, int encoding);
|
void ResetStream(z_stream * pstrm, int encoding);
|
||||||
@@ -67,4 +95,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+59
-39
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@@ -14,6 +39,10 @@
|
|||||||
#include "crypt.h"
|
#include "crypt.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Config::Config()
|
Config::Config()
|
||||||
{
|
{
|
||||||
@@ -41,14 +70,14 @@ void Config::ShowError()
|
|||||||
|
|
||||||
case PT::SpaceParser::cant_open_file:
|
case PT::SpaceParser::cant_open_file:
|
||||||
if( errors_to_stdout )
|
if( errors_to_stdout )
|
||||||
std::cout << "Config: cant open a config file: " << config_file << std::endl;
|
std::wcout << L"Config: I cannot open a config file: " << config_file << std::endl;
|
||||||
|
|
||||||
log << log1 << "Config: cant open a config file: " << config_file << logend;
|
log << log1 << "Config: cant open a config file: " << config_file << logend;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PT::SpaceParser::syntax_error:
|
case PT::SpaceParser::syntax_error:
|
||||||
if( errors_to_stdout )
|
if( errors_to_stdout )
|
||||||
std::cout << "Config: syntax error, line: " << parser.line << std::endl;
|
std::wcout << "Config: syntax error, line: " << parser.line << std::endl;
|
||||||
|
|
||||||
log << log1 << "Config: syntax error, line: " << parser.line << logend;
|
log << log1 << "Config: syntax error, line: " << parser.line << logend;
|
||||||
break;
|
break;
|
||||||
@@ -73,7 +102,6 @@ bool Config::ReadConfig(bool errors_to_stdout_, bool stdout_is_closed)
|
|||||||
log << log2 << "Config: reading a config file" << logend;
|
log << log2 << "Config: reading a config file" << logend;
|
||||||
|
|
||||||
parser.SplitSingle(true);
|
parser.SplitSingle(true);
|
||||||
parser.UTF8(true); // config is always read in UTF-8
|
|
||||||
parser.SetSpace(space);
|
parser.SetSpace(space);
|
||||||
|
|
||||||
PT::SpaceParser::Status status = parser.Parse(config_file);
|
PT::SpaceParser::Status status = parser.Parse(config_file);
|
||||||
@@ -98,17 +126,18 @@ void Config::AssignValues(bool stdout_is_closed)
|
|||||||
{
|
{
|
||||||
demonize = Bool(L"demonize", true);
|
demonize = Bool(L"demonize", true);
|
||||||
|
|
||||||
user = AText(L"user");
|
user = Text(L"user");
|
||||||
group = AText(L"group");
|
group = Text(L"group");
|
||||||
additional_groups = Bool(L"additional_groups", true);
|
additional_groups = Bool(L"additional_groups", true);
|
||||||
|
|
||||||
log_file = AText(L"log_file");
|
log_file = Text(L"log_file");
|
||||||
log_notify_file = AText(L"log_notify_file");
|
log_notify_file = Text(L"log_notify_file");
|
||||||
log_delimiter = Text(L"log_delimiter", L"---------------------------------------------------------------------------------");
|
log_delimiter = Text(L"log_delimiter", L"---------------------------------------------------------------------------------");
|
||||||
fcgi_socket = AText(L"fcgi_socket");
|
fcgi_socket = Text(L"fcgi_socket");
|
||||||
fcgi_socket_chmod = Int(L"fcgi_socket_chmod", 0770);
|
fcgi_socket_chmod = Int(L"fcgi_socket_chmod", 0770);
|
||||||
fcgi_socket_user = AText(L"fcgi_socket_user");
|
fcgi_socket_user = Text(L"fcgi_socket_user");
|
||||||
fcgi_socket_group = AText(L"fcgi_socket_group");
|
fcgi_socket_group = Text(L"fcgi_socket_group");
|
||||||
|
fcgi_socket_listen = Int(L"fcgi_socket_listen", 100);
|
||||||
log_level = Int(L"log_level", 1);
|
log_level = Int(L"log_level", 1);
|
||||||
log_request = Int(L"log_request", 1);
|
log_request = Int(L"log_request", 1);
|
||||||
log_save_each_line = Bool(L"log_save_each_line", false);
|
log_save_each_line = Bool(L"log_save_each_line", false);
|
||||||
@@ -118,6 +147,8 @@ void Config::AssignValues(bool stdout_is_closed)
|
|||||||
log_db_query = Bool(L"log_db_query", false);
|
log_db_query = Bool(L"log_db_query", false);
|
||||||
log_plugin_call = Bool(L"log_plugin_call", false);
|
log_plugin_call = Bool(L"log_plugin_call", false);
|
||||||
log_post_value_size = Size(L"log_post_value_size", 80);
|
log_post_value_size = Size(L"log_post_value_size", 80);
|
||||||
|
log_env_variables = Bool(L"log_env_variables", false);
|
||||||
|
log_http_answer_headers = Bool(L"log_http_answer_headers", false);
|
||||||
|
|
||||||
post_file_max = Size(L"post_file_max", 8388608); // 8 MB
|
post_file_max = Size(L"post_file_max", 8388608); // 8 MB
|
||||||
|
|
||||||
@@ -126,6 +157,7 @@ void Config::AssignValues(bool stdout_is_closed)
|
|||||||
NoLastSlash(upload_dir);
|
NoLastSlash(upload_dir);
|
||||||
NoLastSlash(common_dir);
|
NoLastSlash(common_dir);
|
||||||
|
|
||||||
|
upload_group = Text(L"upload_group");
|
||||||
upload_dirs_chmod = Int(L"upload_dirs_chmod", 0750);
|
upload_dirs_chmod = Int(L"upload_dirs_chmod", 0750);
|
||||||
upload_files_chmod = Int(L"upload_files_chmod", 0640);
|
upload_files_chmod = Int(L"upload_files_chmod", 0640);
|
||||||
ListText(L"static_dirs", static_dirs);
|
ListText(L"static_dirs", static_dirs);
|
||||||
@@ -151,10 +183,10 @@ void Config::AssignValues(bool stdout_is_closed)
|
|||||||
templates_index = Text(L"templates_index", L"index.html");
|
templates_index = Text(L"templates_index", L"index.html");
|
||||||
template_only_root_use_template_fun = Bool(L"template_only_root_use_template_fun", false);
|
template_only_root_use_template_fun = Bool(L"template_only_root_use_template_fun", false);
|
||||||
|
|
||||||
http_session_id_name = AText(L"http_session_id_name");
|
http_session_id_name = Text(L"http_session_id_name", L"session_id");
|
||||||
db_database = AText(L"db_database");
|
db_database = Text(L"db_database");
|
||||||
db_user = AText(L"db_user");
|
db_user = Text(L"db_user");
|
||||||
db_pass = AText(L"db_pass");
|
db_pass = Text(L"db_pass");
|
||||||
item_url_empty = Text(L"item_url_empty");
|
item_url_empty = Text(L"item_url_empty");
|
||||||
|
|
||||||
url_proto = Text(L"url_proto", L"http://");
|
url_proto = Text(L"url_proto", L"http://");
|
||||||
@@ -182,7 +214,7 @@ void Config::AssignValues(bool stdout_is_closed)
|
|||||||
|
|
||||||
session_max_idle = Int(L"session_max_idle", 10800); // 3h
|
session_max_idle = Int(L"session_max_idle", 10800); // 3h
|
||||||
session_remember_max_idle = Int(L"session_remember_max_idle", 16070400); // 3 months
|
session_remember_max_idle = Int(L"session_remember_max_idle", 16070400); // 3 months
|
||||||
session_file = AText(L"session_file");
|
session_file = Text(L"session_file");
|
||||||
session_max = Size(L"session_max", 1000000);
|
session_max = Size(L"session_max", 1000000);
|
||||||
|
|
||||||
compression = Bool(L"compression", true);
|
compression = Bool(L"compression", true);
|
||||||
@@ -196,6 +228,7 @@ void Config::AssignValues(bool stdout_is_closed)
|
|||||||
html_filter_tabs = Size(L"html_filter_tabs", 2);
|
html_filter_tabs = Size(L"html_filter_tabs", 2);
|
||||||
html_filter_orphans = Bool(L"html_filter_orphans", true);
|
html_filter_orphans = Bool(L"html_filter_orphans", true);
|
||||||
html_filter_orphans_mode_str = Text(L"html_filter_orphans_mode_str", L"nbsp");
|
html_filter_orphans_mode_str = Text(L"html_filter_orphans_mode_str", L"nbsp");
|
||||||
|
html_filter_nofilter_tag = Text(L"html_filter_nofilter_tag", L"nofilter");
|
||||||
|
|
||||||
locale_dir = Text(L"locale_dir");
|
locale_dir = Text(L"locale_dir");
|
||||||
locale_dir_default = Text(L"locale_dir_default");
|
locale_dir_default = Text(L"locale_dir_default");
|
||||||
@@ -206,7 +239,6 @@ void Config::AssignValues(bool stdout_is_closed)
|
|||||||
title_separator = Text(L"title_separator", L" / ");
|
title_separator = Text(L"title_separator", L" / ");
|
||||||
|
|
||||||
http_header_send_file = Text(L"http_header_send_file", L"X-LIGHTTPD-send-file");
|
http_header_send_file = Text(L"http_header_send_file", L"X-LIGHTTPD-send-file");
|
||||||
debug_info = Bool(L"debug_info", false);
|
|
||||||
|
|
||||||
editors_html_safe_mode = Bool(L"editors_html_safe_mode", true);
|
editors_html_safe_mode = Bool(L"editors_html_safe_mode", true);
|
||||||
editors_html_safe_mode_skip_root = Bool(L"editors_html_safe_mode_skip_root", true);
|
editors_html_safe_mode_skip_root = Bool(L"editors_html_safe_mode_skip_root", true);
|
||||||
@@ -215,7 +247,6 @@ void Config::AssignValues(bool stdout_is_closed)
|
|||||||
NoLastSlash(plugins_dir);
|
NoLastSlash(plugins_dir);
|
||||||
ListText(L"plugins", plugin_file);
|
ListText(L"plugins", plugin_file);
|
||||||
|
|
||||||
utf8 = Bool(L"utf8", true);
|
|
||||||
symlinks_follow_max = Size(L"symlinks_follow_max", 20);
|
symlinks_follow_max = Size(L"symlinks_follow_max", 20);
|
||||||
|
|
||||||
ticket_form_prefix = Text(L"ticket_form_prefix", L"ticketparam");
|
ticket_form_prefix = Text(L"ticket_form_prefix", L"ticketparam");
|
||||||
@@ -237,6 +268,7 @@ void Config::AssignValues(bool stdout_is_closed)
|
|||||||
|
|
||||||
ezc_max_elements = Size(L"ezc_max_elements", 50000);
|
ezc_max_elements = Size(L"ezc_max_elements", 50000);
|
||||||
ezc_max_loop_elements = Size(L"ezc_max_loop_elements", 5000);
|
ezc_max_loop_elements = Size(L"ezc_max_loop_elements", 5000);
|
||||||
|
ezc_out_streams_size = Size(L"ezc_out_streams_size", 16);
|
||||||
|
|
||||||
account_need_email_verification = Bool(L"account_need_email_verification", true);
|
account_need_email_verification = Bool(L"account_need_email_verification", true);
|
||||||
reset_password_code_expiration_time = Long(L"reset_password_code_expiration_time", 86400);
|
reset_password_code_expiration_time = Long(L"reset_password_code_expiration_time", 86400);
|
||||||
@@ -259,6 +291,8 @@ void Config::AssignValues(bool stdout_is_closed)
|
|||||||
incorrect_login_cannot_login_mode = Int(L"incorrect_login_cannot_login_mode", 0);
|
incorrect_login_cannot_login_mode = Int(L"incorrect_login_cannot_login_mode", 0);
|
||||||
incorrect_login_cannot_login_treshold = Size(L"incorrect_login_cannot_login_treshold", 20);
|
incorrect_login_cannot_login_treshold = Size(L"incorrect_login_cannot_login_treshold", 20);
|
||||||
incorrect_login_cannot_login_delay = Size(L"incorrect_login_cannot_login_delay", 1800);
|
incorrect_login_cannot_login_delay = Size(L"incorrect_login_cannot_login_delay", 1800);
|
||||||
|
|
||||||
|
pid_file = Text(L"pid_file", L"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -285,6 +319,8 @@ void Config::SetAdditionalVariables()
|
|||||||
|
|
||||||
if( locale_files.empty() )
|
if( locale_files.empty() )
|
||||||
locale_files.push_back(L"en");
|
locale_files.push_back(L"en");
|
||||||
|
|
||||||
|
upload_group_int = GetGroupId(upload_group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -331,25 +367,6 @@ std::wstring & Config::Text(const std::wstring & name, const wchar_t * def)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string & Config::AText(const wchar_t * name)
|
|
||||||
{
|
|
||||||
return space.AText(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::string & Config::AText(const wchar_t * name, const char * def)
|
|
||||||
{
|
|
||||||
return space.AText(name, def);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::string & Config::AText(const std::wstring & name, const char * def)
|
|
||||||
{
|
|
||||||
return space.AText(name, def);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int Config::Int(const wchar_t * name)
|
int Config::Int(const wchar_t * name)
|
||||||
{
|
{
|
||||||
return space.Int(name);
|
return space.Int(name);
|
||||||
@@ -465,5 +482,8 @@ void Config::Print(std::wostream & out)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+111
-40
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_config
|
#ifndef headerfile_winix_core_config
|
||||||
@@ -15,6 +40,10 @@
|
|||||||
#include "htmlfilter.h"
|
#include "htmlfilter.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -24,19 +53,19 @@ public:
|
|||||||
|
|
||||||
// name of the config file
|
// name of the config file
|
||||||
// this is the parameter passed to winix programm
|
// this is the parameter passed to winix programm
|
||||||
std::string config_file;
|
std::wstring config_file;
|
||||||
|
|
||||||
// start as a demon (in the background)
|
// start as a demon (in the background)
|
||||||
// default: true
|
// default: true
|
||||||
bool demonize;
|
bool demonize;
|
||||||
|
|
||||||
// system user name (to which drop privileges)
|
// system user's name to whom winix should drop privileges
|
||||||
// used only if winix is started as the root
|
// used only if winix is started as the root
|
||||||
std::string user;
|
std::wstring user;
|
||||||
|
|
||||||
// system group name (to which drop privileges)
|
// system group's name to which drop privileges
|
||||||
// used only if winix is started as the root
|
// used only if winix is started as the root
|
||||||
std::string group;
|
std::wstring group;
|
||||||
|
|
||||||
// setting additional effective groups from /etc/group
|
// setting additional effective groups from /etc/group
|
||||||
// by using initgroups()
|
// by using initgroups()
|
||||||
@@ -45,23 +74,25 @@ public:
|
|||||||
bool additional_groups;
|
bool additional_groups;
|
||||||
|
|
||||||
// log file name, log file name for notifications (sending emails, etc)
|
// log file name, log file name for notifications (sending emails, etc)
|
||||||
std::string log_file, log_notify_file;
|
std::wstring log_file, log_notify_file;
|
||||||
|
|
||||||
|
// the log level (how much info should be inserted to logs)
|
||||||
// 1 - minimum
|
// 1 - minimum
|
||||||
// 2 - (default)
|
// 2 - (default)
|
||||||
// 3 - maximum - all logs
|
// 3 - maximum - all logs
|
||||||
int log_level;
|
int log_level;
|
||||||
|
|
||||||
// logging to stdout too
|
// logging to stdout too
|
||||||
// only if demonize is 'false'
|
// this option is valid only if 'demonize' option is set to 'false'
|
||||||
// default: false
|
// default: false
|
||||||
bool log_stdout;
|
bool log_stdout;
|
||||||
|
|
||||||
// how many requests should be saved in the same time
|
// how many requests should be saved in the same time
|
||||||
|
// if you have a very busy server you can incrase this value
|
||||||
// default: 1
|
// default: 1
|
||||||
int log_request;
|
int log_request;
|
||||||
|
|
||||||
// whether to save each line of the config (use it for debug purposes)
|
// whether to save each line of the config (used for debugging purposes)
|
||||||
// default: false
|
// default: false
|
||||||
bool log_save_each_line;
|
bool log_save_each_line;
|
||||||
|
|
||||||
@@ -76,6 +107,7 @@ public:
|
|||||||
bool log_server_answer;
|
bool log_server_answer;
|
||||||
|
|
||||||
// logging db queries
|
// logging db queries
|
||||||
|
// warning: use it only on a developer's server as it logs the hashes of passwords too
|
||||||
// default: false
|
// default: false
|
||||||
bool log_db_query;
|
bool log_db_query;
|
||||||
|
|
||||||
@@ -85,23 +117,39 @@ public:
|
|||||||
|
|
||||||
// how many characters in values should be logged from POST parameters
|
// how many characters in values should be logged from POST parameters
|
||||||
// default: 80
|
// default: 80
|
||||||
// set to 0 to turn off
|
// set to 0 to turn it off
|
||||||
size_t log_post_value_size;
|
size_t log_post_value_size;
|
||||||
|
|
||||||
// request delimiter in the log file, default "---------"
|
// request delimiter in the log file, default "---------"
|
||||||
std::wstring log_delimiter;
|
std::wstring log_delimiter;
|
||||||
|
|
||||||
|
// log environment variables (fastcgi environment)
|
||||||
|
bool log_env_variables;
|
||||||
|
|
||||||
|
// log headers (+cookies) which are returned to the client
|
||||||
|
// this is what winix has generated -- the web server can change or add other headers
|
||||||
|
// default: false
|
||||||
|
bool log_http_answer_headers;
|
||||||
|
|
||||||
// fast cgi: socket (unix domain)
|
// fast cgi: socket (unix domain)
|
||||||
std::string fcgi_socket;
|
std::wstring fcgi_socket;
|
||||||
|
|
||||||
// fast cgi: socket permissions
|
// fast cgi: socket permissions
|
||||||
|
// chmod and chown of the socket are set before winix drops privileges
|
||||||
int fcgi_socket_chmod;
|
int fcgi_socket_chmod;
|
||||||
|
|
||||||
// fast cgi: owner of the socket
|
// fast cgi: owner of the socket
|
||||||
std::string fcgi_socket_user;
|
// chmod and chown of the socket are set before winix drops privileges
|
||||||
|
std::wstring fcgi_socket_user;
|
||||||
|
|
||||||
// fast cgi: group of the socket
|
// fast cgi: group of the socket
|
||||||
std::string fcgi_socket_group;
|
// chmod and chown of the socket are set before winix drops privileges
|
||||||
|
std::wstring fcgi_socket_group;
|
||||||
|
|
||||||
|
// fcgi_socket_listen is the listen queue depth used in the listen() call
|
||||||
|
// when creating a FastCGI socket for the web server
|
||||||
|
// default: 100
|
||||||
|
int fcgi_socket_listen;
|
||||||
|
|
||||||
std::wstring templates_dir;
|
std::wstring templates_dir;
|
||||||
std::wstring templates_dir_default; // html templates from winix
|
std::wstring templates_dir_default; // html templates from winix
|
||||||
@@ -120,39 +168,46 @@ public:
|
|||||||
// default: index.html
|
// default: index.html
|
||||||
std::wstring templates_index;
|
std::wstring templates_index;
|
||||||
|
|
||||||
// if true then only root can use 'template' function
|
// if true then only root can use 'template' winix function
|
||||||
// default: false
|
// default: false
|
||||||
bool template_only_root_use_template_fun;
|
bool template_only_root_use_template_fun;
|
||||||
|
|
||||||
std::string db_database;
|
// the database name, user name and a password for the PostgreSQL database
|
||||||
std::string db_user;
|
std::wstring db_database;
|
||||||
std::string db_pass;
|
std::wstring db_user;
|
||||||
|
std::wstring db_pass;
|
||||||
|
|
||||||
std::string http_session_id_name;
|
// the name of the cookie which has the session identifier
|
||||||
|
std::wstring http_session_id_name;
|
||||||
|
|
||||||
// string used in a place where is a user (or group) selected
|
// string used in a place where is a user (or group) selected
|
||||||
|
// !! IMPROVE ME should be moved to locales
|
||||||
std::wstring priv_no_user;
|
std::wstring priv_no_user;
|
||||||
std::wstring priv_no_group;
|
std::wstring priv_no_group;
|
||||||
|
|
||||||
// time in seconds when the user will be automatically logged out (iddle time)
|
// time in seconds when a user will be automatically logged out (iddle time)
|
||||||
|
// default: 10800 = 3 hours
|
||||||
int session_max_idle;
|
int session_max_idle;
|
||||||
|
|
||||||
// time in seconds when the user will be automatically logged out (when he selected 'remember me' option)
|
// time in seconds when a user will be automatically logged out
|
||||||
|
// when he has selected the 'remember me' option when logging in
|
||||||
// this time is usually greater than session_max_idle
|
// this time is usually greater than session_max_idle
|
||||||
|
// default: 16070400 = 3 months
|
||||||
int session_remember_max_idle;
|
int session_remember_max_idle;
|
||||||
|
|
||||||
// this file is used when the program is starting and ending
|
// a file to which winix stores sessions info
|
||||||
std::string session_file;
|
// it is used when winix starts (boots) and quits
|
||||||
|
std::wstring session_file;
|
||||||
|
|
||||||
// how many sessions can be (zero turn off this checking)
|
// how many sessions can be (zero turn off this checking)
|
||||||
// default: 1000000 (one milion)
|
// default: 1000000 (one milion)
|
||||||
size_t session_max;
|
size_t session_max;
|
||||||
|
|
||||||
// allow the html output to be compressed
|
// allow the winix output to be compressed
|
||||||
// default: true
|
// default: true
|
||||||
bool compression;
|
bool compression;
|
||||||
|
|
||||||
// if the output is shorter than this value then it will not be compressed
|
// compress only if the output is greater or equal to this value
|
||||||
// default: 512 bytes
|
// default: 512 bytes
|
||||||
size_t compression_page_min_size;
|
size_t compression_page_min_size;
|
||||||
|
|
||||||
@@ -179,12 +234,12 @@ public:
|
|||||||
bool html_filter_trim_white;
|
bool html_filter_trim_white;
|
||||||
|
|
||||||
// when long words should be broken (a space will be inserted)
|
// when long words should be broken (a space will be inserted)
|
||||||
// default: after 60 non white characters will be put a space
|
// default: after 60 non white characters there will be put a space
|
||||||
// set zero to turn off
|
// set zero to turn off
|
||||||
size_t html_filter_break_word;
|
size_t html_filter_break_word;
|
||||||
|
|
||||||
// when long lines should be broken (a new line character will be inserted)
|
// when long lines should be broken (a new line character will be inserted)
|
||||||
// default: 80
|
// default: 110
|
||||||
// set zero to turn off
|
// set zero to turn off
|
||||||
size_t html_filter_wrap_line;
|
size_t html_filter_wrap_line;
|
||||||
|
|
||||||
@@ -202,10 +257,18 @@ public:
|
|||||||
std::wstring html_filter_orphans_mode_str;
|
std::wstring html_filter_orphans_mode_str;
|
||||||
HTMLFilter::OrphanMode html_filter_orphans_mode;
|
HTMLFilter::OrphanMode html_filter_orphans_mode;
|
||||||
|
|
||||||
|
// the html nofilter tag
|
||||||
|
// content betweeng these tags (opening and closing) will not be filtered
|
||||||
|
// and this tag will not be included in the html output
|
||||||
|
// default: nofilter
|
||||||
|
std::wstring html_filter_nofilter_tag;
|
||||||
|
|
||||||
// the url of a new empty item (if there is not the subject too)
|
// the url of a new empty item (if there is not the subject too)
|
||||||
|
// !! IMPROVE ME should be moved to locale
|
||||||
std::wstring item_url_empty;
|
std::wstring item_url_empty;
|
||||||
|
|
||||||
// maximum length of a file send by post multipart form
|
// maximum length of a file send by post multipart form
|
||||||
|
// default: 8388608 - 8MB
|
||||||
// 0 - not used
|
// 0 - not used
|
||||||
size_t post_file_max;
|
size_t post_file_max;
|
||||||
|
|
||||||
@@ -238,6 +301,14 @@ public:
|
|||||||
// default: empty
|
// default: empty
|
||||||
std::wstring common_dir;
|
std::wstring common_dir;
|
||||||
|
|
||||||
|
// system group's name for new uploaded files (created directories in the file system)
|
||||||
|
// it can be empty (it is not used then)
|
||||||
|
std::wstring upload_group;
|
||||||
|
|
||||||
|
// this value will be set based on upload_group
|
||||||
|
// will be -1 if upload_group is empty or if it is invalid
|
||||||
|
int upload_group_int;
|
||||||
|
|
||||||
// chmod of newly created directories (under upload_dir)
|
// chmod of newly created directories (under upload_dir)
|
||||||
// default: 0750
|
// default: 0750
|
||||||
int upload_dirs_chmod;
|
int upload_dirs_chmod;
|
||||||
@@ -389,9 +460,6 @@ public:
|
|||||||
// default: X-LIGHTTPD-send-file
|
// default: X-LIGHTTPD-send-file
|
||||||
std::wstring http_header_send_file;
|
std::wstring http_header_send_file;
|
||||||
|
|
||||||
// prints additional information (in the end of the html page as a commentary)
|
|
||||||
bool debug_info;
|
|
||||||
|
|
||||||
// in editors (emacs, ckeditor,...) the html will be filtered and unsafe tags
|
// in editors (emacs, ckeditor,...) the html will be filtered and unsafe tags
|
||||||
// will be dropped (script, frame, etc.)
|
// will be dropped (script, frame, etc.)
|
||||||
// default: true;
|
// default: true;
|
||||||
@@ -402,11 +470,6 @@ public:
|
|||||||
// (if true the html code for root is not filtered)
|
// (if true the html code for root is not filtered)
|
||||||
bool editors_html_safe_mode_skip_root;
|
bool editors_html_safe_mode_skip_root;
|
||||||
|
|
||||||
// charset used in templates, locales, logs etc.
|
|
||||||
// default: true (UTF-8)
|
|
||||||
// if false it means 8-bit ASCII
|
|
||||||
bool utf8;
|
|
||||||
|
|
||||||
// how many maximum symlinks can be followed
|
// how many maximum symlinks can be followed
|
||||||
// (symlinks on directories as well)
|
// (symlinks on directories as well)
|
||||||
// default: 20
|
// default: 20
|
||||||
@@ -485,6 +548,10 @@ public:
|
|||||||
// default: 5000 (from ezc generator)
|
// default: 5000 (from ezc generator)
|
||||||
size_t ezc_max_loop_elements;
|
size_t ezc_max_loop_elements;
|
||||||
|
|
||||||
|
// how many output streams do we have in Request class
|
||||||
|
// default: 16 (64 maximum)
|
||||||
|
size_t ezc_out_streams_size;
|
||||||
|
|
||||||
// when true then when a user want to create a new account
|
// when true then when a user want to create a new account
|
||||||
// he has to provide his email and a message will be sent back to him
|
// he has to provide his email and a message will be sent back to him
|
||||||
// with a link to activate the account
|
// with a link to activate the account
|
||||||
@@ -589,6 +656,11 @@ public:
|
|||||||
// will be taken accordingly
|
// will be taken accordingly
|
||||||
size_t incorrect_login_cannot_login_delay;
|
size_t incorrect_login_cannot_login_delay;
|
||||||
|
|
||||||
|
// pid file (a full path to a pid file)
|
||||||
|
// default: empty which means there is not a pid file used
|
||||||
|
// pid file is saved after winix has dropped privileges
|
||||||
|
std::wstring pid_file;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Config();
|
Config();
|
||||||
@@ -597,9 +669,6 @@ public:
|
|||||||
std::wstring & Text(const wchar_t * name);
|
std::wstring & Text(const wchar_t * name);
|
||||||
std::wstring & Text(const wchar_t * name, const wchar_t * def);
|
std::wstring & Text(const wchar_t * name, const wchar_t * def);
|
||||||
std::wstring & Text(const std::wstring & name, const wchar_t * def);
|
std::wstring & Text(const std::wstring & name, const wchar_t * def);
|
||||||
std::string & AText(const wchar_t * name);
|
|
||||||
std::string & AText(const wchar_t * name, const char * def);
|
|
||||||
std::string & AText(const std::wstring & name, const char * def);
|
|
||||||
|
|
||||||
int Int(const wchar_t *);
|
int Int(const wchar_t *);
|
||||||
int Int(const wchar_t * name, int def);
|
int Int(const wchar_t * name, int def);
|
||||||
@@ -631,7 +700,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
PT::SpaceParser parser;
|
PT::SpaceParser parser;
|
||||||
std::string default_str;
|
|
||||||
bool errors_to_stdout;
|
bool errors_to_stdout;
|
||||||
|
|
||||||
void ShowError();
|
void ShowError();
|
||||||
@@ -644,6 +712,9 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+47
-9
@@ -1,26 +1,54 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_cookieparser
|
#ifndef headerfile_winix_core_cookieparser
|
||||||
#define headerfile_winix_core_cookieparser
|
#define headerfile_winix_core_cookieparser
|
||||||
|
|
||||||
#include <fcgiapp.h>
|
|
||||||
#include "httpsimpleparser.h"
|
#include "httpsimpleparser.h"
|
||||||
#include "requesttypes.h"
|
#include "requesttypes.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CookieParser : public HttpSimpleParser
|
class CookieParser : public HttpSimpleParser
|
||||||
{
|
{
|
||||||
|
|
||||||
const char * cookie_string;
|
const wchar_t * cookie_string;
|
||||||
CookieTab * cookie_tab;
|
CookieTab * cookie_tab;
|
||||||
|
|
||||||
|
|
||||||
@@ -32,17 +60,18 @@ protected:
|
|||||||
if( !cookie_string || *cookie_string == 0 )
|
if( !cookie_string || *cookie_string == 0 )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return (int)(unsigned char)*(cookie_string++);
|
return (int)*(cookie_string++);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
virtual void Parameter(std::string & name, std::string & value)
|
|
||||||
|
virtual void Parameter(std::wstring & name, std::wstring & value)
|
||||||
{
|
{
|
||||||
// Cookie names are case insensitive according to section 3.1 of RFC 2965
|
// Cookie names are case insensitive according to section 3.1 of RFC 2965
|
||||||
|
// (we don't use locale here)
|
||||||
ToLower(name);
|
ToLower(name);
|
||||||
|
|
||||||
std::pair<CookieTab::iterator, bool> res = cookie_tab->insert( std::make_pair(name, value) );
|
std::pair<CookieTab::iterator, bool> res = cookie_tab->insert( std::make_pair(name, value) );
|
||||||
|
|
||||||
log << log2 << "Cookie, name: \"" << name << "\", value: \"" << value << "\"";
|
log << log2 << "Cookie, name: \"" << name << "\", value: \"" << value << "\"";
|
||||||
|
|
||||||
if( res.second == false )
|
if( res.second == false )
|
||||||
@@ -64,11 +93,12 @@ public:
|
|||||||
HttpSimpleParser::value_can_be_quoted = true;
|
HttpSimpleParser::value_can_be_quoted = true;
|
||||||
HttpSimpleParser::skip_white_chars = true;
|
HttpSimpleParser::skip_white_chars = true;
|
||||||
HttpSimpleParser::recognize_special_chars = false;
|
HttpSimpleParser::recognize_special_chars = false;
|
||||||
|
HttpSimpleParser::getchar_returns_utf8_chars = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// cookie_string can be null
|
// cookie_string can be null
|
||||||
void Parse(const char * cookie_string_, CookieTab & cookie_tab_)
|
void Parse(const wchar_t * cookie_string_, CookieTab & cookie_tab_)
|
||||||
{
|
{
|
||||||
cookie_string = cookie_string_;
|
cookie_string = cookie_string_;
|
||||||
cookie_tab = &cookie_tab_;
|
cookie_tab = &cookie_tab_;
|
||||||
@@ -76,8 +106,16 @@ public:
|
|||||||
HttpSimpleParser::Parse();
|
HttpSimpleParser::Parse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Parse(const std::wstring & cookie_string_, CookieTab & cookie_tab_)
|
||||||
|
{
|
||||||
|
Parse(cookie_string_.c_str(), cookie_tab_);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+37
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2011-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@@ -14,6 +39,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Crypt::SetConfig(Config * pconfig)
|
void Crypt::SetConfig(Config * pconfig)
|
||||||
{
|
{
|
||||||
config = pconfig;
|
config = pconfig;
|
||||||
@@ -312,3 +342,7 @@ void Crypt::PassHashCrypt(UserPass & up)
|
|||||||
PassCrypt(config->pass_rsa_private_key, up);
|
PassCrypt(config->pass_rsa_private_key, up);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+36
-4
@@ -1,22 +1,51 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2011-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_crypt
|
#ifndef headerfile_winix_core_crypt
|
||||||
#define headerfile_winix_core_crypt
|
#define headerfile_winix_core_crypt
|
||||||
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "run.h"
|
#include "run.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "user.h"
|
#include "user.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
the kind of hashes we are able to obtain in winix
|
the kind of hashes we are able to obtain in winix
|
||||||
*/
|
*/
|
||||||
@@ -258,5 +287,8 @@ void Crypt::ConvertToHexForm(const std::string & in, StringType & out)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+35
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2010-2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_cur
|
#ifndef headerfile_winix_core_cur
|
||||||
@@ -15,6 +40,11 @@
|
|||||||
#include "mount.h"
|
#include "mount.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
current request and session
|
current request and session
|
||||||
*/
|
*/
|
||||||
@@ -31,6 +61,8 @@ struct Cur
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+38
-3
@@ -1,16 +1,46 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dircontainer.h"
|
#include "dircontainer.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::wstring DirContainer::dir_etc = L"etc";
|
std::wstring DirContainer::dir_etc = L"etc";
|
||||||
std::wstring DirContainer::dir_var = L"var";
|
std::wstring DirContainer::dir_var = L"var";
|
||||||
|
|
||||||
@@ -328,3 +358,8 @@ bool DirContainer::DelById(long id)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+36
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_dircontainer
|
#ifndef headerfile_winix_core_dircontainer
|
||||||
@@ -15,6 +40,10 @@
|
|||||||
#include "item.h"
|
#include "item.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class DirContainer
|
class DirContainer
|
||||||
{
|
{
|
||||||
@@ -92,4 +121,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+39
-4
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dirs.h"
|
#include "dirs.h"
|
||||||
@@ -12,6 +37,9 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Dirs::SetDb(Db * pdb)
|
void Dirs::SetDb(Db * pdb)
|
||||||
@@ -517,7 +545,11 @@ void Dirs::CopyDirTab(const std::vector<Item*> & in, std::vector<Item*> & out)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
!! IMPROVE ME
|
||||||
|
may dir_tab can be empty when link_to is not relative?
|
||||||
|
and now the algorith doesn't check if link_to is not relative (it only uses dir_tab)
|
||||||
|
*/
|
||||||
bool Dirs::AnalyzeDir(std::vector<Item*> & dir_tab, const std::wstring & link_to, size_t & i)
|
bool Dirs::AnalyzeDir(std::vector<Item*> & dir_tab, const std::wstring & link_to, size_t & i)
|
||||||
{
|
{
|
||||||
size_t old_i;
|
size_t old_i;
|
||||||
@@ -752,3 +784,6 @@ void Dirs::LogDir(const std::vector<Item*> & dir_tab)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+37
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_dirs
|
#ifndef headerfile_winix_core_dirs
|
||||||
@@ -22,7 +47,13 @@
|
|||||||
#include "notify/notify.h"
|
#include "notify/notify.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
// !! IMPROVE ME
|
||||||
// we do not support '..' in a path (for simplicity and security reasons)
|
// we do not support '..' in a path (for simplicity and security reasons)
|
||||||
|
// (we will support '..' in the future)
|
||||||
|
|
||||||
|
|
||||||
class Dirs
|
class Dirs
|
||||||
@@ -115,4 +146,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+34
-3
@@ -1,16 +1,44 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_error
|
#ifndef headerfile_winix_core_error
|
||||||
#define headerfile_winix_core_error
|
#define headerfile_winix_core_error
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define WINIX_ERR_OK 0
|
#define WINIX_ERR_OK 0
|
||||||
@@ -77,4 +105,7 @@ typedef int Error;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+34
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_group
|
#ifndef headerfile_winix_core_group
|
||||||
@@ -14,6 +39,10 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct Group
|
struct Group
|
||||||
{
|
{
|
||||||
@@ -38,6 +67,8 @@ struct Group
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+32
-22
@@ -1,15 +1,43 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "groups.h"
|
#include "groups.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Groups::Groups()
|
Groups::Groups()
|
||||||
@@ -94,23 +122,5 @@ bool Groups::Remove(long group_id)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+33
-5
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_groups
|
#ifndef headerfile_winix_core_groups
|
||||||
@@ -17,6 +42,10 @@
|
|||||||
#include "db/db.h"
|
#include "db/db.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Groups
|
class Groups
|
||||||
{
|
{
|
||||||
@@ -45,8 +74,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+138
-14
@@ -1,16 +1,47 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "htmlfilter.h"
|
#include "htmlfilter.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void HTMLFilter::Item::Clear()
|
void HTMLFilter::Item::Clear()
|
||||||
{
|
{
|
||||||
name.clear();
|
name.clear();
|
||||||
@@ -193,6 +224,13 @@ void HTMLFilter::SafeMode(bool safe_mode_)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void HTMLFilter::SetNoFilterTag(const std::wstring & tag_name)
|
||||||
|
{
|
||||||
|
no_filter_tag = tag_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HTMLFilter::Item & HTMLFilter::GetItem(size_t i)
|
HTMLFilter::Item & HTMLFilter::GetItem(size_t i)
|
||||||
{
|
{
|
||||||
@@ -340,7 +378,6 @@ void HTMLFilter::PutLastTagWithClosingTag()
|
|||||||
{
|
{
|
||||||
const wchar_t * start = pchar;
|
const wchar_t * start = pchar;
|
||||||
|
|
||||||
|
|
||||||
while( *pchar != 0 )
|
while( *pchar != 0 )
|
||||||
{
|
{
|
||||||
if( IsOpeningTagMark() )
|
if( IsOpeningTagMark() )
|
||||||
@@ -362,6 +399,31 @@ const wchar_t * start = pchar;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// used with <nofilter> </nofilter> tags
|
||||||
|
void HTMLFilter::PutTextBetweenLastTagWithClosingTag()
|
||||||
|
{
|
||||||
|
const wchar_t * start = pchar, * end = pchar;
|
||||||
|
|
||||||
|
while( *pchar != 0 )
|
||||||
|
{
|
||||||
|
if( IsOpeningTagMark() )
|
||||||
|
{
|
||||||
|
if( IsClosingTagForLastItem() )
|
||||||
|
{
|
||||||
|
PopStack();
|
||||||
|
CheckNewLine();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pchar += 1;
|
||||||
|
end = pchar;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Put(start, end);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -444,16 +506,34 @@ void HTMLFilter::ReadItemAttrValue(bool has_quote)
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
// sprawdzic to wszedzie bo teraz jest tablica
|
||||||
attr_value.clear();
|
attr_value.clear();
|
||||||
|
attr_value_temp.clear();
|
||||||
|
|
||||||
// !! moze dodac obsluge escepowania cudzyslowu? sprawdzic czy to jest dostepne w htmlu
|
// !! dodac obsluge pojedynczego cudzyslowu
|
||||||
for( i=0 ; *pchar && *pchar != '\"' && !IsClosingTagMark() && (has_quote || (*pchar!=10 && !IsWhite(*pchar)) ); ++i )
|
|
||||||
|
for(i=0 ; *pchar && *pchar != '\"' && !IsClosingTagMark() && (has_quote || (*pchar!=10 && !IsWhite(*pchar)) ); ++i )
|
||||||
{
|
{
|
||||||
|
if( *pchar==10 || IsWhite(*pchar) )
|
||||||
|
{
|
||||||
|
if( !attr_value_temp.empty() )
|
||||||
|
{
|
||||||
|
attr_value.push_back(attr_value_temp);
|
||||||
|
attr_value_temp.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
if( i < WINIX_HTMLFILTER_ATTR_VALUE_MAXLEN )
|
if( i < WINIX_HTMLFILTER_ATTR_VALUE_MAXLEN )
|
||||||
attr_value += *pchar;
|
attr_value_temp += *pchar;
|
||||||
|
|
||||||
++pchar;
|
++pchar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !attr_value_temp.empty() )
|
||||||
|
{
|
||||||
|
attr_value.push_back(attr_value_temp);
|
||||||
|
attr_value_temp.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -715,14 +795,22 @@ void HTMLFilter::PutClosingTagMark()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// !! zmienic na lepsza nazwe
|
||||||
|
// bo to nie zwraca true jesli tag jest safe
|
||||||
bool HTMLFilter::IsTagSafe(const wchar_t * tag)
|
bool HTMLFilter::IsTagSafe(const wchar_t * tag)
|
||||||
{
|
{
|
||||||
if( !safe_mode )
|
if( !safe_mode )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if( IsNameEqual(tag, no_filter_tag.c_str()) )
|
||||||
|
return false;
|
||||||
|
|
||||||
static const wchar_t * unsafe_tags[] = {
|
static const wchar_t * unsafe_tags[] = {
|
||||||
L"script", L"iframe", L"frame", L"frameset",
|
L"applet", L"base", L"body",
|
||||||
L"applet", L"head", L"meta", L"html", L"link", L"body"
|
L"embed", L"head", L"html",
|
||||||
|
L"frame", L"frameset",L"iframe",
|
||||||
|
L"link", L"meta", L"param"
|
||||||
|
L"object", L"script"
|
||||||
};
|
};
|
||||||
|
|
||||||
size_t len = sizeof(unsafe_tags) / sizeof(const wchar_t*);
|
size_t len = sizeof(unsafe_tags) / sizeof(const wchar_t*);
|
||||||
@@ -750,7 +838,8 @@ bool HTMLFilter::IsTagSafe(const std::wstring & tag)
|
|||||||
bool HTMLFilter::PutOpeningTag()
|
bool HTMLFilter::PutOpeningTag()
|
||||||
{
|
{
|
||||||
if( !IsTagSafe(LastItem().name) )
|
if( !IsTagSafe(LastItem().name) )
|
||||||
// dodac tutaj skipniecie calego tagu
|
// !! IMPROVE ME
|
||||||
|
// !! dodac tutaj skipniecie calego tagu
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PutOpeningTagMark();
|
PutOpeningTagMark();
|
||||||
@@ -940,6 +1029,9 @@ const wchar_t * last_non_white = pchar;
|
|||||||
|
|
||||||
bool HTMLFilter::PrintOpeningItem()
|
bool HTMLFilter::PrintOpeningItem()
|
||||||
{
|
{
|
||||||
|
if( IsNameEqual(no_filter_tag, LastItem().name) )
|
||||||
|
return true;
|
||||||
|
|
||||||
if( last_new_line )
|
if( last_new_line )
|
||||||
{
|
{
|
||||||
PutNewLine();
|
PutNewLine();
|
||||||
@@ -976,6 +1068,8 @@ bool HTMLFilter::ReadItemAttr()
|
|||||||
pchar += 1; // skipping '='
|
pchar += 1; // skipping '='
|
||||||
SkipWhiteLines();
|
SkipWhiteLines();
|
||||||
|
|
||||||
|
|
||||||
|
// !! dodac obsluge pojedynczego cudzyslowu
|
||||||
bool has_quote = (*pchar == '\"');
|
bool has_quote = (*pchar == '\"');
|
||||||
|
|
||||||
if( has_quote )
|
if( has_quote )
|
||||||
@@ -996,7 +1090,11 @@ bool HTMLFilter::CheckItemAttr()
|
|||||||
if( attr_has_value && IsNameEqual(L"lang", attr_name) )
|
if( attr_has_value && IsNameEqual(L"lang", attr_name) )
|
||||||
{
|
{
|
||||||
LastItem().porphans = 0;
|
LastItem().porphans = 0;
|
||||||
attr_value_lower = attr_value;
|
|
||||||
|
if( !attr_value.empty() )
|
||||||
|
{
|
||||||
|
// we are taking the first value only
|
||||||
|
attr_value_lower = attr_value[0];
|
||||||
ToLower(attr_value_lower);
|
ToLower(attr_value_lower);
|
||||||
|
|
||||||
OrphansTab::iterator i = orphans_tab.find(attr_value_lower);
|
OrphansTab::iterator i = orphans_tab.find(attr_value_lower);
|
||||||
@@ -1004,20 +1102,34 @@ bool HTMLFilter::CheckItemAttr()
|
|||||||
if( i != orphans_tab.end() )
|
if( i != orphans_tab.end() )
|
||||||
LastItem().porphans = &i->second;
|
LastItem().porphans = &i->second;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HTMLFilter::PrinItemAttr()
|
void HTMLFilter::PrintItemAttr()
|
||||||
{
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
if( IsNameEqual(no_filter_tag, LastItem().name) )
|
||||||
|
return;
|
||||||
|
|
||||||
Put(' ');
|
Put(' ');
|
||||||
Put(attr_name);
|
Put(attr_name);
|
||||||
|
|
||||||
if( attr_has_value )
|
if( attr_has_value )
|
||||||
{
|
{
|
||||||
Put(L"=\"");
|
Put(L"=\"");
|
||||||
Put(attr_value);
|
|
||||||
|
for(i=0 ; i<attr_value.size() ; ++i)
|
||||||
|
{
|
||||||
|
Put(attr_value[i]);
|
||||||
|
|
||||||
|
if( i + 1 < attr_value.size() )
|
||||||
|
Put(' ');
|
||||||
|
}
|
||||||
|
|
||||||
Put('\"');
|
Put('\"');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1059,16 +1171,19 @@ void HTMLFilter::ReadItemOpening()
|
|||||||
while( ReadItemAttr() )
|
while( ReadItemAttr() )
|
||||||
{
|
{
|
||||||
if( CheckItemAttr() )
|
if( CheckItemAttr() )
|
||||||
PrinItemAttr();
|
PrintItemAttr();
|
||||||
}
|
}
|
||||||
|
|
||||||
SkipAndCheckClosingTag(); // here LastItem().type can be changed to 'simple'
|
SkipAndCheckClosingTag(); // here LastItem().type can be changed to 'simple'
|
||||||
|
|
||||||
|
if( !IsNameEqual(no_filter_tag, LastItem().name) )
|
||||||
|
{
|
||||||
if( LastItem().type == Item::simple )
|
if( LastItem().type == Item::simple )
|
||||||
Put(L" /");
|
Put(L" /");
|
||||||
|
|
||||||
PutClosingTagMark();
|
PutClosingTagMark();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1191,6 +1306,11 @@ bool HTMLFilter::IsLastTag(const wchar_t * name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool HTMLFilter::IsLastTag(const std::wstring & name)
|
||||||
|
{
|
||||||
|
return IsNameEqual(name, LastItem().name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// checking exceptions for opening tags
|
// checking exceptions for opening tags
|
||||||
void HTMLFilter::CheckExceptions()
|
void HTMLFilter::CheckExceptions()
|
||||||
@@ -1217,6 +1337,9 @@ void HTMLFilter::CheckExceptions()
|
|||||||
if( IsLastTag(L"pre") || IsLastTag(L"textarea") )
|
if( IsLastTag(L"pre") || IsLastTag(L"textarea") )
|
||||||
PutLastTagWithClosingTag();
|
PutLastTagWithClosingTag();
|
||||||
|
|
||||||
|
if( IsLastTag(no_filter_tag) )
|
||||||
|
PutTextBetweenLastTagWithClosingTag();
|
||||||
|
|
||||||
if( IsLastTag(L"body") )
|
if( IsLastTag(L"body") )
|
||||||
LastItem().has_body_tag = true;
|
LastItem().has_body_tag = true;
|
||||||
}
|
}
|
||||||
@@ -1397,4 +1520,5 @@ void HTMLFilter::Read()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+52
-5
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_htmlfilter
|
#ifndef headerfile_winix_core_htmlfilter
|
||||||
@@ -16,6 +41,10 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// max length of a name of a html tag (with terminating null)
|
// max length of a name of a html tag (with terminating null)
|
||||||
@@ -106,6 +135,11 @@ public:
|
|||||||
void InsertTabs(size_t tabsize);
|
void InsertTabs(size_t tabsize);
|
||||||
|
|
||||||
|
|
||||||
|
// set a name of a html tag which will be used as 'nofilter' tag
|
||||||
|
// elements between such tags are not filtered (similarly as in <pre> and <textarea>)
|
||||||
|
// these tags (opening and closing) will no be placed in the html output
|
||||||
|
void SetNoFilterTag(const std::wstring & tag_name);
|
||||||
|
|
||||||
// orphans are checked only in 'body' tag
|
// orphans are checked only in 'body' tag
|
||||||
void AssignOrphans(const wchar_t * lang_code, const std::vector<std::wstring> & otab);
|
void AssignOrphans(const wchar_t * lang_code, const std::vector<std::wstring> & otab);
|
||||||
void AssignOrphans(const std::wstring & lang_code, const std::vector<std::wstring> & otab);
|
void AssignOrphans(const std::wstring & lang_code, const std::vector<std::wstring> & otab);
|
||||||
@@ -139,6 +173,9 @@ protected:
|
|||||||
typedef std::map<std::wstring, Orphans> OrphansTab;
|
typedef std::map<std::wstring, Orphans> OrphansTab;
|
||||||
OrphansTab orphans_tab;
|
OrphansTab orphans_tab;
|
||||||
|
|
||||||
|
// html <nofilter> tag name
|
||||||
|
std::wstring no_filter_tag;
|
||||||
|
|
||||||
|
|
||||||
struct Item
|
struct Item
|
||||||
{
|
{
|
||||||
@@ -169,6 +206,10 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
virtual methods
|
virtual methods
|
||||||
*/
|
*/
|
||||||
@@ -219,6 +260,7 @@ protected:
|
|||||||
bool IsNameEqual(const std::wstring & name1, const std::wstring & name2, size_t len);
|
bool IsNameEqual(const std::wstring & name1, const std::wstring & name2, size_t len);
|
||||||
|
|
||||||
bool IsLastTag(const wchar_t * name);
|
bool IsLastTag(const wchar_t * name);
|
||||||
|
bool IsLastTag(const std::wstring & name);
|
||||||
bool IsTagSafe(const wchar_t * tag);
|
bool IsTagSafe(const wchar_t * tag);
|
||||||
bool IsTagSafe(const std::wstring & tag);
|
bool IsTagSafe(const std::wstring & tag);
|
||||||
|
|
||||||
@@ -250,7 +292,7 @@ protected:
|
|||||||
|
|
||||||
bool ReadItemAttr();
|
bool ReadItemAttr();
|
||||||
bool CheckItemAttr();
|
bool CheckItemAttr();
|
||||||
void PrinItemAttr();
|
void PrintItemAttr();
|
||||||
|
|
||||||
void ReadItemClosing();
|
void ReadItemClosing();
|
||||||
void ReadItemSpecial();
|
void ReadItemSpecial();
|
||||||
@@ -266,6 +308,7 @@ protected:
|
|||||||
void PutNormalNonWhite(const wchar_t * & str, const wchar_t * end);
|
void PutNormalNonWhite(const wchar_t * & str, const wchar_t * end);
|
||||||
void PutNormalWhite(const wchar_t * & str, const wchar_t * end);
|
void PutNormalWhite(const wchar_t * & str, const wchar_t * end);
|
||||||
void PutLastTagWithClosingTag();
|
void PutLastTagWithClosingTag();
|
||||||
|
void PutTextBetweenLastTagWithClosingTag();
|
||||||
void PutTabs(size_t len);
|
void PutTabs(size_t len);
|
||||||
void PutNonBreakingSpace();
|
void PutNonBreakingSpace();
|
||||||
void PutNewLine();
|
void PutNewLine();
|
||||||
@@ -284,7 +327,8 @@ protected:
|
|||||||
size_t tab_size;
|
size_t tab_size;
|
||||||
OrphanMode orphan_mode;
|
OrphanMode orphan_mode;
|
||||||
std::wstring attr_name;
|
std::wstring attr_name;
|
||||||
std::wstring attr_value;
|
std::vector<std::wstring> attr_value;
|
||||||
|
std::wstring attr_value_temp;
|
||||||
std::wstring attr_value_lower;
|
std::wstring attr_value_lower;
|
||||||
bool attr_has_value;
|
bool attr_has_value;
|
||||||
std::wstring lang_code_lower;
|
std::wstring lang_code_lower;
|
||||||
@@ -295,5 +339,8 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+102
-64
@@ -1,23 +1,55 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "httpsimpleparser.h"
|
#include "httpsimpleparser.h"
|
||||||
|
#include "misc.h"
|
||||||
|
#include "utf8/utf8.h"
|
||||||
|
|
||||||
|
|
||||||
void HttpSimpleParser::ToLower(std::string & s)
|
|
||||||
|
namespace Winix
|
||||||
{
|
{
|
||||||
std::string::iterator i;
|
|
||||||
|
|
||||||
for(i=s.begin() ; i!= s.end() ; ++i)
|
|
||||||
|
|
||||||
|
|
||||||
|
void HttpSimpleParser::ToLower(std::wstring & s)
|
||||||
|
{
|
||||||
|
for(wchar_t & c : s)
|
||||||
{
|
{
|
||||||
if( *i>='A' && *i<='Z' )
|
if( c>='A' && c<='Z' )
|
||||||
*i = *i - 'A' + 'a';
|
c = c - 'A' + 'a';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,38 +71,6 @@ void HttpSimpleParser::SkipWhiteChars()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void HttpSimpleParser::TrimWhiteChars(std::string & s)
|
|
||||||
{
|
|
||||||
if( s.empty() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
std::string::size_type i;
|
|
||||||
|
|
||||||
for(i = 0 ; i<s.size() && IsWhite(s[i]) ; ++i);
|
|
||||||
|
|
||||||
if( i == s.size() )
|
|
||||||
{
|
|
||||||
// all characters are white
|
|
||||||
s.clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( i > 0 )
|
|
||||||
// there are some white characters at the beginning
|
|
||||||
s.erase(0, i);
|
|
||||||
|
|
||||||
|
|
||||||
// s is not empty now (i was not equal s.size())
|
|
||||||
// and we have some non white characters
|
|
||||||
// we stops at the last non white character
|
|
||||||
for(i = s.size()-1 ; i>0 && IsWhite(s[i]) ; --i);
|
|
||||||
|
|
||||||
if( i != s.size()-1 )
|
|
||||||
// there are some white characters at the end
|
|
||||||
// we're starting from i+1 even when i==0 (there are some non white characters)
|
|
||||||
s.erase(i+1, s.size() - i - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int HttpSimpleParser::ParseHalfHex(int c)
|
int HttpSimpleParser::ParseHalfHex(int c)
|
||||||
@@ -121,33 +121,42 @@ void HttpSimpleParser::CheckSpecialChar()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void HttpSimpleParser::ReadName()
|
void HttpSimpleParser::ReadName()
|
||||||
{
|
{
|
||||||
// we're checking 'separator' and '=' because the string is allowed not having '=' (the value is optional)
|
// we're checking 'separator' and '=' because the string is allowed not having '=' (the value is optional)
|
||||||
|
|
||||||
|
utf8_token.clear();
|
||||||
|
last_name.clear();
|
||||||
|
|
||||||
for( ; last_c!=-1 && last_c!=separator && last_c!='=' ; last_c = GetChar() )
|
for( ; last_c!=-1 && last_c!=separator && last_c!='=' ; last_c = GetChar() )
|
||||||
{
|
{
|
||||||
if( recognize_special_chars )
|
if( recognize_special_chars )
|
||||||
CheckSpecialChar();
|
CheckSpecialChar();
|
||||||
|
|
||||||
if( last_c != -1 )
|
if( last_c != -1 )
|
||||||
|
{
|
||||||
|
if( getchar_returns_utf8_chars )
|
||||||
|
utf8_token += last_c;
|
||||||
|
else
|
||||||
last_name += last_c;
|
last_name += last_c;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( getchar_returns_utf8_chars )
|
||||||
|
PT::UTF8ToWide(utf8_token, last_name);
|
||||||
|
|
||||||
if( last_c == '=' )
|
if( last_c == '=' )
|
||||||
last_c = GetChar();
|
last_c = GetChar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void HttpSimpleParser::ReadQuotedValue()
|
void HttpSimpleParser::ReadQuotedValue()
|
||||||
{
|
{
|
||||||
// skipping '"'
|
// skipping '"'
|
||||||
last_c = GetChar();
|
last_c = GetChar();
|
||||||
|
utf8_token.clear();
|
||||||
|
last_value.clear();
|
||||||
|
|
||||||
for( ; last_c!=-1 && last_c!='"' ; last_c = GetChar() )
|
for( ; last_c!=-1 && last_c!='"' ; last_c = GetChar() )
|
||||||
{
|
{
|
||||||
@@ -155,9 +164,16 @@ void HttpSimpleParser::ReadQuotedValue()
|
|||||||
CheckSpecialChar();
|
CheckSpecialChar();
|
||||||
|
|
||||||
if( last_c != -1 )
|
if( last_c != -1 )
|
||||||
|
{
|
||||||
|
if( getchar_returns_utf8_chars )
|
||||||
|
utf8_token += last_c;
|
||||||
|
else
|
||||||
last_value += last_c;
|
last_value += last_c;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( getchar_returns_utf8_chars )
|
||||||
|
PT::UTF8ToWide(utf8_token, last_value);
|
||||||
|
|
||||||
if( last_c == '"' )
|
if( last_c == '"' )
|
||||||
last_c = GetChar();
|
last_c = GetChar();
|
||||||
@@ -168,27 +184,40 @@ void HttpSimpleParser::ReadQuotedValue()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HttpSimpleParser::ReadValue()
|
void HttpSimpleParser::ReadNormalValue()
|
||||||
{
|
{
|
||||||
if( skip_white_chars )
|
utf8_token.clear();
|
||||||
SkipWhiteChars();
|
last_value.clear();
|
||||||
|
|
||||||
if( value_can_be_quoted && last_c == '"' )
|
|
||||||
{
|
|
||||||
ReadQuotedValue();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for( ; last_c!=-1 && last_c!=separator ; last_c = GetChar() )
|
for( ; last_c!=-1 && last_c!=separator ; last_c = GetChar() )
|
||||||
{
|
{
|
||||||
if( recognize_special_chars )
|
if( recognize_special_chars )
|
||||||
CheckSpecialChar();
|
CheckSpecialChar();
|
||||||
|
|
||||||
if( last_c != -1 )
|
if( last_c != -1 )
|
||||||
|
{
|
||||||
|
if( getchar_returns_utf8_chars )
|
||||||
|
utf8_token += last_c;
|
||||||
|
else
|
||||||
last_value += last_c;
|
last_value += last_c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( getchar_returns_utf8_chars )
|
||||||
|
PT::UTF8ToWide(utf8_token, last_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void HttpSimpleParser::ReadValue()
|
||||||
|
{
|
||||||
|
if( skip_white_chars )
|
||||||
|
SkipWhiteChars();
|
||||||
|
|
||||||
|
if( value_can_be_quoted && last_c == '"' )
|
||||||
|
ReadQuotedValue();
|
||||||
|
else
|
||||||
|
ReadNormalValue();
|
||||||
|
|
||||||
|
|
||||||
if( last_c == separator )
|
if( last_c == separator )
|
||||||
last_c = GetChar();
|
last_c = GetChar();
|
||||||
@@ -197,6 +226,21 @@ void HttpSimpleParser::ReadValue()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* there can be some important values like passwords so its better
|
||||||
|
* to clear them now
|
||||||
|
*/
|
||||||
|
void HttpSimpleParser::Clear()
|
||||||
|
{
|
||||||
|
Overwrite(last_name);
|
||||||
|
Overwrite(last_value);
|
||||||
|
Overwrite(utf8_token);
|
||||||
|
last_name.clear();
|
||||||
|
last_value.clear();
|
||||||
|
utf8_token.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void HttpSimpleParser::Parse()
|
void HttpSimpleParser::Parse()
|
||||||
{
|
{
|
||||||
for( last_c = GetChar() ; last_c != -1 ; )
|
for( last_c = GetChar() ; last_c != -1 ; )
|
||||||
@@ -211,25 +255,19 @@ void HttpSimpleParser::Parse()
|
|||||||
|
|
||||||
if( skip_white_chars )
|
if( skip_white_chars )
|
||||||
{
|
{
|
||||||
TrimWhiteChars(last_name);
|
TrimWhite(last_name);
|
||||||
TrimWhiteChars(last_value);
|
TrimWhite(last_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Parameter(last_name, last_value); // user definied function
|
Parameter(last_name, last_value); // user definied function
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+48
-9
@@ -1,19 +1,47 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_httpsimpleparser
|
#ifndef headerfile_winix_core_httpsimpleparser
|
||||||
#define headerfile_winix_core_httpsimpleparser
|
#define headerfile_winix_core_httpsimpleparser
|
||||||
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class HttpSimpleParser
|
class HttpSimpleParser
|
||||||
{
|
{
|
||||||
@@ -24,26 +52,33 @@ protected:
|
|||||||
bool skip_white_chars;
|
bool skip_white_chars;
|
||||||
bool recognize_special_chars;
|
bool recognize_special_chars;
|
||||||
|
|
||||||
|
// if false then GetChar() returns wide characters (converted to int)
|
||||||
|
// if true then GetChar() returns utf8 characters (we have to convert them from utf8 to wide chars)
|
||||||
|
bool getchar_returns_utf8_chars;
|
||||||
|
|
||||||
int ParseHalfHex(int c);
|
int ParseHalfHex(int c);
|
||||||
void ReadName();
|
void ReadName();
|
||||||
void ReadQuotedValue();
|
void ReadQuotedValue();
|
||||||
|
void ReadNormalValue();
|
||||||
void ReadValue();
|
void ReadValue();
|
||||||
|
void Clear();
|
||||||
|
|
||||||
std::string last_name;
|
std::wstring last_name;
|
||||||
std::string last_value;
|
std::wstring last_value;
|
||||||
|
std::string utf8_token;
|
||||||
|
|
||||||
int last_c;
|
int last_c;
|
||||||
int separator;
|
int separator;
|
||||||
|
|
||||||
// '-1' means end (eof)
|
// '-1' means end (eof)
|
||||||
|
// when there is an eof this method can be called more than once (it should always return -1 in such a case)
|
||||||
virtual int GetChar() = 0;
|
virtual int GetChar() = 0;
|
||||||
virtual void Parameter(std::string & last_name, std::string & last_value) = 0;
|
virtual void Parameter(std::wstring & last_name, std::wstring & last_value) = 0;
|
||||||
|
|
||||||
void ToLower(std::string & s);
|
void ToLower(std::wstring & s);
|
||||||
bool IsWhite(int c);
|
bool IsWhite(int c);
|
||||||
|
|
||||||
void SkipWhiteChars();
|
void SkipWhiteChars();
|
||||||
void TrimWhiteChars(std::string & s);
|
|
||||||
void CheckSpecialChar();
|
void CheckSpecialChar();
|
||||||
|
|
||||||
void Parse();
|
void Parse();
|
||||||
@@ -59,10 +94,14 @@ public:
|
|||||||
value_can_be_quoted = false;
|
value_can_be_quoted = false;
|
||||||
skip_white_chars = false;
|
skip_white_chars = false;
|
||||||
recognize_special_chars = true;
|
recognize_special_chars = true;
|
||||||
|
getchar_returns_utf8_chars = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+42
-5
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2010-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
@@ -17,6 +42,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Image::SetDb(Db * pdb)
|
void Image::SetDb(Db * pdb)
|
||||||
{
|
{
|
||||||
@@ -509,10 +539,13 @@ void Image::SaveImage()
|
|||||||
item_work.type == WINIX_IMAGE_TYPE_CROP_THUMB ||
|
item_work.type == WINIX_IMAGE_TYPE_CROP_THUMB ||
|
||||||
item_work.type == WINIX_IMAGE_TYPE_CREATE_CROP_NEW_THUMB );
|
item_work.type == WINIX_IMAGE_TYPE_CREATE_CROP_NEW_THUMB );
|
||||||
|
|
||||||
if( system->MakeFilePath(file_work, dst_path, thumb, true, config->upload_dirs_chmod) )
|
if( system->MakeFilePath(file_work, dst_path, thumb, true, config->upload_dirs_chmod, config->upload_group_int) )
|
||||||
{
|
{
|
||||||
if( RenameFile(stream_tmp_path.Str(), dst_path) )
|
if( RenameFile(stream_tmp_path.Str(), dst_path) )
|
||||||
{
|
{
|
||||||
|
// it doesn't matter for us if there is an error when chmod/chown on a file
|
||||||
|
// the admin (root) will correct it
|
||||||
|
SetPriv(dst_path, config->upload_files_chmod, config->upload_group_int);
|
||||||
ImageSavedCorrectly();
|
ImageSavedCorrectly();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -520,7 +553,7 @@ void Image::SaveImage()
|
|||||||
log << log1 << "Image: cannot move a temporary file: " << stream_tmp_path.Str()
|
log << log1 << "Image: cannot move a temporary file: " << stream_tmp_path.Str()
|
||||||
<< ", to: " << dst_path << logend;
|
<< ", to: " << dst_path << logend;
|
||||||
|
|
||||||
::RemoveFile(stream_tmp_path.Str());
|
Winix::RemoveFile(stream_tmp_path.Str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -592,3 +625,7 @@ void Image::CreateThumbnail()
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+36
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2010-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_image
|
#ifndef headerfile_winix_core_image
|
||||||
@@ -19,6 +44,11 @@
|
|||||||
#include "core/config.h"
|
#include "core/config.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class System;
|
class System;
|
||||||
|
|
||||||
|
|
||||||
@@ -179,4 +209,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+38
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2012-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_ipban
|
#ifndef headerfile_winix_core_ipban
|
||||||
@@ -13,6 +38,12 @@
|
|||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// telling if the IPBan record is active
|
// telling if the IPBan record is active
|
||||||
// we have two records: active and non active
|
// we have two records: active and non active
|
||||||
// non active records is something like a history
|
// non active records is something like a history
|
||||||
@@ -147,4 +178,8 @@ struct IPBan
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+35
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@@ -13,6 +38,10 @@
|
|||||||
#include "date/date.h"
|
#include "date/date.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
IPBanContainer::IPBanContainer()
|
IPBanContainer::IPBanContainer()
|
||||||
{
|
{
|
||||||
@@ -216,6 +245,9 @@ bool IPBanContainer::SortIPBansFunction(const IPBan & ip1, const IPBan & ip2)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+35
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_ipbancontainer
|
#ifndef headerfile_winix_core_ipbancontainer
|
||||||
@@ -14,6 +39,10 @@
|
|||||||
#include "ipban.h"
|
#include "ipban.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class IPBanContainer
|
class IPBanContainer
|
||||||
{
|
{
|
||||||
@@ -54,5 +83,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+36
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
@@ -12,6 +37,11 @@
|
|||||||
#include "crypt.h"
|
#include "crypt.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Item::Item()
|
Item::Item()
|
||||||
{
|
{
|
||||||
@@ -80,3 +110,6 @@ void Item::Clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+35
-4
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_item
|
#ifndef headerfile_winix_core_item
|
||||||
@@ -15,6 +40,9 @@
|
|||||||
#include "date/date.h"
|
#include "date/date.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
#define WINIX_ITEM_FILETYPE_NONE 0
|
#define WINIX_ITEM_FILETYPE_NONE 0
|
||||||
#define WINIX_ITEM_FILETYPE_IMAGE 1
|
#define WINIX_ITEM_FILETYPE_IMAGE 1
|
||||||
@@ -76,7 +104,7 @@ struct Item
|
|||||||
|
|
||||||
// used when type is symlink or to a directory too (function 'default')
|
// used when type is symlink or to a directory too (function 'default')
|
||||||
std::wstring link_to;
|
std::wstring link_to;
|
||||||
int link_redirect;
|
int link_redirect; // !! IMPROVE ME should it be 'bool'?
|
||||||
|
|
||||||
|
|
||||||
// static file (if exists)
|
// static file (if exists)
|
||||||
@@ -118,5 +146,8 @@ friend struct DbItemColumns;
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+36
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
@@ -12,6 +37,11 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Job::Job()
|
Job::Job()
|
||||||
{
|
{
|
||||||
@@ -162,4 +192,7 @@ void Job::DoWinixJob(PT::Space & job)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+36
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_jobs
|
#ifndef headerfile_winix_core_jobs
|
||||||
@@ -16,6 +41,10 @@
|
|||||||
#include "space/space.h"
|
#include "space/space.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define WINIX_JOBS_HOW_MANY_PRIORITIES 32
|
#define WINIX_JOBS_HOW_MANY_PRIORITIES 32
|
||||||
|
|
||||||
@@ -78,5 +107,9 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+39
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2009, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2009-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -13,6 +38,12 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LastItem::LastItem()
|
LastItem::LastItem()
|
||||||
{
|
{
|
||||||
user_id = 0;
|
user_id = 0;
|
||||||
@@ -106,3 +137,8 @@ LastTab::iterator i = FindNotLoggedOut(user_id, session_id);
|
|||||||
<< user_id << " ses_id: " << session_id << logend;
|
<< user_id << " ses_id: " << session_id << logend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+37
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2009, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2009-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_lastcontainer
|
#ifndef headerfile_winix_core_lastcontainer
|
||||||
@@ -18,6 +43,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// how many items we store in the 'last' function
|
// how many items we store in the 'last' function
|
||||||
#define WINIX_LASTCONTAINER_TABLE_SIZE 100
|
#define WINIX_LASTCONTAINER_TABLE_SIZE 100
|
||||||
|
|
||||||
@@ -75,4 +105,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+37
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -12,6 +37,10 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LoadAvg::LoadAvg()
|
LoadAvg::LoadAvg()
|
||||||
{
|
{
|
||||||
@@ -370,3 +399,8 @@ double LoadAvg::ReqPerSec15()
|
|||||||
|
|
||||||
return cache_req_per_sec15;
|
return cache_req_per_sec15;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+35
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_loadavg
|
#ifndef headerfile_winix_core_loadavg
|
||||||
@@ -13,6 +38,10 @@
|
|||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// in seconds
|
// in seconds
|
||||||
@@ -110,5 +139,8 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+36
-3
@@ -1,15 +1,45 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "lock.h"
|
#include "lock.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Lock::Lock()
|
Lock::Lock()
|
||||||
{
|
{
|
||||||
@@ -47,3 +77,6 @@ void Lock::Unlock()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+37
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_lock
|
#ifndef headerfile_winix_core_lock
|
||||||
@@ -13,6 +38,11 @@
|
|||||||
#include "synchro.h"
|
#include "synchro.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Lock
|
class Lock
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -34,4 +64,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+36
-29
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
@@ -14,6 +39,11 @@
|
|||||||
#include "timezones.h"
|
#include "timezones.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log::Log()
|
Log::Log()
|
||||||
{
|
{
|
||||||
log_level = 1;
|
log_level = 1;
|
||||||
@@ -48,14 +78,14 @@ int Log::LogLevel()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Log::Init(int log_level_, bool save_each_line_, const std::string & log_file_, bool log_std, int log_max_requests)
|
void Log::Init(int log_level_, bool save_each_line_, const std::wstring & log_file_, bool log_std, int log_max_requests)
|
||||||
{
|
{
|
||||||
log_level = log_level_;
|
log_level = log_level_;
|
||||||
log_file = log_file_;
|
|
||||||
log_stdout = log_std;
|
log_stdout = log_std;
|
||||||
max_requests = log_max_requests;
|
max_requests = log_max_requests;
|
||||||
save_each_line = save_each_line_;
|
save_each_line = save_each_line_;
|
||||||
|
|
||||||
|
PT::WideToUTF8(log_file_, log_file);
|
||||||
// don't open the file here
|
// don't open the file here
|
||||||
// because it would be created with the root as an owner
|
// because it would be created with the root as an owner
|
||||||
}
|
}
|
||||||
@@ -453,28 +483,5 @@ void Log::SaveLog()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+40
-4
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_log
|
#ifndef headerfile_winix_core_log
|
||||||
@@ -20,6 +45,11 @@
|
|||||||
#include "textstream/textstream.h"
|
#include "textstream/textstream.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TimeZones;
|
class TimeZones;
|
||||||
|
|
||||||
|
|
||||||
@@ -32,7 +62,7 @@ public:
|
|||||||
~Log();
|
~Log();
|
||||||
|
|
||||||
void SetTimeZones(TimeZones * ptime_zones);
|
void SetTimeZones(TimeZones * ptime_zones);
|
||||||
void Init(int log_level_, bool save_each_line_, const std::string & log_file_, bool log_std, int log_max_requests);
|
void Init(int log_level_, bool save_each_line_, const std::wstring & log_file_, bool log_std, int log_max_requests);
|
||||||
|
|
||||||
Log & operator<<(const void * s);
|
Log & operator<<(const void * s);
|
||||||
Log & operator<<(const char * s);
|
Log & operator<<(const char * s);
|
||||||
@@ -155,6 +185,12 @@ return *this;
|
|||||||
extern Log log;
|
extern Log log;
|
||||||
extern Log nlog;
|
extern Log nlog;
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// for convenience, we have to use only #include "log.h" in the winix
|
// for convenience, we have to use only #include "log.h" in the winix
|
||||||
#include "slog.h"
|
#include "slog.h"
|
||||||
|
|
||||||
|
|||||||
+38
-3
@@ -1,16 +1,47 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_logmanipulators
|
#ifndef headerfile_winix_core_logmanipulators
|
||||||
#define headerfile_winix_core_logmanipulators
|
#define headerfile_winix_core_logmanipulators
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
log1 - the first level
|
log1 - the first level
|
||||||
log2
|
log2
|
||||||
@@ -44,5 +75,9 @@ enum LogManipulators
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+264
-193
@@ -1,14 +1,40 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <grp.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
@@ -16,6 +42,11 @@
|
|||||||
#include "templates/templates.h"
|
#include "templates/templates.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace misc_private
|
namespace misc_private
|
||||||
{
|
{
|
||||||
@@ -26,9 +57,6 @@ namespace misc_private
|
|||||||
0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x2028,
|
0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x2028,
|
||||||
0x2029, 0x202F, 0x205F, 0x3000 };
|
0x2029, 0x202F, 0x205F, 0x3000 };
|
||||||
|
|
||||||
std::ifstream get_file_content;
|
|
||||||
std::string get_file_content_ansi;
|
|
||||||
|
|
||||||
PT::WTextStream tmp_qencode;
|
PT::WTextStream tmp_qencode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,7 +174,7 @@ return buffer;
|
|||||||
|
|
||||||
void Toa(int value, std::string & res, int base, bool clear)
|
void Toa(int value, std::string & res, int base, bool clear)
|
||||||
{
|
{
|
||||||
static char buffer[50];
|
static char buffer[50]; // !! IMPROVE ME this 'static' is not needed here?
|
||||||
size_t len = sizeof(buffer) / sizeof(char);
|
size_t len = sizeof(buffer) / sizeof(char);
|
||||||
|
|
||||||
if( clear )
|
if( clear )
|
||||||
@@ -159,7 +187,7 @@ size_t len = sizeof(buffer) / sizeof(char);
|
|||||||
|
|
||||||
void Toa(long value, std::string & res, int base, bool clear)
|
void Toa(long value, std::string & res, int base, bool clear)
|
||||||
{
|
{
|
||||||
static char buffer[50];
|
static char buffer[50]; // !! IMPROVE ME the same as above
|
||||||
size_t len = sizeof(buffer) / sizeof(char);
|
size_t len = sizeof(buffer) / sizeof(char);
|
||||||
|
|
||||||
if( clear )
|
if( clear )
|
||||||
@@ -172,7 +200,7 @@ size_t len = sizeof(buffer) / sizeof(char);
|
|||||||
|
|
||||||
void Toa(int value, std::wstring & res, int base, bool clear)
|
void Toa(int value, std::wstring & res, int base, bool clear)
|
||||||
{
|
{
|
||||||
static wchar_t buffer[50];
|
static wchar_t buffer[50]; // !!
|
||||||
size_t len = sizeof(buffer) / sizeof(wchar_t);
|
size_t len = sizeof(buffer) / sizeof(wchar_t);
|
||||||
|
|
||||||
if( clear )
|
if( clear )
|
||||||
@@ -185,7 +213,7 @@ size_t len = sizeof(buffer) / sizeof(wchar_t);
|
|||||||
|
|
||||||
void Toa(long value, std::wstring & res, int base, bool clear)
|
void Toa(long value, std::wstring & res, int base, bool clear)
|
||||||
{
|
{
|
||||||
static wchar_t buffer[50];
|
static wchar_t buffer[50]; // !!
|
||||||
size_t len = sizeof(buffer) / sizeof(wchar_t);
|
size_t len = sizeof(buffer) / sizeof(wchar_t);
|
||||||
|
|
||||||
if( clear )
|
if( clear )
|
||||||
@@ -200,142 +228,6 @@ size_t len = sizeof(buffer) / sizeof(wchar_t);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AssignString(const char * src, size_t len, std::wstring & dst, bool clear)
|
|
||||||
{
|
|
||||||
if( clear )
|
|
||||||
dst.clear();
|
|
||||||
|
|
||||||
if( dst.capacity() < dst.size() + len )
|
|
||||||
dst.reserve(dst.size() + len + 128);
|
|
||||||
|
|
||||||
for(size_t i=0 ; i<len ; ++i )
|
|
||||||
dst += static_cast<unsigned char>(src[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AssignString(const char * src, std::wstring & dst, bool clear)
|
|
||||||
{
|
|
||||||
size_t len;
|
|
||||||
|
|
||||||
for(len=0 ; src[len] ; ++len){}
|
|
||||||
|
|
||||||
AssignString(src, len, dst, clear);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AssignString(const std::string & src, std::wstring & dst, bool clear)
|
|
||||||
{
|
|
||||||
AssignString(src.c_str(), src.size(), dst, clear);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AssignString(const wchar_t * src, size_t len, std::string & dst, bool clear)
|
|
||||||
{
|
|
||||||
if( clear )
|
|
||||||
dst.clear();
|
|
||||||
|
|
||||||
if( dst.capacity() < dst.size() + len )
|
|
||||||
dst.reserve(dst.size() + len + 128);
|
|
||||||
|
|
||||||
for(size_t i=0 ; i<len ; ++i)
|
|
||||||
dst += static_cast<char>(src[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AssignString(const wchar_t * src, std::string & dst, bool clear)
|
|
||||||
{
|
|
||||||
size_t len;
|
|
||||||
|
|
||||||
for(len=0 ; src[len] ; ++len){}
|
|
||||||
|
|
||||||
AssignString(src, len, dst, clear);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AssignString(const std::wstring & src, std::string & dst, bool clear)
|
|
||||||
{
|
|
||||||
AssignString(src.c_str(), src.size(), dst, clear);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AssignString(const char * src, size_t len, std::string & dst, bool clear)
|
|
||||||
{
|
|
||||||
if( clear )
|
|
||||||
dst.clear();
|
|
||||||
|
|
||||||
// we suppose that append is smart enough and we don't have to use reserve()
|
|
||||||
dst.append(src, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AssignString(const char * src, std::string & dst, bool clear)
|
|
||||||
{
|
|
||||||
size_t len;
|
|
||||||
|
|
||||||
for(len=0 ; src[len] ; ++len){}
|
|
||||||
|
|
||||||
AssignString(src, len, dst, clear);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AssignString(const std::string & src, std::string & dst, bool clear)
|
|
||||||
{
|
|
||||||
if( clear )
|
|
||||||
dst.clear();
|
|
||||||
|
|
||||||
dst.append(src);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AssignString(const wchar_t * src, size_t len, std::wstring & dst, bool clear)
|
|
||||||
{
|
|
||||||
if( clear )
|
|
||||||
dst.clear();
|
|
||||||
|
|
||||||
// we suppose that append is smart enough and we don't have to use reserve()
|
|
||||||
dst.append(src, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AssignString(const wchar_t * src, std::wstring & dst, bool clear)
|
|
||||||
{
|
|
||||||
size_t len;
|
|
||||||
|
|
||||||
for(len=0 ; src[len] ; ++len){}
|
|
||||||
|
|
||||||
AssignString(src, len, dst, clear);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AssignString(const std::wstring & src, std::wstring & dst, bool clear)
|
|
||||||
{
|
|
||||||
if( clear )
|
|
||||||
dst.clear();
|
|
||||||
|
|
||||||
dst.append(src);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool CorrectUrlChar(wchar_t c)
|
bool CorrectUrlChar(wchar_t c)
|
||||||
{
|
{
|
||||||
return (c >= 'a' && c <='z') ||
|
return (c >= 'a' && c <='z') ||
|
||||||
@@ -658,6 +550,18 @@ return path[path.size()-1] == '/';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Overwrite(std::string & str)
|
||||||
|
{
|
||||||
|
for(char & c : str)
|
||||||
|
c = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Overwrite(std::wstring & str)
|
||||||
|
{
|
||||||
|
for(wchar_t & c : str)
|
||||||
|
c = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const char * SkipWhite(const char * s)
|
const char * SkipWhite(const char * s)
|
||||||
@@ -761,11 +665,12 @@ bool ValidateEmail(const std::wstring & email)
|
|||||||
bool IsFile(const wchar_t * file)
|
bool IsFile(const wchar_t * file)
|
||||||
{
|
{
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
static std::string afile;
|
char file_name[WINIX_OS_PATH_SIZE];
|
||||||
|
|
||||||
PT::WideToUTF8(file, afile);
|
if( !WideToUTF8(file, file_name, WINIX_OS_PATH_SIZE) )
|
||||||
|
return false;
|
||||||
|
|
||||||
return (stat(afile.c_str(), &sb) == 0);
|
return (stat(file_name, &sb) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -775,37 +680,43 @@ bool IsFile(const std::wstring & file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CreateDir(const wchar_t * dir, int priv)
|
/*
|
||||||
|
* group can be -1 (it is not used then)
|
||||||
|
*/
|
||||||
|
bool CreateDir(const wchar_t * dir, int priv, int group)
|
||||||
{
|
{
|
||||||
static std::string adir;
|
char dir_name[WINIX_OS_PATH_SIZE];
|
||||||
|
|
||||||
if( !IsFile(dir) )
|
if( !IsFile(dir) )
|
||||||
{
|
{
|
||||||
PT::WideToUTF8(dir, adir);
|
if( !WideToUTF8(dir, dir_name, WINIX_OS_PATH_SIZE) )
|
||||||
|
return false;
|
||||||
|
|
||||||
if( mkdir(adir.c_str(), priv) < 0 )
|
if( mkdir(dir_name, 0777) < 0 )
|
||||||
{
|
{
|
||||||
log << log1 << "Can't create a directory on fs: " << adir << logend;
|
log << log1 << "Can't create a directory on fs: " << dir << logend;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return SetPriv(dir, priv, group);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CreateDir(const std::wstring & dir, int priv)
|
bool CreateDir(const std::wstring & dir, int priv, int group)
|
||||||
{
|
{
|
||||||
return CreateDir(dir.c_str(), priv);
|
return CreateDir(dir.c_str(), priv, group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// creating directories (can be more than one)
|
// creating directories (can be more than one)
|
||||||
// 'dirs' can begin with a slash (will be skipped)
|
// 'dirs' can begin with a slash (will be skipped)
|
||||||
bool CreateDirs(const wchar_t * base_dir, const wchar_t * dirs, int priv, bool skip_last)
|
bool CreateDirs(const wchar_t * base_dir, const wchar_t * dirs, int priv, int group, bool skip_last)
|
||||||
{
|
{
|
||||||
static std::wstring temp;
|
static std::wstring temp; // !! IMPROVE ME change to char[WINIX_OS_PATH_SIZE] or just remove 'static'
|
||||||
const wchar_t * p = dirs;
|
const wchar_t * p = dirs;
|
||||||
|
|
||||||
temp = base_dir; // we start creating from 'base_dir'
|
temp = base_dir; // we start creating from 'base_dir'
|
||||||
@@ -829,7 +740,7 @@ const wchar_t * p = dirs;
|
|||||||
temp += *p;
|
temp += *p;
|
||||||
|
|
||||||
if( !skip_last || *p!=0 )
|
if( !skip_last || *p!=0 )
|
||||||
if( !CreateDir(temp.c_str(), priv) )
|
if( !CreateDir(temp.c_str(), priv, group) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
temp += '/';
|
temp += '/';
|
||||||
@@ -840,9 +751,82 @@ return true;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool CreateDirs(const std::wstring & base_dir, const std::wstring & dirs, int priv, bool skip_last)
|
bool CreateDirs(const std::wstring & base_dir, const std::wstring & dirs, int priv, int group, bool skip_last)
|
||||||
{
|
{
|
||||||
return CreateDirs(base_dir.c_str(), dirs.c_str(), priv, skip_last);
|
return CreateDirs(base_dir.c_str(), dirs.c_str(), priv, group, skip_last);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int GetGroupId(const wchar_t * name)
|
||||||
|
{
|
||||||
|
struct group gr;
|
||||||
|
struct group * result;
|
||||||
|
char group_name[WINIX_OS_USERNAME_SIZE];
|
||||||
|
char buffer[512];
|
||||||
|
|
||||||
|
if( !WideToUTF8(name, group_name, WINIX_OS_USERNAME_SIZE) )
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if( getgrnam_r(group_name, &gr, buffer, sizeof(buffer)/sizeof(char), &result) != 0 )
|
||||||
|
{
|
||||||
|
log << log1 << "Misc: I cannot get the group_id for group name: " << name << logend;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* there is no such a group in /etc/group
|
||||||
|
*/
|
||||||
|
if( result == 0 )
|
||||||
|
{
|
||||||
|
log << log1 << "Misc: There is no a group with name: " << name << logend;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return gr.gr_gid;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int GetGroupId(const std::wstring & name)
|
||||||
|
{
|
||||||
|
return GetGroupId(name.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* setting priveleges and a group id on a file or on a directory
|
||||||
|
* group can be -1 (it is not used then)
|
||||||
|
*/
|
||||||
|
bool SetPriv(const wchar_t * name, int priv, int group)
|
||||||
|
{
|
||||||
|
char file_name[WINIX_OS_PATH_SIZE];
|
||||||
|
|
||||||
|
if( !WideToUTF8(name, file_name, WINIX_OS_PATH_SIZE) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( chmod(file_name, priv) < 0 )
|
||||||
|
{
|
||||||
|
log << log1 << "Misc: Can't set proper fs privileges on: " << name << logend;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( group != -1 )
|
||||||
|
{
|
||||||
|
if( chown(file_name, geteuid(), group) < 0 )
|
||||||
|
{
|
||||||
|
log << log1 << "Can't set proper fs group on: " << name
|
||||||
|
<< ", group id was: " << group << logend;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SetPriv(const std::wstring & name, int priv, int group)
|
||||||
|
{
|
||||||
|
return SetPriv(name.c_str(), priv, group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -871,18 +855,22 @@ return true;
|
|||||||
|
|
||||||
bool CopyFile(const wchar_t * src, const wchar_t * dst)
|
bool CopyFile(const wchar_t * src, const wchar_t * dst)
|
||||||
{
|
{
|
||||||
static std::string asrc, adst;
|
char src_name[WINIX_OS_PATH_SIZE];
|
||||||
|
char dst_name[WINIX_OS_PATH_SIZE];
|
||||||
FILE * in, * out;
|
FILE * in, * out;
|
||||||
|
|
||||||
PT::WideToUTF8(src, asrc);
|
if( !WideToUTF8(src, src_name, WINIX_OS_PATH_SIZE) )
|
||||||
PT::WideToUTF8(dst, adst);
|
return false;
|
||||||
|
|
||||||
in = fopen(asrc.c_str(), "rb");
|
if( !WideToUTF8(dst, dst_name, WINIX_OS_PATH_SIZE) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
in = fopen(src_name, "rb");
|
||||||
|
|
||||||
if( !in )
|
if( !in )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
out = fopen(adst.c_str(), "wb");
|
out = fopen(dst_name, "wb");
|
||||||
|
|
||||||
if( !out )
|
if( !out )
|
||||||
{
|
{
|
||||||
@@ -899,7 +887,7 @@ FILE * in, * out;
|
|||||||
res = false;
|
res = false;
|
||||||
|
|
||||||
if( !res )
|
if( !res )
|
||||||
remove(adst.c_str());
|
remove(dst_name);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -914,11 +902,12 @@ bool CopyFile(const std::wstring & src, const std::wstring & dst)
|
|||||||
|
|
||||||
bool RemoveFile(const wchar_t * file)
|
bool RemoveFile(const wchar_t * file)
|
||||||
{
|
{
|
||||||
static std::string afile;
|
char file_name[WINIX_OS_PATH_SIZE];
|
||||||
|
|
||||||
PT::WideToUTF8(file, afile);
|
if( !WideToUTF8(file, file_name, WINIX_OS_PATH_SIZE) )
|
||||||
|
return false;
|
||||||
|
|
||||||
return unlink(afile.c_str()) == 0;
|
return unlink(file_name) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -931,12 +920,16 @@ bool RemoveFile(const std::wstring & file)
|
|||||||
|
|
||||||
bool RenameFile(const wchar_t * from, const wchar_t * to)
|
bool RenameFile(const wchar_t * from, const wchar_t * to)
|
||||||
{
|
{
|
||||||
static std::string afrom, ato;
|
char from_name[WINIX_OS_PATH_SIZE];
|
||||||
|
char to_name[WINIX_OS_PATH_SIZE];
|
||||||
|
|
||||||
PT::WideToUTF8(from, afrom);
|
if( !WideToUTF8(from, from_name, WINIX_OS_PATH_SIZE) )
|
||||||
PT::WideToUTF8(to, ato);
|
return false;
|
||||||
|
|
||||||
return rename(afrom.c_str(), ato.c_str()) == 0;
|
if( !WideToUTF8(to, to_name, WINIX_OS_PATH_SIZE) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return rename(from_name, to_name) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -949,19 +942,25 @@ bool RenameFile(const std::wstring & from, const std::wstring & to)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool GetUTF8File(const char * file_path, std::wstring & content, bool clear_content)
|
bool GetUTF8File(const wchar_t * file_path, std::wstring & content, bool clear_content)
|
||||||
{
|
{
|
||||||
using namespace misc_private;
|
char file[WINIX_OS_PATH_SIZE];
|
||||||
|
std::ifstream get_file_content;
|
||||||
|
|
||||||
if( clear_content )
|
if( clear_content )
|
||||||
content.clear();
|
content.clear();
|
||||||
|
|
||||||
get_file_content.clear();
|
if( !WideToUTF8(file_path, file, WINIX_OS_PATH_SIZE) )
|
||||||
get_file_content.open(file_path, std::ios_base::in | std::ios_base::binary);
|
return false;
|
||||||
|
|
||||||
|
get_file_content.open(file, std::ios_base::in | std::ios_base::binary);
|
||||||
|
|
||||||
if( !get_file_content )
|
if( !get_file_content )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* we don't report any errors when converting from UTF8 to wide characters here
|
||||||
|
*/
|
||||||
PT::UTF8ToWide(get_file_content, content);
|
PT::UTF8ToWide(get_file_content, content);
|
||||||
get_file_content.close();
|
get_file_content.close();
|
||||||
|
|
||||||
@@ -969,21 +968,6 @@ return true;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GetUTF8File(const wchar_t * file_path, std::wstring & content, bool clear_content)
|
|
||||||
{
|
|
||||||
using namespace misc_private;
|
|
||||||
|
|
||||||
PT::WideToUTF8(file_path, get_file_content_ansi);
|
|
||||||
return GetUTF8File(get_file_content_ansi.c_str(), content, clear_content);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool GetUTF8File(const std::string & file_path, std::wstring & content, bool clear_content)
|
|
||||||
{
|
|
||||||
return GetUTF8File(file_path.c_str(), content, clear_content);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool GetUTF8File(const std::wstring & file_path, std::wstring & content, bool clear_content)
|
bool GetUTF8File(const std::wstring & file_path, std::wstring & content, bool clear_content)
|
||||||
{
|
{
|
||||||
return GetUTF8File(file_path.c_str(), content, clear_content);
|
return GetUTF8File(file_path.c_str(), content, clear_content);
|
||||||
@@ -1123,6 +1107,69 @@ void UrlEncode(const std::wstring & in, std::wstring & out, bool clear_out)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool UrlDecodeFromHex(int c, int & out)
|
||||||
|
{
|
||||||
|
if( c>='0' && c<='9' )
|
||||||
|
{
|
||||||
|
out = c - '0';
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if( c>='a' && c<='f' )
|
||||||
|
{
|
||||||
|
out = c - 'a' + 10;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if( c>='A' && c<='F' )
|
||||||
|
{
|
||||||
|
out = c - 'A' + 10;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
out = 0;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool UrlDecode(const char * url, std::wstring & out, bool clear_out)
|
||||||
|
{
|
||||||
|
char url_utf8[WINIX_URL_MAX_SIZE];
|
||||||
|
size_t index = 0;
|
||||||
|
int c1, c2;
|
||||||
|
|
||||||
|
if( clear_out )
|
||||||
|
out.clear();
|
||||||
|
|
||||||
|
while( *url && index < WINIX_URL_MAX_SIZE-1 )
|
||||||
|
{
|
||||||
|
if( *url == '%' && *(url+1) && *(url+2) &&
|
||||||
|
UrlDecodeFromHex(*(url+1), c1) && UrlDecodeFromHex(*(url+2), c2) )
|
||||||
|
{
|
||||||
|
url_utf8[index++] = (c1 << 4) + c2;
|
||||||
|
url += 3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
url_utf8[index++] = *url;
|
||||||
|
url += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
url_utf8[index] = 0;
|
||||||
|
|
||||||
|
return PT::UTF8ToWide(url_utf8, out, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool UrlDecode(const std::string & url, std::wstring & out, bool clear_out)
|
||||||
|
{
|
||||||
|
return UrlDecode(url.c_str(), out, clear_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void QEncode(const std::wstring & in, std::string & out, bool clear)
|
void QEncode(const std::wstring & in, std::string & out, bool clear)
|
||||||
{
|
{
|
||||||
@@ -1155,4 +1202,28 @@ void RemovePostFileTmp(PostFileTab & post_file_tab)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool WideToUTF8(const wchar_t * wide_string, char * utf8, size_t utf8_size)
|
||||||
|
{
|
||||||
|
bool res = PT::WideToUTF8(wide_string, utf8, utf8_size);
|
||||||
|
|
||||||
|
if( !res )
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* either the 'utf8' buffer is too small or there was an error when converting
|
||||||
|
*/
|
||||||
|
log << log1 << "Misc: I cannot convert from a wide string to an UTF-8 string, original string was: "
|
||||||
|
<< wide_string << logend;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool WideToUTF8(const std::wstring & wide_string, char * utf8, size_t utf8_size)
|
||||||
|
{
|
||||||
|
return WideToUTF8(wide_string.c_str(), utf8, utf8_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+105
-38
@@ -1,16 +1,40 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_misc
|
#ifndef headerfile_winix_core_misc
|
||||||
#define headerfile_winix_core_misc
|
#define headerfile_winix_core_misc
|
||||||
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
@@ -20,6 +44,13 @@
|
|||||||
#include "date/date.h"
|
#include "date/date.h"
|
||||||
#include "textstream/textstream.h"
|
#include "textstream/textstream.h"
|
||||||
#include "utf8/utf8.h"
|
#include "utf8/utf8.h"
|
||||||
|
#include "winix_const.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -184,34 +215,6 @@ void Toa(long value, std::wstring & res, int base = 10, bool clear = true);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
conversions between ascii text and wide characters
|
|
||||||
(destination is always std::string or std::wstring)
|
|
||||||
|
|
||||||
characters are copied as they are without any locales checking
|
|
||||||
*/
|
|
||||||
|
|
||||||
void AssignString(const char * src, size_t len, std::wstring & dst, bool clear = true);
|
|
||||||
void AssignString(const char * src, std::wstring & dst, bool clear = true);
|
|
||||||
void AssignString(const std::string & src, std::wstring & dst, bool clear = true);
|
|
||||||
|
|
||||||
void AssignString(const wchar_t * src, size_t len, std::string & dst, bool clear = true);
|
|
||||||
void AssignString(const wchar_t * src, std::string & dst, bool clear = true);
|
|
||||||
void AssignString(const std::wstring & src, std::string & dst, bool clear = true);
|
|
||||||
|
|
||||||
void AssignString(const char * src, size_t len, std::string & dst, bool clear = true);
|
|
||||||
void AssignString(const char * src, std::string & dst, bool clear = true);
|
|
||||||
void AssignString(const std::string & src, std::string & dst, bool clear = true);
|
|
||||||
|
|
||||||
void AssignString(const wchar_t * src, size_t len, std::wstring & dst, bool clear = true);
|
|
||||||
void AssignString(const wchar_t * src, std::wstring & dst, bool clear = true);
|
|
||||||
void AssignString(const std::wstring & src, std::wstring & dst, bool clear = true);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool CorrectUrlChar(wchar_t c);
|
bool CorrectUrlChar(wchar_t c);
|
||||||
void CorrectUrlDots(std::wstring & url);
|
void CorrectUrlDots(std::wstring & url);
|
||||||
void CorrectUrlChars(std::wstring & url);
|
void CorrectUrlChars(std::wstring & url);
|
||||||
@@ -330,6 +333,10 @@ void Trim(StringType & s, wchar_t c)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Overwrite(std::string & str);
|
||||||
|
void Overwrite(std::wstring & str);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<class StringType>
|
template<class StringType>
|
||||||
void MaxSize(StringType & str, size_t max_size)
|
void MaxSize(StringType & str, size_t max_size)
|
||||||
@@ -720,13 +727,19 @@ bool ValidateEmail(const std::wstring & email);
|
|||||||
|
|
||||||
bool IsFile(const wchar_t * file);
|
bool IsFile(const wchar_t * file);
|
||||||
bool IsFile(const std::wstring & file);
|
bool IsFile(const std::wstring & file);
|
||||||
bool CreateDir(const wchar_t * dir, int priv);
|
bool CreateDir(const wchar_t * dir, int priv, int group = -1);
|
||||||
bool CreateDir(const std::wstring & dir, int priv);
|
bool CreateDir(const std::wstring & dir, int priv, int group = -1);
|
||||||
|
|
||||||
// creating directories (dirs) under base_dir (base_dir must exist)
|
// creating directories (dirs) under base_dir (base_dir must exist)
|
||||||
// if skip_last == true then last part from dir is treated as a file (the last directory is not created)
|
// if skip_last == true then last part from dir is treated as a file (the last directory is not created)
|
||||||
bool CreateDirs(const wchar_t * base_dir, const wchar_t * dirs, int priv = 0755, bool skip_last = false);
|
bool CreateDirs(const wchar_t * base_dir, const wchar_t * dirs, int priv = 0755, int group = -1, bool skip_last = false);
|
||||||
bool CreateDirs(const std::wstring & base_dir, const std::wstring & dirs, int priv = 0755, bool skip_last = false);
|
bool CreateDirs(const std::wstring & base_dir, const std::wstring & dirs, int priv = 0755, int group = -1, bool skip_last = false);
|
||||||
|
|
||||||
|
int GetGroupId(const wchar_t * name);
|
||||||
|
int GetGroupId(const std::wstring & name);
|
||||||
|
|
||||||
|
bool SetPriv(const wchar_t * name, int priv, int group = -1);
|
||||||
|
bool SetPriv(const std::wstring & name, int priv, int group = -1);
|
||||||
|
|
||||||
bool CopyFile(FILE * in, FILE * out);
|
bool CopyFile(FILE * in, FILE * out);
|
||||||
bool CopyFile(const wchar_t * src, const wchar_t * dst);
|
bool CopyFile(const wchar_t * src, const wchar_t * dst);
|
||||||
@@ -738,9 +751,7 @@ bool RemoveFile(const std::wstring & file);
|
|||||||
bool RenameFile(const wchar_t * from, const wchar_t * to);
|
bool RenameFile(const wchar_t * from, const wchar_t * to);
|
||||||
bool RenameFile(const std::wstring & from, const std::wstring & to);
|
bool RenameFile(const std::wstring & from, const std::wstring & to);
|
||||||
|
|
||||||
bool GetUTF8File(const char * file_path, std::wstring & content, bool clear_content = true);
|
|
||||||
bool GetUTF8File(const wchar_t * file_path, std::wstring & content, bool clear_content = true);
|
bool GetUTF8File(const wchar_t * file_path, std::wstring & content, bool clear_content = true);
|
||||||
bool GetUTF8File(const std::string & file_path, std::wstring & content, bool clear_content = true);
|
|
||||||
bool GetUTF8File(const std::wstring & file_path, std::wstring & content, bool clear_content = true);
|
bool GetUTF8File(const std::wstring & file_path, std::wstring & content, bool clear_content = true);
|
||||||
|
|
||||||
|
|
||||||
@@ -863,6 +874,19 @@ void UrlEncode(const std::wstring & in, std::wstring & out, bool clear_out = tru
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* decoding a URL
|
||||||
|
*
|
||||||
|
* return false is the url is too long (longer than WINIX_URL_MAX_SIZE)
|
||||||
|
* or it cannot be correctly converted from UTF8 to wide characters
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool UrlDecode(const char * url, std::wstring & out, bool clear_out = true);
|
||||||
|
bool UrlDecode(const std::string & url, std::wstring & out, bool clear_out = true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
||||||
void QEncodeAddChar(char_type c, PT::TextStreamBase<char_type, stack_size, heap_block_size> & out)
|
void QEncodeAddChar(char_type c, PT::TextStreamBase<char_type, stack_size, heap_block_size> & out)
|
||||||
@@ -1014,4 +1038,47 @@ void SetMinMax(IntType & val, IntType min_val, IntType max_val)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<class Stream, class StringType>
|
||||||
|
void JSONescape(Stream & out, const StringType & str)
|
||||||
|
{
|
||||||
|
// !! IMPROVE ME (optimizing)
|
||||||
|
// it is better to not write one by one character
|
||||||
|
// but use write method insted
|
||||||
|
|
||||||
|
for(size_t i=0 ; i<str.size() ; ++i)
|
||||||
|
{
|
||||||
|
switch(str[i])
|
||||||
|
{
|
||||||
|
case 0: out << '\\'; out << '0'; break;
|
||||||
|
case '\r': out << '\\'; out << 'r'; break;
|
||||||
|
case '\n': out << '\\'; out << 'n'; break;
|
||||||
|
case '\t': out << '\\'; out << 't'; break;
|
||||||
|
case 0x08: out << '\\'; out << 'b'; break;
|
||||||
|
case 0x0c: out << '\\'; out << 'f'; break;
|
||||||
|
case '\\': out << '\\'; out << '\\'; break;
|
||||||
|
//case '/': out << '\\'; out << '/'; break; // slash doesn't have to be escaped
|
||||||
|
case '"': out << '\\'; out << '\"'; break;
|
||||||
|
default:
|
||||||
|
out << str[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* converting from a wide string to an UTF-8 string
|
||||||
|
* and puts a log if the conversion fails
|
||||||
|
*
|
||||||
|
* it uses PT::WideToUTF8()
|
||||||
|
*/
|
||||||
|
bool WideToUTF8(const wchar_t * wide_string, char * utf8, size_t utf8_size);
|
||||||
|
bool WideToUTF8(const std::wstring & wide_string, char * utf8, size_t utf8_size);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+37
-3
@@ -1,16 +1,46 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2009-2010, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2009-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mount.h"
|
#include "mount.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Mount::Mount()
|
Mount::Mount()
|
||||||
{
|
{
|
||||||
@@ -109,3 +139,7 @@ const std::wstring & Mount::FirstArg(int code) const
|
|||||||
return Arg(code, 0);
|
return Arg(code, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+35
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2009-2010, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2009-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -16,6 +41,10 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Mount
|
class Mount
|
||||||
{
|
{
|
||||||
@@ -67,5 +96,8 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+34
-8
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2010-2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mountparser.h"
|
#include "mountparser.h"
|
||||||
@@ -12,6 +37,11 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MountParser::MountParser()
|
MountParser::MountParser()
|
||||||
{
|
{
|
||||||
dirs = 0;
|
dirs = 0;
|
||||||
@@ -494,9 +524,5 @@ void MountParser::Parse(const std::wstring & input, std::map<long, Mount> & outp
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+37
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2010-2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_mountparser
|
#ifndef headerfile_winix_core_mountparser
|
||||||
@@ -22,6 +47,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MountParser
|
class MountParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -82,4 +112,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+37
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2009-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2009-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mounts.h"
|
#include "mounts.h"
|
||||||
@@ -15,6 +40,10 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Mounts::Mounts()
|
Mounts::Mounts()
|
||||||
{
|
{
|
||||||
@@ -321,3 +350,8 @@ Mount * Mounts::GetEmptyMount()
|
|||||||
{
|
{
|
||||||
return &empty_mount;
|
return &empty_mount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+36
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2009-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2009-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -23,6 +48,11 @@
|
|||||||
#include "mountparser.h"
|
#include "mountparser.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Mounts
|
class Mounts
|
||||||
{
|
{
|
||||||
@@ -165,5 +195,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+45
-19
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
@@ -14,6 +39,9 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Plugin::UnloadPlugins()
|
void Plugin::UnloadPlugins()
|
||||||
@@ -158,17 +186,18 @@ void Plugin::LoadPlugins(const std::wstring & plugins_dir, const std::vector<std
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Plugin::LoadPlugin(const std::string & filename)
|
|
||||||
{
|
|
||||||
LoadPlugin(filename.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// we don't have to use Lock() here because plusings are read
|
// we don't have to use Lock() here because plugins are read
|
||||||
// before threads are started
|
// before threads are started
|
||||||
void * Plugin::LoadInitFun(const char * filename, Fun1 & fun_init)
|
void * Plugin::LoadInitFun(const wchar_t * filename, Fun1 & fun_init)
|
||||||
{
|
{
|
||||||
void * p = dlopen(filename, RTLD_NOW | RTLD_LOCAL);
|
char file[WINIX_OS_PATH_SIZE];
|
||||||
|
|
||||||
|
if( !WideToUTF8(filename, file, WINIX_OS_PATH_SIZE) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
void * p = dlopen(file, RTLD_NOW | RTLD_LOCAL);
|
||||||
|
|
||||||
if( !p )
|
if( !p )
|
||||||
{
|
{
|
||||||
@@ -177,7 +206,7 @@ void * Plugin::LoadInitFun(const char * filename, Fun1 & fun_init)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fun_init = (Fun1)dlfunc(p, "Init");
|
fun_init = (Fun1)dlsym(p, "Init");
|
||||||
|
|
||||||
if( !fun_init )
|
if( !fun_init )
|
||||||
{
|
{
|
||||||
@@ -197,7 +226,7 @@ return p;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Plugin::LoadPlugin(const char * filename)
|
void Plugin::LoadPlugin(const wchar_t * filename)
|
||||||
{
|
{
|
||||||
Fun1 fun_init;
|
Fun1 fun_init;
|
||||||
void * plugin_handle;
|
void * plugin_handle;
|
||||||
@@ -227,19 +256,13 @@ PluginInfo info;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Plugin::LoadPlugin(const wchar_t * filename)
|
|
||||||
{
|
|
||||||
AssignString(filename, afilename);
|
|
||||||
LoadPlugin(afilename.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Plugin::LoadPlugin(const std::wstring & filename)
|
void Plugin::LoadPlugin(const std::wstring & filename)
|
||||||
{
|
{
|
||||||
LoadPlugin(filename.c_str());
|
LoadPlugin(filename.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Plugin::HasPlugin(const wchar_t * name)
|
bool Plugin::HasPlugin(const wchar_t * name)
|
||||||
{
|
{
|
||||||
if( *name == 0 )
|
if( *name == 0 )
|
||||||
@@ -500,3 +523,6 @@ const Plugin::Plugins * Plugin::GetPlugins()
|
|||||||
return &plugins;
|
return &plugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+41
-10
@@ -1,12 +1,36 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_plugin
|
#ifndef headerfile_winix_core_plugin
|
||||||
#define headerfile_winix_core_plugin
|
#define headerfile_winix_core_plugin
|
||||||
@@ -26,6 +50,12 @@
|
|||||||
#include "templates/templates.h"
|
#include "templates/templates.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
all your plugin functions can have signature either:
|
all your plugin functions can have signature either:
|
||||||
void my_function(PluginInfo & info); or
|
void my_function(PluginInfo & info); or
|
||||||
@@ -36,7 +66,7 @@
|
|||||||
|
|
||||||
in the Init you can add your own functions by using plugin.Assign() method
|
in the Init you can add your own functions by using plugin.Assign() method
|
||||||
and you can set the name of the plugin by setting info.p1 pointer
|
and you can set the name of the plugin by setting info.p1 pointer
|
||||||
to a string buffer (const char *)
|
to a string buffer (const wchar_t *)
|
||||||
(this buffer will not be copied so it should not be destroyed after Init finishes)
|
(this buffer will not be copied so it should not be destroyed after Init finishes)
|
||||||
also in Init you can only use logger (log) info.config and info.db objects
|
also in Init you can only use logger (log) info.config and info.db objects
|
||||||
(the rest winix objects are not initialized yet)
|
(the rest winix objects are not initialized yet)
|
||||||
@@ -171,8 +201,6 @@ public:
|
|||||||
void SetSynchro(Synchro * psynchro);
|
void SetSynchro(Synchro * psynchro);
|
||||||
void SetSessionManager(SessionManager * psession_manager);
|
void SetSessionManager(SessionManager * psession_manager);
|
||||||
|
|
||||||
void LoadPlugin(const char * filename);
|
|
||||||
void LoadPlugin(const std::string & filename);
|
|
||||||
void LoadPlugin(const wchar_t * filename);
|
void LoadPlugin(const wchar_t * filename);
|
||||||
void LoadPlugin(const std::wstring & filename);
|
void LoadPlugin(const std::wstring & filename);
|
||||||
|
|
||||||
@@ -226,14 +254,13 @@ private:
|
|||||||
SessionManager * session_manager;
|
SessionManager * session_manager;
|
||||||
|
|
||||||
std::wstring temp_path; // used when loading plugins
|
std::wstring temp_path; // used when loading plugins
|
||||||
std::string afilename;
|
|
||||||
|
|
||||||
Plugins plugins;
|
Plugins plugins;
|
||||||
|
|
||||||
typedef std::multimap<int, Slot> Slots;
|
typedef std::multimap<int, Slot> Slots;
|
||||||
Slots slots;
|
Slots slots;
|
||||||
|
|
||||||
void * LoadInitFun(const char * filename, Fun1 & fun_init);
|
void * LoadInitFun(const wchar_t * filename, Fun1 & fun_init);
|
||||||
void Call(Session * ses, int message, Slots::iterator & slot, PluginInfo & info);
|
void Call(Session * ses, int message, Slots::iterator & slot, PluginInfo & info);
|
||||||
|
|
||||||
bool SetPointers(PluginInfo & info);
|
bool SetPointers(PluginInfo & info);
|
||||||
@@ -246,5 +273,9 @@ private:
|
|||||||
|
|
||||||
extern Plugin plugin;
|
extern Plugin plugin;
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+37
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "plugindata.h"
|
#include "plugindata.h"
|
||||||
@@ -13,6 +38,10 @@
|
|||||||
#include "session.h"
|
#include "session.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PluginData::PluginData()
|
PluginData::PluginData()
|
||||||
@@ -153,3 +182,8 @@ size_t old_size = table.size();
|
|||||||
for(size_t i = old_size ; i<new_size ; ++i)
|
for(size_t i = old_size ; i<new_size ; ++i)
|
||||||
table[i] = 0;
|
table[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+36
-3
@@ -1,16 +1,46 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_plugindata
|
#ifndef headerfile_winix_core_plugindata
|
||||||
#define headerfile_winix_core_plugindata
|
#define headerfile_winix_core_plugindata
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct Session;
|
struct Session;
|
||||||
@@ -65,5 +95,8 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+49
-5
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -12,6 +37,12 @@
|
|||||||
#define headerfile_winix_core_pluginmsg
|
#define headerfile_winix_core_pluginmsg
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// here you can add your own EZC functions ([function])
|
// here you can add your own EZC functions ([function])
|
||||||
// PluginInfo.p1 is a pointer to Ezc::Functions object
|
// PluginInfo.p1 is a pointer to Ezc::Functions object
|
||||||
// session pointer is null
|
// session pointer is null
|
||||||
@@ -237,8 +268,8 @@
|
|||||||
#define WINIX_BASE_URL_REDIRECT 31030
|
#define WINIX_BASE_URL_REDIRECT 31030
|
||||||
|
|
||||||
// raw POST parameters
|
// raw POST parameters
|
||||||
// in p1 there is a pointer to std::string meaning a parameter's name
|
// in p1 there is a pointer to std::wstring meaning a parameter's name
|
||||||
// in p2 there is a pointer to std::string value
|
// in p2 there is a pointer to std::wstring value
|
||||||
// this is sent only from PostParser
|
// this is sent only from PostParser
|
||||||
// PostMultiParser (multipart/form-data html forms) doesn't send this messsage
|
// PostMultiParser (multipart/form-data html forms) doesn't send this messsage
|
||||||
// there is no a session set (session pointer is null)
|
// there is no a session set (session pointer is null)
|
||||||
@@ -255,6 +286,15 @@
|
|||||||
// to the resource
|
// to the resource
|
||||||
#define WINIX_CHECK_PLUGIN_ACCESS 31060
|
#define WINIX_CHECK_PLUGIN_ACCESS 31060
|
||||||
|
|
||||||
|
// http headers (without cookies) were created and are ready to send
|
||||||
|
// here you can make some changes to them
|
||||||
|
// in p1 you have a pointer to the PT::Space (Request::out_headers)
|
||||||
|
#define WINIX_PREPARE_TO_SEND_HTTP_HEADERS 31070
|
||||||
|
|
||||||
|
// http cookies were created and are ready to send
|
||||||
|
// here you can make some changes to them
|
||||||
|
// in p1 you have a pointer to the PT::Space (Request::out_cookies)
|
||||||
|
#define WINIX_PREPARE_TO_SEND_HTTP_COOKIES 31080
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -283,5 +323,9 @@
|
|||||||
// see plugins/ticket/pluginmsg.h
|
// see plugins/ticket/pluginmsg.h
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -15,6 +40,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PostMultiParser::PostMultiParser()
|
PostMultiParser::PostMultiParser()
|
||||||
{
|
{
|
||||||
in_buffer = new unsigned char[WINIX_POSTMULTI_INPUT_BUFFER];
|
in_buffer = new unsigned char[WINIX_POSTMULTI_INPUT_BUFFER];
|
||||||
@@ -357,10 +388,7 @@ void PostMultiParser::ReadContent()
|
|||||||
|
|
||||||
void PostMultiParser::ConvStr(const std::string & src, std::wstring & dst)
|
void PostMultiParser::ConvStr(const std::string & src, std::wstring & dst)
|
||||||
{
|
{
|
||||||
if( config->utf8 )
|
|
||||||
PT::UTF8ToWide(src, dst);
|
PT::UTF8ToWide(src, dst);
|
||||||
else
|
|
||||||
AssignString(src, dst);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -453,7 +481,7 @@ void PostMultiParser::CheckBoundaryEnd()
|
|||||||
|
|
||||||
void PostMultiParser::CreateTmpFile()
|
void PostMultiParser::CreateTmpFile()
|
||||||
{
|
{
|
||||||
wchar_t buf[1024];
|
wchar_t buf[WINIX_OS_PATH_SIZE];
|
||||||
size_t buf_len = sizeof(buf)/sizeof(wchar_t);
|
size_t buf_len = sizeof(buf)/sizeof(wchar_t);
|
||||||
|
|
||||||
if( config->upload_dir.empty() )
|
if( config->upload_dir.empty() )
|
||||||
@@ -470,7 +498,7 @@ size_t buf_len = sizeof(buf)/sizeof(wchar_t);
|
|||||||
PT::WideToUTF8(tmp_filename, atmp_filename);
|
PT::WideToUTF8(tmp_filename, atmp_filename);
|
||||||
|
|
||||||
tmp_file.open(atmp_filename.c_str(), std::ios_base::binary | std::ios_base::out);
|
tmp_file.open(atmp_filename.c_str(), std::ios_base::binary | std::ios_base::out);
|
||||||
// !! dodac ustawienie chmod config.upload_files_chmod dla tymczasowego pliku
|
// !! IMPROVE ME dodac ustawienie chmod config.upload_files_chmod dla tymczasowego pliku
|
||||||
|
|
||||||
if( !tmp_file )
|
if( !tmp_file )
|
||||||
{
|
{
|
||||||
@@ -586,3 +614,8 @@ Error PostMultiParser::Parse(FCGX_Stream * in_, PostTab & post_tab_, PostFileTab
|
|||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+36
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_postmultiparser
|
#ifndef headerfile_winix_core_postmultiparser
|
||||||
@@ -19,6 +44,11 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 2 MB
|
// 2 MB
|
||||||
#define WINIX_POSTMULTI_INPUT_BUFFER 2097152
|
#define WINIX_POSTMULTI_INPUT_BUFFER 2097152
|
||||||
#define WINIX_POSTMULTI_OUTPUT_BUFFER 2097152
|
#define WINIX_POSTMULTI_OUTPUT_BUFFER 2097152
|
||||||
@@ -128,5 +158,8 @@ return added;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+49
-37
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_postparser
|
#ifndef headerfile_winix_core_postparser
|
||||||
@@ -17,25 +42,24 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "utf8/utf8.h"
|
#include "utf8/utf8.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "config.h"
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PostParser : public HttpSimpleParser
|
class PostParser : public HttpSimpleParser
|
||||||
{
|
{
|
||||||
|
|
||||||
FCGX_Stream * in;
|
FCGX_Stream * in;
|
||||||
PostTab * post_tab;
|
PostTab * post_tab;
|
||||||
std::wstring temp_name, temp_value;
|
|
||||||
bool input_as_utf8;
|
|
||||||
size_t log_value_size;
|
size_t log_value_size;
|
||||||
int var_index;
|
int var_index;
|
||||||
bool has_winix_post_params_msg;
|
bool has_winix_post_params_msg;
|
||||||
bool has_winix_raw_post_msg;
|
bool has_winix_raw_post_msg;
|
||||||
std::string raw_post;
|
std::string raw_post;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
||||||
@@ -50,20 +74,20 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CreateLog(bool param_added)
|
void CreateLog(bool param_added, const std::wstring & name, const std::wstring & value)
|
||||||
{
|
{
|
||||||
log << log2 << "Method POST, name: \"" << temp_name << "\"";
|
log << log2 << "Method POST, name: \"" << name << "\"";
|
||||||
|
|
||||||
if( log_value_size > 0 && !IsSubStringNoCase(L"pass", temp_name.c_str()) )
|
if( log_value_size > 0 && !IsSubStringNoCase(L"pass", name.c_str()) )
|
||||||
{
|
{
|
||||||
log << ", value: ";
|
log << ", value: ";
|
||||||
|
|
||||||
if( temp_value.size() > log_value_size )
|
if( value.size() > log_value_size )
|
||||||
log << "(first " << log_value_size << " characters) ";
|
log << "(first " << log_value_size << " characters) ";
|
||||||
|
|
||||||
log << "\"";
|
log << "\"";
|
||||||
log.LogString(temp_value, log_value_size);
|
log.LogString(value, log_value_size);
|
||||||
log << "\" (size: " << temp_value.size() << ")";
|
log << "\" (size: " << value.size() << ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
if( param_added == false )
|
if( param_added == false )
|
||||||
@@ -73,16 +97,8 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ConvStr(const std::string & src, std::wstring & dst)
|
|
||||||
{
|
|
||||||
if( input_as_utf8 )
|
|
||||||
PT::UTF8ToWide(src, dst);
|
|
||||||
else
|
|
||||||
AssignString(src, dst);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
virtual void Parameter(std::wstring & name, std::wstring & value)
|
||||||
virtual void Parameter(std::string & name, std::string & value)
|
|
||||||
{
|
{
|
||||||
bool added;
|
bool added;
|
||||||
std::pair<PostTab::iterator, bool> res;
|
std::pair<PostTab::iterator, bool> res;
|
||||||
@@ -90,22 +106,19 @@ protected:
|
|||||||
if( has_winix_post_params_msg )
|
if( has_winix_post_params_msg )
|
||||||
plugin.Call(0, WINIX_POST_PARAMS, &name, &value);
|
plugin.Call(0, WINIX_POST_PARAMS, &name, &value);
|
||||||
|
|
||||||
ConvStr(name, temp_name);
|
res = post_tab->insert( std::make_pair(name, value) );
|
||||||
ConvStr(value, temp_value);
|
|
||||||
|
|
||||||
res = post_tab->insert( std::make_pair(temp_name, temp_value) );
|
|
||||||
added = res.second;
|
added = res.second;
|
||||||
|
|
||||||
if( !added )
|
if( !added )
|
||||||
{
|
{
|
||||||
temp_name += L"_inc";
|
name += L"_inc";
|
||||||
temp_name += Toa(var_index);
|
name += Toa(var_index);
|
||||||
res = post_tab->insert( std::make_pair(temp_name, temp_value) );
|
res = post_tab->insert( std::make_pair(name, value) );
|
||||||
added = res.second;
|
added = res.second;
|
||||||
var_index += 1;
|
var_index += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateLog(added);
|
CreateLog(added, name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -113,13 +126,8 @@ public:
|
|||||||
|
|
||||||
PostParser()
|
PostParser()
|
||||||
{
|
{
|
||||||
input_as_utf8 = false;
|
|
||||||
log_value_size = 0;
|
log_value_size = 0;
|
||||||
}
|
HttpSimpleParser::getchar_returns_utf8_chars = true;
|
||||||
|
|
||||||
void UTF8(bool utf)
|
|
||||||
{
|
|
||||||
input_as_utf8 = utf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogValueSize(size_t s)
|
void LogValueSize(size_t s)
|
||||||
@@ -148,4 +156,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+34
-8
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@@ -15,6 +40,11 @@
|
|||||||
#include "cur.h"
|
#include "cur.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Rebus::SetCur(Cur * pcur)
|
void Rebus::SetCur(Cur * pcur)
|
||||||
{
|
{
|
||||||
@@ -162,9 +192,5 @@ return false;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+38
-4
@@ -1,20 +1,49 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_rebus
|
#ifndef headerfile_winix_core_rebus
|
||||||
#define headerfile_winix_core_rebus
|
#define headerfile_winix_core_rebus
|
||||||
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct Cur;
|
struct Cur;
|
||||||
|
|
||||||
|
|
||||||
@@ -48,4 +77,9 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+70
-84
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "request.h"
|
#include "request.h"
|
||||||
@@ -14,13 +39,17 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Request::Request() : char_empty(0)
|
|
||||||
|
Request::Request()
|
||||||
{
|
{
|
||||||
id = 0;
|
id = 0;
|
||||||
|
config = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -30,36 +59,29 @@ void Request::SetConfig(Config * pconfig)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Request::ClearAjax()
|
|
||||||
|
|
||||||
|
void Request::ClearOutputStreams()
|
||||||
{
|
{
|
||||||
size_t i = ajax.spaces.size();
|
size_t len = 16;
|
||||||
|
|
||||||
while( i-- > 0 )
|
if( config )
|
||||||
ajax.RemoveSpace(i);
|
len = config->ezc_out_streams_size;
|
||||||
|
|
||||||
ajax.table.clear();
|
if( len < 1 || len > 64 )
|
||||||
|
len = 16;
|
||||||
|
|
||||||
PT::Space::TableSingle::iterator s = ajax.table_single.begin();
|
out_streams.resize(len);
|
||||||
|
use_html_filter.resize(len);
|
||||||
|
|
||||||
while( s != ajax.table_single.end() )
|
for(size_t i=0 ; i<out_streams.size() ; ++i)
|
||||||
{
|
{
|
||||||
if( s->first != L"content" && s->first != L"http_status" )
|
out_streams[i].Clear();
|
||||||
{
|
use_html_filter[i] = true;
|
||||||
ajax.table_single.erase(s++);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// small optimization when deleting
|
|
||||||
// the memory for "content" and "http_status" will be reused
|
|
||||||
s->second.clear();
|
|
||||||
|
|
||||||
++s;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Request::Clear()
|
void Request::Clear()
|
||||||
{
|
{
|
||||||
// id is never 0
|
// id is never 0
|
||||||
@@ -67,39 +89,36 @@ void Request::Clear()
|
|||||||
++id;
|
++id;
|
||||||
|
|
||||||
RemovePostFileTmp(post_file_tab);
|
RemovePostFileTmp(post_file_tab);
|
||||||
|
ClearOutputStreams();
|
||||||
|
|
||||||
post_tab.clear();
|
post_tab.clear();
|
||||||
post_file_tab.clear();
|
post_file_tab.clear();
|
||||||
cookie_tab.clear();
|
cookie_tab.clear();
|
||||||
|
|
||||||
method = none;
|
method = unknown_method;
|
||||||
role = responder;
|
|
||||||
|
|
||||||
headers.Clear();
|
out_headers.Clear();
|
||||||
page.Clear();
|
out_cookies.Clear();
|
||||||
ajaxpage.Clear();
|
|
||||||
debug.Clear();
|
|
||||||
|
|
||||||
page_generated = false;
|
page_generated = false;
|
||||||
use_html_filter = true;
|
|
||||||
|
|
||||||
env_request_method = &char_empty;
|
env_request_method.clear();
|
||||||
env_request_uri = &char_empty;
|
env_request_uri.clear();
|
||||||
env_http_cookie = &char_empty;
|
env_http_cookie.clear();
|
||||||
env_remote_addr = &char_empty;
|
env_remote_addr.clear();
|
||||||
env_http_host = &char_empty;
|
env_http_host.clear();
|
||||||
env_http_user_agent = &char_empty;
|
env_http_user_agent.clear();
|
||||||
env_fcgi_role = &char_empty;
|
env_http_accept_encoding.clear();
|
||||||
env_content_type = &char_empty;
|
env_fcgi_role.clear();
|
||||||
env_http_accept_encoding = &char_empty;
|
env_content_type.clear();
|
||||||
env_https = &char_empty;
|
env_https.clear();
|
||||||
|
|
||||||
item_tab.clear();
|
item_tab.clear();
|
||||||
item.Clear();
|
item.Clear();
|
||||||
dir_tab.clear();
|
dir_tab.clear();
|
||||||
last_item = &item;
|
last_item = &item;
|
||||||
is_item = false;
|
is_item = false;
|
||||||
function = 0; // !! dodac jakas empty funkcje
|
function = 0;
|
||||||
param_tab.clear();
|
param_tab.clear();
|
||||||
anchor.clear();
|
anchor.clear();
|
||||||
|
|
||||||
@@ -117,12 +136,13 @@ void Request::Clear()
|
|||||||
start_date.Clear();
|
start_date.Clear();
|
||||||
|
|
||||||
subdomain.clear();
|
subdomain.clear();
|
||||||
ClearAjax();
|
return_info_only = false;
|
||||||
ajax_serializer = 0;
|
info.Clear();
|
||||||
|
info_serializer = 0;
|
||||||
|
return_json = false;
|
||||||
|
|
||||||
binary_page.clear();
|
out_bin_stream.clear();
|
||||||
compressed_page.clear();
|
send_bin_stream = false;
|
||||||
use_text_page = true;
|
|
||||||
|
|
||||||
gen_trim_white = false;
|
gen_trim_white = false;
|
||||||
gen_skip_new_line = false;
|
gen_skip_new_line = false;
|
||||||
@@ -145,43 +165,6 @@ void Request::RequestStarts()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// value can be null
|
|
||||||
void Request::SetCookie(const char * name, const char * value, PT::Date * expires)
|
|
||||||
{
|
|
||||||
headers << "Set-Cookie: " << name << "=";
|
|
||||||
|
|
||||||
if( value && value[0]!=0 )
|
|
||||||
headers << value;
|
|
||||||
else
|
|
||||||
headers << "\"\"";
|
|
||||||
|
|
||||||
if( expires )
|
|
||||||
headers << "; expires=" << DateToStrCookie(*expires) << " GMT";
|
|
||||||
|
|
||||||
headers << "; path=/; domain=" << config->base_url << "\r\n";
|
|
||||||
|
|
||||||
/*
|
|
||||||
don't use '; secure' flag if you are using both sites (with SSL
|
|
||||||
and without SSL) -- with secure flag the cookie is sent only through
|
|
||||||
SSL and if you accidentally open a new window without SSL (http://)
|
|
||||||
then winix will create a new session for you and the previous session (https://)
|
|
||||||
will be lost (cookie is overwritten on the client browser)
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Request::SetCookie(const char * name, long value, PT::Date * expires)
|
|
||||||
{
|
|
||||||
headers << "Set-Cookie: " << name << "=" << value;
|
|
||||||
|
|
||||||
if( expires )
|
|
||||||
headers << "; expires=" << DateToStrCookie(*expires) << " GMT";
|
|
||||||
|
|
||||||
headers << "; path=/; domain=" << config->base_url << "\r\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Request::IsPostVar(const wchar_t * var)
|
bool Request::IsPostVar(const wchar_t * var)
|
||||||
{
|
{
|
||||||
@@ -352,4 +335,7 @@ const std::wstring & Request::ParamValue(const std::wstring & param_name)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+275
-82
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_request
|
#ifndef headerfile_winix_core_request
|
||||||
@@ -22,6 +47,12 @@
|
|||||||
#include "date/date.h"
|
#include "date/date.h"
|
||||||
#include "space/space.h"
|
#include "space/space.h"
|
||||||
#include "space/spacetojson.h"
|
#include "space/spacetojson.h"
|
||||||
|
#include "textstream/textstream.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -32,62 +63,76 @@ class FunctionBase;
|
|||||||
|
|
||||||
struct Request
|
struct Request
|
||||||
{
|
{
|
||||||
// request id
|
/*
|
||||||
// is incremented for each request and is never 0
|
request id
|
||||||
// (from -1 will be incremented twice)
|
is incremented for each request and is never 0
|
||||||
// it's used for some optimalizations e.g. in templates
|
(from -1 will be incremented to one)
|
||||||
|
it's used for some optimizations e.g. in templates
|
||||||
|
*/
|
||||||
size_t id;
|
size_t id;
|
||||||
|
|
||||||
// !! moze pozbyc sie tego none?
|
|
||||||
enum Method { get, post, head, none } method;
|
|
||||||
enum Role { responder, authorizer } role;
|
|
||||||
|
|
||||||
// headers, page and debug
|
/*
|
||||||
//std::ostringstream headers, page, debug;
|
request start time
|
||||||
TextStream<std::string> headers;
|
Time() methods are very slow so it is better to directly use those two values
|
||||||
HtmlTextStream page, debug;
|
they are set when a request starts
|
||||||
TextStream<std::wstring> ajaxpage;
|
*/
|
||||||
|
time_t start_time;
|
||||||
|
PT::Date start_date;
|
||||||
|
|
||||||
// binary page
|
|
||||||
BinaryPage binary_page;
|
|
||||||
|
|
||||||
// a compressed page ready to send to the client
|
|
||||||
BinaryPage compressed_page;
|
|
||||||
|
|
||||||
// if true then either page or ajaxpage will be sent to the client
|
/*
|
||||||
// if false then binary_page is sent
|
*
|
||||||
// default: true
|
*
|
||||||
bool use_text_page;
|
*
|
||||||
|
* variables representing input from client's browser
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
// if set to true then the standard template system will not be generated
|
/*
|
||||||
// default: false
|
the HTTP method
|
||||||
bool page_generated;
|
!! IMPROVE ME add the rest methods here
|
||||||
|
*/
|
||||||
|
enum Method { get, post, head, unknown_method } method;
|
||||||
|
|
||||||
// whether or not the html filter should be used
|
|
||||||
// default: true
|
|
||||||
bool use_html_filter;
|
|
||||||
|
|
||||||
// raw parameters
|
/*
|
||||||
|
subdomain
|
||||||
|
subdomain = HTTP_HOST environment variable - config->base_url
|
||||||
|
*/
|
||||||
|
std::wstring subdomain;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
raw parameters
|
||||||
|
!! CHECK ME may post_tab and cookie_tab should be changed to PT::Space now?
|
||||||
|
or may change the name to cookie_in? or in_cookie?
|
||||||
|
*/
|
||||||
PostTab post_tab;
|
PostTab post_tab;
|
||||||
PostFileTab post_file_tab;
|
PostFileTab post_file_tab;
|
||||||
CookieTab cookie_tab;
|
CookieTab cookie_tab;
|
||||||
|
|
||||||
// html anchor (those part of URI after '#' character)
|
|
||||||
|
/*
|
||||||
|
html anchor (those part of URI after '#' character)
|
||||||
|
*/
|
||||||
std::wstring anchor;
|
std::wstring anchor;
|
||||||
|
|
||||||
|
|
||||||
// environment variables
|
// environment variables
|
||||||
// they are not null -- when the server doesn't have such a variable
|
std::wstring env_request_method;
|
||||||
// it will be pointing into 'char_empty' which is default '\0'
|
std::wstring env_request_uri;
|
||||||
const char * env_request_method;
|
std::wstring env_http_cookie;
|
||||||
const char * env_request_uri;
|
std::wstring env_remote_addr;
|
||||||
const char * env_http_cookie;
|
std::wstring env_http_host;
|
||||||
const char * env_remote_addr;
|
std::wstring env_http_user_agent;
|
||||||
const char * env_http_host;
|
std::wstring env_http_accept_encoding;
|
||||||
const char * env_http_user_agent;
|
std::wstring env_fcgi_role;
|
||||||
const char * env_http_accept_encoding;
|
std::wstring env_content_type;
|
||||||
const char * env_fcgi_role;
|
std::wstring env_https;
|
||||||
const char * env_content_type;
|
|
||||||
const char * env_https;
|
|
||||||
|
|
||||||
// current IP address of the remote host (read from REMOTE_ADDR environment variable)
|
// current IP address of the remote host (read from REMOTE_ADDR environment variable)
|
||||||
// (at the moment only IPv4 are supported)
|
// (at the moment only IPv4 are supported)
|
||||||
@@ -99,16 +144,21 @@ struct Request
|
|||||||
// true if the browser is Konqueror
|
// true if the browser is Konqueror
|
||||||
bool browser_konqueror;
|
bool browser_konqueror;
|
||||||
|
|
||||||
// true if we are using encrypted connection (SSL)
|
// true if we are using an encrypted connection (SSL)
|
||||||
bool using_ssl;
|
bool using_ssl;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
request input variables representing the winix filesystem
|
||||||
|
*/
|
||||||
|
|
||||||
// current directory
|
// current directory
|
||||||
std::vector<Item*> dir_tab;
|
std::vector<Item*> dir_tab;
|
||||||
|
|
||||||
// true if a file exists
|
// true if a file exists
|
||||||
bool is_item;
|
bool is_item;
|
||||||
|
|
||||||
// current file (if exists)
|
// current file (valid if is_item is true)
|
||||||
Item item;
|
Item item;
|
||||||
|
|
||||||
// current winix function
|
// current winix function
|
||||||
@@ -118,16 +168,30 @@ struct Request
|
|||||||
// parameters (name:value)
|
// parameters (name:value)
|
||||||
ParamTab param_tab;
|
ParamTab param_tab;
|
||||||
|
|
||||||
// request status
|
// this is a pointer either to the item (if exists) or to the last directory
|
||||||
Error status;
|
Item * last_item;
|
||||||
|
|
||||||
// usually items in the current directory (depends on the function)
|
|
||||||
std::vector<Item> item_tab;
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* variables for generating output to the client's browser
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// request status
|
||||||
|
// !! CHANGE ME it'll be better to use ordinary http result codes
|
||||||
|
Error status;
|
||||||
|
|
||||||
// if not empty means an address for redirecting to
|
// if not empty means an address for redirecting to
|
||||||
// it should be url-encoded
|
// it should be url-encoded
|
||||||
std::wstring redirect_to;
|
std::wstring redirect_to;
|
||||||
std::string aredirect_to;
|
|
||||||
|
|
||||||
// a redirect type
|
// a redirect type
|
||||||
// following redirect types are supported:
|
// following redirect types are supported:
|
||||||
@@ -141,30 +205,103 @@ struct Request
|
|||||||
// send header X-LIGHTTPD-send-file with path to a file
|
// send header X-LIGHTTPD-send-file with path to a file
|
||||||
std::wstring x_sendfile;
|
std::wstring x_sendfile;
|
||||||
|
|
||||||
// send as attachment (causes header: content-disposition: attachment)
|
// send as attachment (causes generating header: content-disposition: attachment)
|
||||||
bool send_as_attachment;
|
bool send_as_attachment;
|
||||||
|
|
||||||
// this is a pointer either to the item (if exists) or to the last directory
|
// headers send to the client (without cookies)
|
||||||
Item * last_item;
|
PT::Space out_headers;
|
||||||
|
|
||||||
// request start time
|
// cookies send to the client
|
||||||
// Time() methods are very slow so it is better to directly use those two values
|
// a value can be either a cookie value or the whole cookie string (with domain, date etc)
|
||||||
// they are set when a request starts
|
PT::Space out_cookies;
|
||||||
time_t start_time;
|
|
||||||
PT::Date start_date;
|
// winix can return either a text answer or a binary answer
|
||||||
|
// if send_bin_stream is true then the binary answer is sent (out_bin_stream)
|
||||||
|
// or if send_bin_stream is false then the text answer is sent
|
||||||
|
// default: false
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// winix answer send to the client's browser
|
||||||
|
// |
|
||||||
|
// |
|
||||||
|
// depending on send_bin_stream
|
||||||
|
// (if false) ------------------------------------------------- (if true)
|
||||||
|
// | |
|
||||||
|
// text answer binary answer
|
||||||
|
// | |
|
||||||
|
// depending on return_json sending out_bin_stream
|
||||||
|
// (if false) ------------------------------------ (if true)
|
||||||
|
// | |
|
||||||
|
// normal request ajax request
|
||||||
|
// | |
|
||||||
|
// sending out_streams[0] |
|
||||||
|
// |
|
||||||
|
// |
|
||||||
|
// depending on return_info_only
|
||||||
|
// (if false) ------------------------------------------------------ (if true)
|
||||||
|
// | |
|
||||||
|
// generating JSON object from: generating JSON object only from info
|
||||||
|
// out_streams and info, e.g.: e.g.:
|
||||||
|
// { { info object serialized here }
|
||||||
|
// "stream_1": "some html content",
|
||||||
|
// "stream_2": "some other html content",
|
||||||
|
// "info": { info object serialized here }
|
||||||
|
// }
|
||||||
|
// note that out_streams[0] is not sent
|
||||||
|
// in JSON answers
|
||||||
|
//
|
||||||
|
//
|
||||||
|
bool send_bin_stream;
|
||||||
|
|
||||||
|
// binary page sent to the client if send_bin_stream is true
|
||||||
|
BinaryPage out_bin_stream;
|
||||||
|
|
||||||
|
// when returning the text answer we can either return the whole html page (normal requests)
|
||||||
|
// or a JSON object (for requests generated from AJAX)
|
||||||
|
// if return_json is false then we return the whole html page (which is in out_streams[0])
|
||||||
|
// if return_json is true we are creating an JSON object from out_streams
|
||||||
|
// (zero stream is ignored) and from info space (see above picture)
|
||||||
|
// (or just only from info if return_info_only is true)
|
||||||
|
// default: false
|
||||||
|
// return_json is set to true by App at the beginning of a request
|
||||||
|
// if reqtype:json parameter is present (in the url)
|
||||||
|
// note: return_json is only valid if send_bin_stream is false
|
||||||
|
bool return_json;
|
||||||
|
|
||||||
|
// main text output streams where the html otput is generated from ezc templates
|
||||||
|
// the zero stream (out_streams[0]) is used as the main stream
|
||||||
|
// to which the whole html page (with doctype, head, body) is generated
|
||||||
|
// the rest streams can be only used in ajax requests (send in JSON format to the client)
|
||||||
|
// in ezc templates you can use [ezc stream ...] keyword
|
||||||
|
// to switch between streams e.g. [ezc stream "0" "2"]
|
||||||
|
std::vector<HtmlTextStream> out_streams;
|
||||||
|
|
||||||
|
// if true the JSON object is generated only from info (out_streams are not used)
|
||||||
|
// default: false
|
||||||
|
bool return_info_only;
|
||||||
|
|
||||||
|
// additional info added when sending the JSON answer
|
||||||
|
PT::Space info;
|
||||||
|
|
||||||
|
// info serializer
|
||||||
|
// if not set then the json_generic_serializer from App will be used
|
||||||
|
// default: null (json_generic_serializer used)
|
||||||
|
PT::SpaceToJSON * info_serializer;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// if set to true then the standard template system will not be used
|
||||||
|
// default: false
|
||||||
|
bool page_generated;
|
||||||
|
|
||||||
|
// whether or not the html filter should be used
|
||||||
|
// the size of the table is the same as out_streams
|
||||||
|
// default: all items true
|
||||||
|
std::vector<bool> use_html_filter;
|
||||||
|
|
||||||
// a subdomain
|
|
||||||
// subdomain = HTTP_HOST environment variable - config->base_url
|
|
||||||
std::wstring subdomain;
|
|
||||||
|
|
||||||
// used as a JSON output (when ajax_serializer is defined)
|
|
||||||
// it will be serialized and have at least:
|
|
||||||
// 'content' string - the whole html content
|
|
||||||
// 'http_status' integer - http status code (e.g. 200) !! FIXME this is not added at the moment
|
|
||||||
PT::Space ajax;
|
|
||||||
|
|
||||||
// if not null then the request will have a JSON as an output
|
|
||||||
PT::SpaceToJSON * ajax_serializer;
|
|
||||||
|
|
||||||
// if this variable is true then winix always return 200 OK header
|
// if this variable is true then winix always return 200 OK header
|
||||||
// when the status would be 404 (not found) or 403 (permission denied)
|
// when the status would be 404 (not found) or 403 (permission denied)
|
||||||
@@ -177,8 +314,27 @@ struct Request
|
|||||||
bool gen_use_special_chars;
|
bool gen_use_special_chars;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
additional variables used for common uses
|
||||||
|
*/
|
||||||
|
|
||||||
|
// usually items in the current directory (depends on the function)
|
||||||
|
std::vector<Item> item_tab;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Request();
|
Request();
|
||||||
void SetConfig(Config * pconfig);
|
void SetConfig(Config * pconfig);
|
||||||
|
|
||||||
void RequestStarts();
|
void RequestStarts();
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
@@ -186,50 +342,87 @@ struct Request
|
|||||||
|
|
||||||
bool IsParam(const wchar_t * param_name);
|
bool IsParam(const wchar_t * param_name);
|
||||||
bool IsParam(const std::wstring & param_name);
|
bool IsParam(const std::wstring & param_name);
|
||||||
|
|
||||||
const std::wstring & ParamValue(const wchar_t * param_name); // returns an empty string if there is no such a parameter
|
const std::wstring & ParamValue(const wchar_t * param_name); // returns an empty string if there is no such a parameter
|
||||||
const std::wstring & ParamValue(const std::wstring & param_name); // returns an empty string if there is no such a parameter
|
const std::wstring & ParamValue(const std::wstring & param_name); // returns an empty string if there is no such a parameter
|
||||||
|
|
||||||
void SetCookie(const char * name, const char * value, PT::Date * expires = 0);
|
|
||||||
void SetCookie(const char * name, long value, PT::Date * expires = 0);
|
|
||||||
|
|
||||||
bool IsPostVar(const wchar_t * var);
|
bool IsPostVar(const wchar_t * var);
|
||||||
bool IsPostVar(const std::wstring & var);
|
bool IsPostVar(const std::wstring & var);
|
||||||
|
|
||||||
const std::wstring & PostVar(const wchar_t * var); // returns an empty string if there is no such a parameter
|
const std::wstring & PostVar(const wchar_t * var); // returns an empty string if there is no such a parameter
|
||||||
const std::wstring & PostVar(const std::wstring & var); // returns an empty string if there is no such a parameter
|
const std::wstring & PostVar(const std::wstring & var); // returns an empty string if there is no such a parameter
|
||||||
|
|
||||||
|
|
||||||
bool PostVar(const wchar_t * var, std::wstring & result);
|
bool PostVar(const wchar_t * var, std::wstring & result);
|
||||||
bool PostVar(const std::wstring & var, std::wstring & result);
|
bool PostVar(const std::wstring & var, std::wstring & result);
|
||||||
|
|
||||||
std::wstring * PostVarp(const wchar_t * var);
|
std::wstring * PostVarp(const wchar_t * var);
|
||||||
std::wstring * PostVarp(const std::wstring & var);
|
std::wstring * PostVarp(const std::wstring & var);
|
||||||
|
|
||||||
bool AllPostVarEmpty(); // returning true if all post vars are empty
|
bool AllPostVarEmpty(); // returning true if all post vars are empty
|
||||||
|
|
||||||
void SendAll();
|
|
||||||
|
// setting a cookie
|
||||||
|
// name - cookie name (either const wchar_t, or std::wstring or PT::WTextStream)
|
||||||
|
// value - cookie value (can be everything which can be put to PT::WTextStream stream)
|
||||||
|
// the return std::wstring reference is a reference to the cookie inserted value (in out_cookies structure)
|
||||||
|
template<typename NameType, typename ValueType>
|
||||||
|
std::wstring & AddCookie(const NameType & name, const ValueType & value, PT::Date * expires = 0);
|
||||||
|
|
||||||
|
template<typename NameType, typename ValueType>
|
||||||
|
std::wstring & AddCookie(const NameType & name, const ValueType & value, PT::Date & expires);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Config * config;
|
Config * config;
|
||||||
|
|
||||||
// contains '\0'
|
|
||||||
// used to set env_* pointers to the empty value
|
|
||||||
const char char_empty;
|
|
||||||
|
|
||||||
// used in ParamValue() and PostVar() when there is no such a param
|
// used in ParamValue() and PostVar() when there is no such a param
|
||||||
const std::wstring str_empty;
|
const std::wstring str_empty;
|
||||||
|
|
||||||
void ClearAjax();
|
void ClearOutputStreams();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<typename NameType, typename ValueType>
|
||||||
|
std::wstring & Request::AddCookie(const NameType & name, const ValueType & value, PT::Date * expires)
|
||||||
|
{
|
||||||
|
PT::WTextStream cookie;
|
||||||
|
|
||||||
|
cookie << value;
|
||||||
|
|
||||||
|
if( cookie.empty() )
|
||||||
|
cookie << L"\"\""; // cookie empty value
|
||||||
|
|
||||||
|
if( expires )
|
||||||
|
cookie << L"; expires=" << DateToStrCookie(*expires) << L" GMT";
|
||||||
|
|
||||||
|
cookie << L"; path=/; domain=" << config->base_url;
|
||||||
|
|
||||||
|
/*
|
||||||
|
!! IMPROVE ME add an option to the config
|
||||||
|
|
||||||
|
don't use '; secure' flag if you are using both sites (with SSL
|
||||||
|
and without SSL) -- with secure flag the cookie is sent only through
|
||||||
|
SSL and if you accidentally open a new window without SSL (http://)
|
||||||
|
then winix will create a new session for you and the previous session (https://)
|
||||||
|
will be lost (the session cookie will be overwritten in the client's browser)
|
||||||
|
*/
|
||||||
|
|
||||||
|
return out_cookies.Add(name, cookie);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename NameType, typename ValueType>
|
||||||
|
std::wstring & Request::AddCookie(const NameType & name, const ValueType & value, PT::Date & expires)
|
||||||
|
{
|
||||||
|
return AddCookie(name, value, &expires);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+39
-4
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_requesttypes
|
#ifndef headerfile_winix_core_requesttypes
|
||||||
@@ -16,6 +41,12 @@
|
|||||||
#include "textstream/textstream.h"
|
#include "textstream/textstream.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// !! IMPROVE ME
|
||||||
// !! narazie uzywane tylko w post multi parserze
|
// !! narazie uzywane tylko w post multi parserze
|
||||||
// dodac do zwyklego parsera post
|
// dodac do zwyklego parsera post
|
||||||
#define WINIX_POSTTABLE_MAXSIZE 50
|
#define WINIX_POSTTABLE_MAXSIZE 50
|
||||||
@@ -43,10 +74,14 @@ typedef std::map<std::wstring, std::wstring> PostTab;
|
|||||||
typedef std::map<std::wstring, PostFile> PostFileTab;
|
typedef std::map<std::wstring, PostFile> PostFileTab;
|
||||||
typedef std::vector<Param> ParamTab;
|
typedef std::vector<Param> ParamTab;
|
||||||
|
|
||||||
typedef std::map<std::string, std::string> CookieTab;
|
typedef std::map<std::wstring, std::wstring> CookieTab;
|
||||||
|
|
||||||
|
|
||||||
typedef PT::TextStreamBase<char, 1, 4096> BinaryPage;
|
typedef PT::TextStreamBase<char, 1, 4096> BinaryPage;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+37
-3
@@ -1,21 +1,52 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2011, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
#include <cstring>
|
||||||
#include "run.h"
|
#include "run.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Run::Run()
|
Run::Run()
|
||||||
{
|
{
|
||||||
@@ -384,3 +415,6 @@ int Run::Go(std::string & out)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+37
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2011-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_run
|
#ifndef headerfile_winix_core_run
|
||||||
@@ -15,6 +40,11 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
how many parameters and environment variables can be passed to a program
|
how many parameters and environment variables can be passed to a program
|
||||||
*/
|
*/
|
||||||
@@ -160,5 +190,9 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+36
-4
@@ -1,16 +1,44 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Session::Session()
|
Session::Session()
|
||||||
@@ -86,9 +114,13 @@ void Session::Clear(bool clear_plugin_data)
|
|||||||
|
|
||||||
|
|
||||||
// clearing some variables when a request is ended (just for safety)
|
// clearing some variables when a request is ended (just for safety)
|
||||||
void Session::ClearOnEndRequest()
|
void Session::ClearAfterRequest()
|
||||||
{
|
{
|
||||||
// ip_ban list can be sorted by SessionManager (in the special thread)
|
// ip_ban list can be sorted by SessionManager (in the special thread)
|
||||||
ip_ban = 0;
|
ip_ban = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+36
-4
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_session
|
#ifndef headerfile_winix_core_session
|
||||||
@@ -23,6 +48,10 @@
|
|||||||
#include "ipban.h"
|
#include "ipban.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct Session
|
struct Session
|
||||||
{
|
{
|
||||||
@@ -32,7 +61,7 @@ struct Session
|
|||||||
|
|
||||||
void SetTimesTo(time_t time);
|
void SetTimesTo(time_t time);
|
||||||
void Clear(bool clear_plugin_data = true);
|
void Clear(bool clear_plugin_data = true);
|
||||||
void ClearOnEndRequest();
|
void ClearAfterRequest();
|
||||||
|
|
||||||
|
|
||||||
// 0 - means that there is a temporary session
|
// 0 - means that there is a temporary session
|
||||||
@@ -95,6 +124,9 @@ struct Session
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sessioncontainer.h"
|
#include "sessioncontainer.h"
|
||||||
@@ -12,6 +37,11 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SessionContainer::SessionContainer()
|
SessionContainer::SessionContainer()
|
||||||
{
|
{
|
||||||
@@ -207,5 +237,8 @@ return false;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+37
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_sessioncontainer
|
#ifndef headerfile_winix_core_sessioncontainer
|
||||||
@@ -19,6 +44,11 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SessionContainer
|
class SessionContainer
|
||||||
{
|
{
|
||||||
@@ -71,4 +101,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+42
-6
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@@ -17,6 +42,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -157,7 +185,7 @@ void SessionManager::SetTemporarySession()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool SessionManager::SetSessionFromCookie(const std::string & cookie)
|
bool SessionManager::SetSessionFromCookie(const std::wstring & cookie)
|
||||||
{
|
{
|
||||||
long id = Tol(cookie.c_str());
|
long id = Tol(cookie.c_str());
|
||||||
SessionContainer::Iterator s = session_tab.FindById(id);
|
SessionContainer::Iterator s = session_tab.FindById(id);
|
||||||
@@ -372,10 +400,15 @@ SessionContainer::Iterator i;
|
|||||||
|
|
||||||
void SessionManager::SaveSessions()
|
void SessionManager::SaveSessions()
|
||||||
{
|
{
|
||||||
|
char file_path[WINIX_OS_PATH_SIZE];
|
||||||
|
|
||||||
if( config->session_file.empty() )
|
if( config->session_file.empty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::ofstream file(config->session_file.c_str());
|
if( !WideToUTF8(config->session_file, file_path, WINIX_OS_PATH_SIZE) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::ofstream file(file_path);
|
||||||
|
|
||||||
if( !file )
|
if( !file )
|
||||||
{
|
{
|
||||||
@@ -400,7 +433,7 @@ void SessionManager::SaveSessions()
|
|||||||
}
|
}
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
chmod(config->session_file.c_str(), 0600);
|
chmod(file_path, 0600);
|
||||||
|
|
||||||
log << log2 << "SM: saved " << len << " session(s)" << logend;
|
log << log2 << "SM: saved " << len << " session(s)" << logend;
|
||||||
}
|
}
|
||||||
@@ -603,3 +636,6 @@ void SessionManager::DeleteSession(Session * del_session)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+37
-4
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_sessionmanager
|
#ifndef headerfile_winix_core_sessionmanager
|
||||||
@@ -24,6 +49,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SessionManager : public BaseThread
|
class SessionManager : public BaseThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -88,7 +118,7 @@ private:
|
|||||||
|
|
||||||
long CreateSessionId();
|
long CreateSessionId();
|
||||||
void CreateSession();
|
void CreateSession();
|
||||||
bool SetSessionFromCookie(const std::string & cookie);
|
bool SetSessionFromCookie(const std::wstring & cookie);
|
||||||
void SetTemporarySession();
|
void SetTemporarySession();
|
||||||
|
|
||||||
// second thread
|
// second thread
|
||||||
@@ -102,4 +132,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+45
-6
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sessionparser.h"
|
#include "sessionparser.h"
|
||||||
@@ -12,8 +37,12 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
bool SessionParser::Parse(const std::string & path, SessionContainer & container)
|
|
||||||
|
|
||||||
|
bool SessionParser::Parse(const std::wstring & path, SessionContainer & container)
|
||||||
{
|
{
|
||||||
return Parse(path.c_str(), container);
|
return Parse(path.c_str(), container);
|
||||||
}
|
}
|
||||||
@@ -25,10 +54,16 @@ void SessionParser::SetUsers(Users * pusers)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SessionParser::Parse(const char * path, SessionContainer & container)
|
bool SessionParser::Parse(const wchar_t * path, SessionContainer & container)
|
||||||
{
|
{
|
||||||
|
char file_path[WINIX_OS_PATH_SIZE];
|
||||||
|
|
||||||
container.Clear();
|
container.Clear();
|
||||||
file.open(path, std::ios_base::in | std::ios_base::binary);
|
|
||||||
|
if( !WideToUTF8(path, file_path, WINIX_OS_PATH_SIZE) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
file.open(file_path, std::ios_base::in | std::ios_base::binary);
|
||||||
|
|
||||||
if( !file )
|
if( !file )
|
||||||
{
|
{
|
||||||
@@ -166,3 +201,7 @@ bool is_sign = false;
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+38
-5
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_sessionparser
|
#ifndef headerfile_winix_core_sessionparser
|
||||||
@@ -17,13 +42,17 @@
|
|||||||
#include "users.h"
|
#include "users.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SessionParser
|
class SessionParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool Parse(const char * path, SessionContainer & container);
|
bool Parse(const wchar_t * path, SessionContainer & container);
|
||||||
bool Parse(const std::string & path, SessionContainer & container);
|
bool Parse(const std::wstring & path, SessionContainer & container);
|
||||||
void SetUsers(Users * pusers);
|
void SetUsers(Users * pusers);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -46,5 +75,9 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+37
-4
@@ -1,13 +1,43 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2011-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "slog.h"
|
#include "slog.h"
|
||||||
|
#include "utf8/utf8.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -159,7 +189,7 @@ return *this;
|
|||||||
|
|
||||||
SLog & SLog::TranslateText(const char * str)
|
SLog & SLog::TranslateText(const char * str)
|
||||||
{
|
{
|
||||||
AssignString(str, key_temp);
|
PT::UTF8ToWide(str, key_temp);
|
||||||
return TranslateText(key_temp.c_str());
|
return TranslateText(key_temp.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,3 +252,6 @@ SLog & SLog::operator<<(TranslateTextHelper<std::wstring> raw)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+37
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2011-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_slog
|
#ifndef headerfile_winix_core_slog
|
||||||
@@ -16,6 +41,11 @@
|
|||||||
#include "textstream/textstream.h"
|
#include "textstream/textstream.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define WINIX_SLOG_MAX_LOG_SIZE 10240
|
#define WINIX_SLOG_MAX_LOG_SIZE 10240
|
||||||
|
|
||||||
|
|
||||||
@@ -137,5 +167,9 @@ return *this;
|
|||||||
extern SLog slog;
|
extern SLog slog;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+62
-12
@@ -1,20 +1,64 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "synchro.h"
|
#include "synchro.h"
|
||||||
|
|
||||||
|
|
||||||
Synchro::Synchro() : mutex(PTHREAD_MUTEX_INITIALIZER)
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Synchro::Synchro()
|
||||||
{
|
{
|
||||||
was_stop_signal = false;
|
was_stop_signal = false;
|
||||||
ref = 0;
|
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
/*
|
||||||
|
* on FreeBSD a pthread's pthread_mutex_lock() is checking for deadlocks by default
|
||||||
|
*/
|
||||||
|
mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
#else
|
||||||
|
pthread_mutexattr_t attr;
|
||||||
|
|
||||||
|
pthread_mutexattr_init(&attr);
|
||||||
|
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
|
||||||
|
pthread_mutex_init(&mutex, &attr);
|
||||||
|
pthread_mutexattr_destroy(&attr);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -23,29 +67,34 @@ bool Synchro::Lock()
|
|||||||
{
|
{
|
||||||
int res = pthread_mutex_lock(&mutex);
|
int res = pthread_mutex_lock(&mutex);
|
||||||
|
|
||||||
if( res == EDEADLK )
|
if( res == 0 )
|
||||||
{
|
{
|
||||||
// Lock() method in this thread was called before
|
ref[pthread_self()] = 1;
|
||||||
ref += 1;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
if( res == EDEADLK )
|
||||||
{
|
{
|
||||||
ref = 0;
|
// Lock() method in this thread was called before
|
||||||
|
ref[pthread_self()] += 1;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return res == 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Synchro::Unlock()
|
void Synchro::Unlock()
|
||||||
{
|
{
|
||||||
if( ref > 0 )
|
int & r = ref[pthread_self()];
|
||||||
|
|
||||||
|
if( r > 1 )
|
||||||
{
|
{
|
||||||
ref -= 1;
|
r -= 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
if( r == 1 )
|
||||||
{
|
{
|
||||||
pthread_mutex_unlock(&mutex);
|
pthread_mutex_unlock(&mutex);
|
||||||
}
|
}
|
||||||
@@ -54,4 +103,5 @@ void Synchro::Unlock()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+38
-5
@@ -1,16 +1,46 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_synchro
|
#ifndef headerfile_winix_core_synchro
|
||||||
#define headerfile_winix_core_synchro
|
#define headerfile_winix_core_synchro
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -31,13 +61,16 @@ struct Synchro
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// deadlock counter
|
// deadlock counter for each thread
|
||||||
// we can call Lock() more than one in the same thread
|
// we can call Lock() more than one in the same thread
|
||||||
int ref;
|
std::map<pthread_t, int> ref;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+66
-5
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
@@ -16,6 +41,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void System::SetCur(Cur * pcur)
|
void System::SetCur(Cur * pcur)
|
||||||
{
|
{
|
||||||
cur = pcur;
|
cur = pcur;
|
||||||
@@ -144,6 +175,30 @@ bool ssl = false;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void System::CreateItemLink(long parent_id, const std::wstring & url, const std::wstring & subdomain,
|
||||||
|
std::wstring & link, bool clear_str)
|
||||||
|
{
|
||||||
|
PutUrlProto(config->use_ssl, link, clear_str);
|
||||||
|
|
||||||
|
if( !subdomain.empty() )
|
||||||
|
{
|
||||||
|
link += subdomain;
|
||||||
|
link += '.';
|
||||||
|
}
|
||||||
|
|
||||||
|
link += config->base_url;
|
||||||
|
dirs.MakePath(parent_id, link, false); // !! IMPROVE ME may some kind of error checks here?
|
||||||
|
link += url;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void System::CreateItemLink(const Item & item, std::wstring & link, bool clear_str)
|
||||||
|
{
|
||||||
|
CreateItemLink(item.parent_id, item.url, cur->request->subdomain, link, clear_str);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// !! IMPROVE ME
|
// !! IMPROVE ME
|
||||||
// !! mozna zrobic jakas obsluge kiedy nie mozemy sie redirectnac, np gdy wystapil blad
|
// !! mozna zrobic jakas obsluge kiedy nie mozemy sie redirectnac, np gdy wystapil blad
|
||||||
// !! moze zwracac jakas wartosc?
|
// !! moze zwracac jakas wartosc?
|
||||||
@@ -822,7 +877,7 @@ return res;
|
|||||||
|
|
||||||
// making a global file path (in the unix file system)
|
// making a global file path (in the unix file system)
|
||||||
// you should call CreateNewFile before
|
// you should call CreateNewFile before
|
||||||
bool System::MakeFilePath(const Item & item, std::wstring & path, bool thumb, bool create_dir, int chmod)
|
bool System::MakeFilePath(const Item & item, std::wstring & path, bool thumb, bool create_dir, int chmod, int group)
|
||||||
{
|
{
|
||||||
path.clear();
|
path.clear();
|
||||||
|
|
||||||
@@ -852,7 +907,7 @@ bool System::MakeFilePath(const Item & item, std::wstring & path, bool thumb, bo
|
|||||||
path += L"/normal";
|
path += L"/normal";
|
||||||
|
|
||||||
|
|
||||||
if( create_dir && !CreateDirs(path, item.file_path, chmod, true) )
|
if( create_dir && !CreateDirs(path, item.file_path, chmod, group, true) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
path += '/';
|
path += '/';
|
||||||
@@ -1183,6 +1238,8 @@ int System::FollowAllLinks(const std::vector<Item*> & current_dir_tab, const std
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// !! CHECK ME
|
||||||
|
// FollowLink is using link_to_temp temporary variable too
|
||||||
res = FollowLink(current_dir_tab, link_to_temp, out_dir_tab, out_item);
|
res = FollowLink(current_dir_tab, link_to_temp, out_dir_tab, out_item);
|
||||||
link_to_temp.clear();
|
link_to_temp.clear();
|
||||||
|
|
||||||
@@ -1343,3 +1400,7 @@ bool System::AddCommonFileToVar(const wchar_t * file_path, const wchar_t * url,
|
|||||||
return AddFile(file_content_item, false) == WINIX_ERR_OK;
|
return AddFile(file_content_item, false) == WINIX_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+45
-4
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_system
|
#ifndef headerfile_winix_core_system
|
||||||
@@ -29,6 +54,11 @@
|
|||||||
#include "timezones.h"
|
#include "timezones.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Functions;
|
class Functions;
|
||||||
class SessionManager;
|
class SessionManager;
|
||||||
|
|
||||||
@@ -134,7 +164,7 @@ public:
|
|||||||
|
|
||||||
// creating item.file_path and item.file_fs (the mountpoint where the item is located)
|
// creating item.file_path and item.file_fs (the mountpoint where the item is located)
|
||||||
bool CreateNewFile(Item & item);
|
bool CreateNewFile(Item & item);
|
||||||
bool MakeFilePath(const Item & item, std::wstring & path, bool thumb = false, bool create_dir = false, int chmod = 0755);
|
bool MakeFilePath(const Item & item, std::wstring & path, bool thumb = false, bool create_dir = false, int chmod = 0755, int group = -1);
|
||||||
|
|
||||||
bool MakePath(const Item & item, std::wstring & path, bool clear_path = true);
|
bool MakePath(const Item & item, std::wstring & path, bool clear_path = true);
|
||||||
|
|
||||||
@@ -171,6 +201,13 @@ public:
|
|||||||
// reloading time zones
|
// reloading time zones
|
||||||
void ReadTimeZones();
|
void ReadTimeZones();
|
||||||
|
|
||||||
|
|
||||||
|
void CreateItemLink(long parent_id, const std::wstring & url, const std::wstring & subdomain,
|
||||||
|
std::wstring & link, bool clear_str = true);
|
||||||
|
|
||||||
|
void CreateItemLink(const Item & item, std::wstring & link, bool clear_str = true);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Cur * cur;
|
Cur * cur;
|
||||||
@@ -204,5 +241,9 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+227
-20
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_textstream
|
#ifndef headerfile_winix_core_textstream
|
||||||
@@ -16,6 +41,12 @@
|
|||||||
#include "space/space.h"
|
#include "space/space.h"
|
||||||
#include "date/date.h"
|
#include "date/date.h"
|
||||||
#include "textstream/textstream.h"
|
#include "textstream/textstream.h"
|
||||||
|
#include "utf8/utf8.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -24,7 +55,17 @@
|
|||||||
similar to std::ostringstream
|
similar to std::ostringstream
|
||||||
|
|
||||||
StringType can be either std::string or std::wstring
|
StringType can be either std::string or std::wstring
|
||||||
this class doesn't use UTF-8 in any kind
|
|
||||||
|
this class uses UTF-8 <-> wide characters conversions:
|
||||||
|
if StringType is std::string:
|
||||||
|
operator<<(const char*) only copies the input string
|
||||||
|
operator<<(const wchar_t*) converts from wide characters to UTF-8
|
||||||
|
(similary for an operator with std::string and std::wstring)
|
||||||
|
if StringType is std::wstring:
|
||||||
|
operator<<(const char*) converts from UTF-8 to wide characters
|
||||||
|
operator<<(const wchar_t*) only copies the input string
|
||||||
|
(similary for an operator with std::string and std::wstring)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
template<class StringType>
|
template<class StringType>
|
||||||
class TextStream
|
class TextStream
|
||||||
@@ -42,6 +83,9 @@ public:
|
|||||||
const StringType & Str() const;
|
const StringType & Str() const;
|
||||||
const CharType * CStr() const;
|
const CharType * CStr() const;
|
||||||
|
|
||||||
|
void Str(const StringType & str);
|
||||||
|
void Str(const StringType && str);
|
||||||
|
|
||||||
CharType operator[](size_t index);
|
CharType operator[](size_t index);
|
||||||
|
|
||||||
TextStream & operator<<(const char * str);
|
TextStream & operator<<(const char * str);
|
||||||
@@ -71,10 +115,30 @@ public:
|
|||||||
TextStream & write(const char * buf, size_t len); // for compatibility with standard library (Ezc uses it)
|
TextStream & write(const char * buf, size_t len); // for compatibility with standard library (Ezc uses it)
|
||||||
TextStream & write(const wchar_t * buf, size_t len);
|
TextStream & write(const wchar_t * buf, size_t len);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
StringType buffer;
|
StringType buffer;
|
||||||
std::wstring space_str; // for using with spaces
|
|
||||||
|
void Convert(wchar_t c, std::string & dst);
|
||||||
|
void Convert(wchar_t c, std::wstring & dst);
|
||||||
|
|
||||||
|
void Convert(const char * src, size_t len, std::wstring & dst);
|
||||||
|
void Convert(const char * src, std::wstring & dst);
|
||||||
|
void Convert(const std::string & src, std::wstring & dst);
|
||||||
|
|
||||||
|
void Convert(const wchar_t * src, size_t len, std::string & dst);
|
||||||
|
void Convert(const wchar_t * src, std::string & dst);
|
||||||
|
void Convert(const std::wstring & src, std::string & dst);
|
||||||
|
|
||||||
|
void Convert(const char * src, size_t len, std::string & dst);
|
||||||
|
void Convert(const char * src, std::string & dst);
|
||||||
|
void Convert(const std::string & src, std::string & dst);
|
||||||
|
|
||||||
|
void Convert(const wchar_t * src, size_t len, std::wstring & dst);
|
||||||
|
void Convert(const wchar_t * src, std::wstring & dst);
|
||||||
|
void Convert(const std::wstring & src, std::wstring & dst);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -118,6 +182,21 @@ const typename TextStream<StringType>::CharType * TextStream<StringType>::CStr()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Str(const StringType & str)
|
||||||
|
{
|
||||||
|
buffer = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Str(const StringType && str)
|
||||||
|
{
|
||||||
|
buffer = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<class StringType>
|
template<class StringType>
|
||||||
typename TextStream<StringType>::CharType TextStream<StringType>::operator[](size_t index)
|
typename TextStream<StringType>::CharType TextStream<StringType>::operator[](size_t index)
|
||||||
{
|
{
|
||||||
@@ -129,7 +208,7 @@ typename TextStream<StringType>::CharType TextStream<StringType>::operator[](siz
|
|||||||
template<class StringType>
|
template<class StringType>
|
||||||
TextStream<StringType> & TextStream<StringType>::operator<<(const char * str)
|
TextStream<StringType> & TextStream<StringType>::operator<<(const char * str)
|
||||||
{
|
{
|
||||||
AssignString(str, buffer, false);
|
Convert(str, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -138,7 +217,7 @@ return *this;
|
|||||||
template<class StringType>
|
template<class StringType>
|
||||||
TextStream<StringType> & TextStream<StringType>::operator<<(const std::string * str)
|
TextStream<StringType> & TextStream<StringType>::operator<<(const std::string * str)
|
||||||
{
|
{
|
||||||
AssignString(*str, buffer, false);
|
Convert(*str, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -147,7 +226,7 @@ return *this;
|
|||||||
template<class StringType>
|
template<class StringType>
|
||||||
TextStream<StringType> & TextStream<StringType>::operator<<(const std::string & str)
|
TextStream<StringType> & TextStream<StringType>::operator<<(const std::string & str)
|
||||||
{
|
{
|
||||||
AssignString(str, buffer, false);
|
Convert(str, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -157,7 +236,7 @@ return *this;
|
|||||||
template<class StringType>
|
template<class StringType>
|
||||||
TextStream<StringType> & TextStream<StringType>::operator<<(const wchar_t * str)
|
TextStream<StringType> & TextStream<StringType>::operator<<(const wchar_t * str)
|
||||||
{
|
{
|
||||||
AssignString(str, buffer, false);
|
Convert(str, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -166,7 +245,7 @@ return *this;
|
|||||||
template<class StringType>
|
template<class StringType>
|
||||||
TextStream<StringType> & TextStream<StringType>::operator<<(const std::wstring * str)
|
TextStream<StringType> & TextStream<StringType>::operator<<(const std::wstring * str)
|
||||||
{
|
{
|
||||||
AssignString(*str, buffer, false);
|
Convert(*str, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -175,7 +254,7 @@ return *this;
|
|||||||
template<class StringType>
|
template<class StringType>
|
||||||
TextStream<StringType> & TextStream<StringType>::operator<<(const std::wstring & str)
|
TextStream<StringType> & TextStream<StringType>::operator<<(const std::wstring & str)
|
||||||
{
|
{
|
||||||
AssignString(str, buffer, false);
|
Convert(str, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -185,6 +264,10 @@ return *this;
|
|||||||
template<class StringType>
|
template<class StringType>
|
||||||
TextStream<StringType> & TextStream<StringType>::operator<<(char v)
|
TextStream<StringType> & TextStream<StringType>::operator<<(char v)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* there is no any possibility to treat 'v' as UTF-8 character if we have got
|
||||||
|
* only one character so we only copy it
|
||||||
|
*/
|
||||||
buffer += v;
|
buffer += v;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
@@ -194,7 +277,7 @@ return *this;
|
|||||||
template<class StringType>
|
template<class StringType>
|
||||||
TextStream<StringType> & TextStream<StringType>::operator<<(wchar_t v)
|
TextStream<StringType> & TextStream<StringType>::operator<<(wchar_t v)
|
||||||
{
|
{
|
||||||
buffer += static_cast<CharType>(v);
|
Convert(v, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -207,7 +290,7 @@ wchar_t buf[50];
|
|||||||
size_t len = sizeof(buf) / sizeof(wchar_t);
|
size_t len = sizeof(buf) / sizeof(wchar_t);
|
||||||
|
|
||||||
Toa(v, buf, len);
|
Toa(v, buf, len);
|
||||||
AssignString(buf, buffer, false);
|
Convert(buf, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -220,7 +303,7 @@ wchar_t buf[50];
|
|||||||
size_t len = sizeof(buf) / sizeof(wchar_t);
|
size_t len = sizeof(buf) / sizeof(wchar_t);
|
||||||
|
|
||||||
Toa(v, buf, len);
|
Toa(v, buf, len);
|
||||||
AssignString(buf, buffer, false);
|
Convert(buf, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -233,7 +316,7 @@ wchar_t buf[50];
|
|||||||
size_t len = sizeof(buf) / sizeof(wchar_t);
|
size_t len = sizeof(buf) / sizeof(wchar_t);
|
||||||
|
|
||||||
Toa(v, buf, len);
|
Toa(v, buf, len);
|
||||||
AssignString(buf, buffer, false);
|
Convert(buf, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -246,7 +329,7 @@ wchar_t buf[50];
|
|||||||
size_t len = sizeof(buf) / sizeof(wchar_t);
|
size_t len = sizeof(buf) / sizeof(wchar_t);
|
||||||
|
|
||||||
Toa(v, buf, len);
|
Toa(v, buf, len);
|
||||||
AssignString(buf, buffer, false);
|
Convert(buf, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -258,7 +341,7 @@ TextStream<StringType> & TextStream<StringType>::operator<<(double v)
|
|||||||
char buf[50];
|
char buf[50];
|
||||||
|
|
||||||
sprintf(buf, "%f", v);
|
sprintf(buf, "%f", v);
|
||||||
AssignString(buf, buffer, false);
|
Convert(buf, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -274,7 +357,7 @@ size_t len = sizeof(buf) / sizeof(wchar_t);
|
|||||||
buf[1] = 'x';
|
buf[1] = 'x';
|
||||||
|
|
||||||
Toa(reinterpret_cast<unsigned long>(v), buf+2, len-2, 16);
|
Toa(reinterpret_cast<unsigned long>(v), buf+2, len-2, 16);
|
||||||
AssignString(buf, buffer, false);
|
Convert(buf, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -283,7 +366,7 @@ return *this;
|
|||||||
template<class StringType>
|
template<class StringType>
|
||||||
TextStream<StringType> & TextStream<StringType>::Write(const char * buf, size_t len)
|
TextStream<StringType> & TextStream<StringType>::Write(const char * buf, size_t len)
|
||||||
{
|
{
|
||||||
AssignString(buf, len, buffer, false);
|
Convert(buf, len, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -299,7 +382,7 @@ TextStream<StringType> & TextStream<StringType>::write(const char * buf, size_t
|
|||||||
template<class StringType>
|
template<class StringType>
|
||||||
TextStream<StringType> & TextStream<StringType>::Write(const wchar_t * buf, size_t len)
|
TextStream<StringType> & TextStream<StringType>::Write(const wchar_t * buf, size_t len)
|
||||||
{
|
{
|
||||||
AssignString(buf, len, buffer, false);
|
Convert(buf, len, buffer);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -345,5 +428,129 @@ return *this;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Convert(wchar_t c, std::string & dst)
|
||||||
|
{
|
||||||
|
PT::IntToUTF8((int)c, dst, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Convert(wchar_t c, std::wstring & dst)
|
||||||
|
{
|
||||||
|
dst += c;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Convert(const char * src, size_t len, std::wstring & dst)
|
||||||
|
{
|
||||||
|
PT::UTF8ToWide(src, len, dst, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Convert(const char * src, std::wstring & dst)
|
||||||
|
{
|
||||||
|
PT::UTF8ToWide(src, dst, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Convert(const std::string & src, std::wstring & dst)
|
||||||
|
{
|
||||||
|
PT::UTF8ToWide(src, dst, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Convert(const wchar_t * src, size_t len, std::string & dst)
|
||||||
|
{
|
||||||
|
PT::WideToUTF8(src, len, dst, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Convert(const wchar_t * src, std::string & dst)
|
||||||
|
{
|
||||||
|
PT::WideToUTF8(src, dst, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Convert(const std::wstring & src, std::string & dst)
|
||||||
|
{
|
||||||
|
PT::WideToUTF8(src, dst, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Convert(const char * src, size_t len, std::string & dst)
|
||||||
|
{
|
||||||
|
// we suppose that append is smart enough and we don't have to use reserve()
|
||||||
|
dst.append(src, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Convert(const char * src, std::string & dst)
|
||||||
|
{
|
||||||
|
size_t len;
|
||||||
|
|
||||||
|
for(len=0 ; src[len] ; ++len){}
|
||||||
|
|
||||||
|
Convert(src, len, dst);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Convert(const std::string & src, std::string & dst)
|
||||||
|
{
|
||||||
|
dst.append(src);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Convert(const wchar_t * src, size_t len, std::wstring & dst)
|
||||||
|
{
|
||||||
|
// we suppose that append is smart enough and we don't have to use reserve()
|
||||||
|
dst.append(src, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Convert(const wchar_t * src, std::wstring & dst)
|
||||||
|
{
|
||||||
|
size_t len;
|
||||||
|
|
||||||
|
for(len=0 ; src[len] ; ++len){}
|
||||||
|
|
||||||
|
Convert(src, len, dst);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<class StringType>
|
||||||
|
void TextStream<StringType>::Convert(const std::wstring & src, std::wstring & dst)
|
||||||
|
{
|
||||||
|
dst.append(src);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+37
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2011-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@@ -12,6 +37,12 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ThreadManager::ThreadManager()
|
ThreadManager::ThreadManager()
|
||||||
{
|
{
|
||||||
were_started = false;
|
were_started = false;
|
||||||
@@ -134,3 +165,6 @@ void ThreadManager::StopAll()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+37
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2011-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_threadmanager
|
#ifndef headerfile_winix_core_threadmanager
|
||||||
@@ -16,6 +41,11 @@
|
|||||||
#include "synchro.h"
|
#include "synchro.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ThreadManager
|
class ThreadManager
|
||||||
{
|
{
|
||||||
@@ -61,5 +91,9 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+36
-3
@@ -1,16 +1,45 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "timezone.h"
|
#include "timezone.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TimeZone::Dst::Dst()
|
TimeZone::Dst::Dst()
|
||||||
@@ -287,3 +316,7 @@ return result;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+35
-7
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_timezone
|
#ifndef headerfile_winix_core_timezone
|
||||||
@@ -17,6 +42,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TimeZone
|
class TimeZone
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -132,10 +163,7 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+33
-5
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "timezones.h"
|
#include "timezones.h"
|
||||||
@@ -12,6 +37,10 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TimeZones::TimeZones()
|
TimeZones::TimeZones()
|
||||||
{
|
{
|
||||||
@@ -135,7 +164,6 @@ void TimeZones::ParseZones()
|
|||||||
// just space by space (not implemented in Space at the moment)
|
// just space by space (not implemented in Space at the moment)
|
||||||
bool TimeZones::ReadTimeZones(const wchar_t * path)
|
bool TimeZones::ReadTimeZones(const wchar_t * path)
|
||||||
{
|
{
|
||||||
parser.UTF8(true);
|
|
||||||
parser.SetSpace(temp_space);
|
parser.SetSpace(temp_space);
|
||||||
zone_tab.clear();
|
zone_tab.clear();
|
||||||
temp_space.Clear();
|
temp_space.Clear();
|
||||||
@@ -174,5 +202,5 @@ bool TimeZones::ReadTimeZones(const std::wstring & path)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|||||||
+36
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_timezones
|
#ifndef headerfile_winix_core_timezones
|
||||||
@@ -16,6 +41,11 @@
|
|||||||
#include "space/spaceparser.h"
|
#include "space/spaceparser.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TimeZones
|
class TimeZones
|
||||||
{
|
{
|
||||||
@@ -77,5 +107,8 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+36
-3
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_ugcontainer
|
#ifndef headerfile_winix_core_ugcontainer
|
||||||
@@ -15,6 +40,10 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
class UGContainer
|
class UGContainer
|
||||||
@@ -274,4 +303,8 @@ return result;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+35
-17
@@ -1,15 +1,45 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "user.h"
|
#include "user.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
User::User()
|
User::User()
|
||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
@@ -32,6 +62,7 @@ void User::Clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool User::IsMemberOf(long group)
|
bool User::IsMemberOf(long group)
|
||||||
{
|
{
|
||||||
std::vector<long>::iterator i;
|
std::vector<long>::iterator i;
|
||||||
@@ -47,19 +78,6 @@ return false;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+42
-5
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_user
|
#ifndef headerfile_winix_core_user
|
||||||
@@ -16,6 +41,11 @@
|
|||||||
#include "date/date.h"
|
#include "date/date.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define WINIX_ACCOUNT_MAX_LOGIN_SIZE 250
|
#define WINIX_ACCOUNT_MAX_LOGIN_SIZE 250
|
||||||
#define WINIX_ACCOUNT_MAX_PASSWORD_SIZE 250
|
#define WINIX_ACCOUNT_MAX_PASSWORD_SIZE 250
|
||||||
#define WINIX_ACCOUNT_MAX_EMAIL_SIZE 250
|
#define WINIX_ACCOUNT_MAX_EMAIL_SIZE 250
|
||||||
@@ -27,6 +57,7 @@
|
|||||||
#define WINIX_ACCOUNT_NOT_ACTIVATED 1
|
#define WINIX_ACCOUNT_NOT_ACTIVATED 1
|
||||||
|
|
||||||
// 2 - a user clicked on the link in the mail and now can normally use his account
|
// 2 - a user clicked on the link in the mail and now can normally use his account
|
||||||
|
// (if has a password set too)
|
||||||
#define WINIX_ACCOUNT_READY 2
|
#define WINIX_ACCOUNT_READY 2
|
||||||
|
|
||||||
// 3 - account was suspended
|
// 3 - account was suspended
|
||||||
@@ -36,6 +67,9 @@
|
|||||||
#define WINIX_ACCOUNT_BLOCKED 4
|
#define WINIX_ACCOUNT_BLOCKED 4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
a user can login only to an account which status is equal to WINIX_ACCOUNT_READY
|
a user can login only to an account which status is equal to WINIX_ACCOUNT_READY
|
||||||
|
|
||||||
@@ -57,6 +91,8 @@
|
|||||||
*/
|
*/
|
||||||
struct UserPass
|
struct UserPass
|
||||||
{
|
{
|
||||||
|
bool has_pass; // true if the user has a password set
|
||||||
|
// if false the user cannot login
|
||||||
int pass_type; // the kind of hash (WINIX_CRYPT_HASH_* see crypt.h)
|
int pass_type; // the kind of hash (WINIX_CRYPT_HASH_* see crypt.h)
|
||||||
std::wstring pass; // password hashed or plain text if pass_type==0
|
std::wstring pass; // password hashed or plain text if pass_type==0
|
||||||
std::string pass_encrypted; // password encrypted
|
std::string pass_encrypted; // password encrypted
|
||||||
@@ -74,7 +110,6 @@ struct User
|
|||||||
std::wstring email;
|
std::wstring email;
|
||||||
int notify;
|
int notify;
|
||||||
|
|
||||||
|
|
||||||
// environment variables which can be set by this user
|
// environment variables which can be set by this user
|
||||||
// use 'env' winix function
|
// use 'env' winix function
|
||||||
PT::Space env;
|
PT::Space env;
|
||||||
@@ -94,7 +129,6 @@ struct User
|
|||||||
// time zone identifier
|
// time zone identifier
|
||||||
size_t time_zone_id;
|
size_t time_zone_id;
|
||||||
|
|
||||||
|
|
||||||
User();
|
User();
|
||||||
|
|
||||||
void Clear();
|
void Clear();
|
||||||
@@ -105,4 +139,7 @@ struct User
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+36
-4
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
@@ -13,6 +38,10 @@
|
|||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Users::Users()
|
Users::Users()
|
||||||
{
|
{
|
||||||
@@ -226,7 +255,7 @@ bool Users::LoginUser(long user_id, bool remember_me, bool use_ses_log)
|
|||||||
if( !cur->session->new_session )
|
if( !cur->session->new_session )
|
||||||
session_manager->ChangeSessionId(cur->session->id);
|
session_manager->ChangeSessionId(cur->session->id);
|
||||||
|
|
||||||
last.UserLogin(user_id, cur->session->puser->name, inet_addr(cur->request->env_remote_addr), cur->session->id);
|
last.UserLogin(user_id, cur->session->puser->name, cur->request->ip, cur->session->id);
|
||||||
how_many_logged += 1;
|
how_many_logged += 1;
|
||||||
|
|
||||||
log << log2 << "Users: user " << cur->session->puser->name << " (id: " << user_id << ") logged" << logend;
|
log << log2 << "Users: user " << cur->session->puser->name << " (id: " << user_id << ") logged" << logend;
|
||||||
@@ -292,3 +321,6 @@ long Users::HowManyLogged()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+35
-4
@@ -1,10 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_users
|
#ifndef headerfile_winix_core_users
|
||||||
@@ -17,6 +42,12 @@
|
|||||||
#include "cur.h"
|
#include "cur.h"
|
||||||
#include "db/db.h"
|
#include "db/db.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SessionManager;
|
class SessionManager;
|
||||||
|
|
||||||
|
|
||||||
@@ -71,7 +102,7 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+38
-5
@@ -1,19 +1,52 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is distributed under the 2-Clause BSD licence.
|
||||||
*
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||||
* Copyright (c) 2008-2013, Tomasz Sowa
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_version
|
#ifndef headerfile_winix_core_version
|
||||||
#define headerfile_winix_core_version
|
#define headerfile_winix_core_version
|
||||||
|
|
||||||
|
|
||||||
|
namespace Winix
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
#define WINIX_VER_MAJOR 0
|
#define WINIX_VER_MAJOR 0
|
||||||
#define WINIX_VER_MINOR 5
|
#define WINIX_VER_MINOR 6
|
||||||
#define WINIX_VER_REVISION 5
|
#define WINIX_VER_REVISION 3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Winix
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user