everywhere we are using std::wstring and wchar_t*
(std::string and char* is used only locally in some places
especially when creating a path to OS file system etc.)
added: to the special thread when winix closes:
a write function for curl: FetchPageOnExitCurlCallback()
without this function the curl library will print
the page's content to the standart output
changed: TextStream<> class from core can make
UTF8<->wide strings conversions
removed: from config: utf8 option
now winix expects UTF8 from the user's input (html forms, url-es)
and outputs strings in the UTF8 format
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@965 e52654a7-88a9-db11-a3e9-0013d4bc506e
added: now we are able to use the html filter for the whole out_streams (when ajax is used the output is filtered too)
splitted FilterCompressSend() function -- first we are making the filtering
(after filtering we know the size of the content to send)
added: to Compress:
Compressing(const char * source, size_t source_len, BinaryPage & out_stream, int encoding);
changed: some refactoring in App
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@942 e52654a7-88a9-db11-a3e9-0013d4bc506e
some environment variables were put there
removed: config variable: debug_info
removed: Request::role (responder, authorizer)
now we have only one role: responder
added: new config variables:
log_env_variables (default false) - when true then fastcgi environment
variables are logged to the log file
log_http_answer_headers (default false) - when true all http headers
created by winix ale logged (note that the www server can add/adjust other headers)
changed: some refactoring in Request struct
changed: CookieTab to std::map<std::wstring, std::wstring>
beforehand std::string was used
(changed CookieParser as well)
changed: Request::SetCookie() to AddCookie()
added: Request::out_headers (a PT::Space struct)
http headers (without cookies) send back to the client
added: Request::out_cookies (a PT::Space struct)
cookies send to the client
changed: App class to use Request::out_headers and Request::out_cookies
some SendHeaders...() methods were renamed to PrepareHeaders...()
and they create output in Request::out_headers first (and out_cookies)
and later it is sent
added: two plugin messages:
// 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
added: config variable:
// how many output streams do we have in Request class
// default: 16 (64 maximum)
size_t ezc_out_streams_size;
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@940 e52654a7-88a9-db11-a3e9-0013d4bc506e
index_rawcontent.html, index_ajaxcontent.html
now we have out_streams in Request and some special
keyword in ezc templates for sending content to the
specified streams
changed: the way how winix answers to the client's browsers:
info from Request class:
winix answer send to the client's browser
|
|
depending on send_bin_stream
-------------------------------------------------
| |
text answer binary answer
| |
depending on return_json sending out_bin_stream
------------------------------------
| |
normal request ajax request
| |
sending out_streams[0] depending on return_info_only
------------------------------------------------------
| |
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
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@937 e52654a7-88a9-db11-a3e9-0013d4bc506e
then we are using a generic json serializer
changed: we are sending the application/json header when returning an json string
added: to config: log_server_answer (default false)
when true we put the whole string (server's answer) to the log file
added: to Request: use_200_status_for_not_found_and_permission_denied
if this is true then if the server http code would be 403 or 404
then we return 200 OK (useful when using ajax)
changed: System::RedirectTo() methods take as the last parameter: use_reqtype
if this is true (default) then reqtype:type parameter is automatically added to the redirecting path
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@918 e52654a7-88a9-db11-a3e9-0013d4bc506e
now after some incorrent login attempts your IP can be banned or blocked
(see new config variables)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@902 e52654a7-88a9-db11-a3e9-0013d4bc506e
added: to Request:
// 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;
BinaryPage is defined as (in requesttypes.h):
typedef PT::TextStreamBase<char, 1, 4096> BinaryPage;
added: to Compress: now it can gets BinaryPage as arguments (input, output)
changed: winix version to: 0.5.0
added: in templates: TexTextStream class
for taking input to the TeX typesetting system
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@884 e52654a7-88a9-db11-a3e9-0013d4bc506e
// 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)
PT::Space ajax;
// if not null then the request will have a JSON as an output
PT::SpaceToJSON * ajax_serializer;
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@871 e52654a7-88a9-db11-a3e9-0013d4bc506e
std::wstring * PostVarp(const std::wstring & var);
added: to misc:
template<class CharType>
bool Toa(unsigned/signed long/int value, CharType * buffer);
some Toa methods which don't get the buffer len
(the buffer has to be sufficient big)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@845 e52654a7-88a9-db11-a3e9-0013d4bc506e
removed start_tm
added start_date (PT::Date)
changed: in Session:
removed: tm_time
added: start_date (PT::Date)
renamed: time -> start_time
the same is for last_time
now we have (last_time and last_date)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@838 e52654a7-88a9-db11-a3e9-0013d4bc506e
now we first demonize (fork) and then open the log file
added: start adding support for PT::Date
we are using instead of tz system structure
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@836 e52654a7-88a9-db11-a3e9-0013d4bc506e
and was not used when checking for base url redirect
fixed: return values from plugins should be given in a special structure
they were remembered in plugin object (ret_false, ret_true)
and consequently were not thread safe
now all plugin.Call() methods return PluginRes structure
in which there are ret_false and ret_true variables
changed: small refactoring in AddUser winix function
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@827 e52654a7-88a9-db11-a3e9-0013d4bc506e
UrlEncode() for char->wstring
UrlEncode() for wstring->wstring
removed: Request::redirect_url_encoded flag
the Request::redirect_to string should always be url-encoded
changed: in UrnEncode()
now characters like '#' and '/' are not allowed in an url
(will be url-encoded)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@807 e52654a7-88a9-db11-a3e9-0013d4bc506e
parameter: ezc_max_elements
maximum number for elements through the whole template (ezc)
default: 50000
parameter: ezc_max_loop_elements
maximum number of each [for] loop
default: 5000 (from ezc generator)
added: to Request class:
time_t start_time;
tm start_tm;
they are set when a request starts
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@806 e52654a7-88a9-db11-a3e9-0013d4bc506e
menu_dir_tab ezc functions can be nested now
(not finished yet)
added: 'meta' winix function
additional meta information for files and directories
(not finished yet)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@775 e52654a7-88a9-db11-a3e9-0013d4bc506e
true if the connections is encrypted by using SSL
changed: in BaseUrlRedirect
we also check if the connection should use SSL
and if so then we make a redirect to "https://.."
changed: in 'static' mount points:
if the request was e.g. "/styles/default.js?t=B49E5BQ"
we should return a file "/styles/default.js" (without the "?..." part)
additionally '#' character is checked
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@762 e52654a7-88a9-db11-a3e9-0013d4bc506e
(int Request::redirect_type variable)
we can set following integer values:
300 - Multiple Choices
301 - Moved Permanently
302 - Found
307 - Temporary Redirect
303 - See Other
default is 303 for all redirects
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@749 e52654a7-88a9-db11-a3e9-0013d4bc506e
we're using an jquery upload plugin
added: Item struct has new rows: hash, hash_type, file_size, sort_index
added: css mount parameter
you can specify css files there, and javascript wysiwyg editors
(ckeditor, tinymce) can make use of it
changed: post parsers can parse post variables with the same name
(a postfix is added in such a case)
added: common_dir parameter to the config
this is a path to common directory (directory with common static files)
it is needed to the 'css' mount parameter
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@746 e52654a7-88a9-db11-a3e9-0013d4bc506e
size of a generated thumbnail (size in pixels)
added: plugin gallery: mount option gallery_type
it can be:
"lightbox"
"galleria"
"galleriathumb"
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@717 e52654a7-88a9-db11-a3e9-0013d4bc506e
we have there two pointers:
Request * request;
Session * session;
these are the current request and the current session
the session GC was moved to SessionManager (was in SessionContainer)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@708 e52654a7-88a9-db11-a3e9-0013d4bc506e
- we have a class BaseThread -- this is a base class -- we can inherit from it when
creating a new thread
- others treads are correctly stopped (when signal comes) -- pthread_join
- we have a special thread only for signals
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@685 e52654a7-88a9-db11-a3e9-0013d4bc506e
changed: functions for text/numbers conversions
int Toi(const std::string & str, int base = 10);
int Toi(const std::wstring & str, int base = 10);
int Toi(const char * str, int base = 10);
int Toi(const wchar_t * str, int base = 10);
long Tol(const std::string & str, int base = 10);
long Tol(const std::wstring & str, int base = 10);
long Tol(const char * str, int base = 10);
long Tol(const wchar_t * str, int base = 10);
template<class CharType>
bool Toa(unsigned long value, CharType * buffer, size_t buf_len, int base = 10);
template<class CharType>
bool Toa(long value, CharType * buffer, size_t buf_len, int base = 10);
template<class CharType>
bool Toa(unsigned int value, CharType * buffer, size_t buf_len, int base = 10);
template<class CharType>
bool Toa(int value, CharType * buffer, size_t buf_len, int base = 10);
const wchar_t * Toa(unsigned int value, int base = 10);
const wchar_t * Toa(unsigned long value, int base = 10);
const wchar_t * Toa(int value, int base = 10);
const wchar_t * Toa(long value, int base = 10);
void Toa(int value, std::string & res, int base = 10, bool clear = true);
void Toa(long value, std::string & res, int base = 10, bool clear = true);
void Toa(int value, std::wstring & res, int base = 10, bool clear = true);
void Toa(long value, std::wstring & res, int base = 10, bool clear = true);
added: HtmlTextStream class (files htmltextstream.cpp htmltextstream.h in templates)
this is a special stream for automatically escaping html tags
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@682 e52654a7-88a9-db11-a3e9-0013d4bc506e
fixed: when winix exits the session data were not properly destroyed (memory leak)
we should set request.session pointer to each session when deleting sessions
from session_container
the session data were not properly destroyed when winix checked for
outdated sessions (and when it was removing them)
fixed: performance (memcpy used too often)
in some places there were reserve method used (on std::wstring/std::string objects)
especially in AssignString() method and TextStream<> object
if we add a new string we should check the new size
and only call reserve() if the new size will be greater than existing one
(plus some constant)
changed: fcgi objects moved to App class (from Request)
now we use thread safe methods (e.g. FCGX_Accept_r)
added: log_plugin_call option to the config
default: false
when true winix log when a plugin function is called
added: winix parameter 'nostat' for not calculating statistics
(useful when making performance tests)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@680 e52654a7-88a9-db11-a3e9-0013d4bc506e
fixed: reading a new url and subject in Functions::ReadItem()
added: tickets are sorted now (by date)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@659 e52654a7-88a9-db11-a3e9-0013d4bc506e
(now we have O(1) time for selecting the right html template)
added: winix function: template
for selecting a template for an item (file or dir)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@636 e52654a7-88a9-db11-a3e9-0013d4bc506e
they are in FunThread and FunTicket classes now
added funtion FunUptime (I forgot about it)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@631 e52654a7-88a9-db11-a3e9-0013d4bc506e
now we have app object and singletons are only: log logn plugin and app
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@628 e52654a7-88a9-db11-a3e9-0013d4bc506e
we have two file systems now:
- simplefs - the files stored on the hard drive have the same structure as in the database (dir1/dir2/file)
- hashfs - files are stored in special directories
extented: the mountparser can read file system
added: function download
this is a default function for items which have static content
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@588 e52654a7-88a9-db11-a3e9-0013d4bc506e
added functions: ticket, createticket, editticket
(there is no 'rm' function working for tickets yet)
changed: mount parser and mount points
now we have more parameters (arguments in parameters)
some refactoring in functions 'emacs' and 'mkdir'
git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@554 e52654a7-88a9-db11-a3e9-0013d4bc506e
added: cmslu can act as an authorizer (fast cgi authorize role)
added: Item::static_auth we can have additional static content on the file system
this content is authorized through cmslu (fastcgi authorizer mode)
changed: some changes in config
changed: the way how the www server is using cmslu
added new virtuals: static static_auth
changed: cmslu returns correct http headers (200, 404, 403)
changed: in cookie parser: we get the last cookie (if the server has more than one cookie with the same name)
git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@540 e52654a7-88a9-db11-a3e9-0013d4bc506e