Commit Graph

352 Commits

Author SHA1 Message Date
Zeev Suraski
797a079a95 More TSRMLS_FETCH work, and a bit of cleanup 2001-07-30 06:18:13 +00:00
Zeev Suraski
d87cc976e1 Redesigned thread safety mechanism - nua nua 2001-07-28 11:36:37 +00:00
Zeev Suraski
fe6f8712a4 - Get rid of ELS_*(), and use TSRMLS_*() instead.
- Move to the new ts_allocate_id() API
This patch is *bound* to break some files, as I must have had typos somewhere.
If you use any uncommon extension, please try to build it...
2001-07-27 10:16:41 +00:00
Sascha Schumann
00596b414e Get rid of memchr 2001-07-25 19:02:13 +00:00
Hartmut Holzgraefe
d3fdc92ff5 these tow fail with "Constant sid already defined" i
too if E_NOTICE error reporting is active
2001-07-22 21:46:39 +00:00
Zeev Suraski
6f297a370a Fix Windows build 2001-07-20 14:40:30 +00:00
Sascha Schumann
ef42a25b42 Fix a serious long-standing bug which deleted the shared memory segment
when an Apache children died.

Dynamically resize hash-table.

The hash key is now stored as part of the hash entry structure which
saves a mm_malloc.

ps_sd_new has been restructured to avoid code duplication.

A bug concerning moving existing entries to the top of a linked list
has been fixed.
2001-07-19 04:16:54 +00:00
Sascha Schumann
664df24d11 Fix GC bug which did not increment the proper variable.
Fix warning regarding the initial hash value.
Use php_uint32 everywhere.
Speedup linked-list traversal by using the hash value.
Degrade linked-list to singledly linked-list.
Allocate a new shared memory buffer, if the data does not fit into the
current one.  Prior to this change, we always allocated a new buffer.
Fix debug prints to be compatible with non-GCC compilers.
NUL-terminate string return values.
2001-07-18 23:18:58 +00:00
Sascha Schumann
9576ab24dd Instead of using the poor system rand() algorithm and the
system-time seed, rely on the long-living LCG to determine
whether to start the GC process.
2001-07-18 22:56:56 +00:00
Sascha Schumann
eef0dda4da Retire old hash algorithm and use the FNV-1 algorithm. 2001-07-18 21:39:02 +00:00
Thies C. Arntzen
249c010d92 make regession test of session work without the ugly hack in session.c
and removed that ugly hack.
2001-07-13 10:32:37 +00:00
Hartmut Holzgraefe
319149fd8b workaround to make ext/session well behaved with 'make test' and E_ALL 2001-07-11 13:46:11 +00:00
Hartmut Holzgraefe
e15d0193d9 cleanup in preparation for session_readonly() 2001-07-11 13:27:27 +00:00
Sascha Schumann
ef13ab5750 Improve url scanner speed (up to 40% for large chunks of data)
and handle some corner cases better.  The scanner has been changed
to the format as proposed in "RE2C - A More Versatile Scanner Generator"
by Cowan et al.
2001-07-04 15:30:21 +00:00
Hartmut Holzgraefe
7f08918b87 suppress sending of cookies if session id already came
from a non-cookie source
2001-06-29 05:27:57 +00:00
foobar
2c95a1d690 The extension name seems to be usually totally lower-cased. 2001-06-24 22:18:51 +00:00
Thies C. Arntzen
bd4f32cf12 - fixed the reference in session thingie
- regression test checked (this time;-)
- added new regression test for references
- references _between_ session variables also work in when the session var
  replaces an already existing global var (this was a brain twister)
- saved one strlen call per session variable
- fixed one tiny leak
2001-06-21 18:46:26 +00:00
Sascha Schumann
375ef3aec5 Back out severely broken patch. I currently don't have the time
to debug this.  Please reapply a fixed version.
2001-06-20 23:39:28 +00:00
Thies C. Arntzen
45f629925f @- Fixed references in sessions. This doesn't work when using the
@  WDDX session-serializer. Also improved speed of sessions. (Thies)
from now on php_set_session_var no longer copies the variable recovered from a
session (tested with php, php_binary and wddx). this should speed up session
deserializing quite a bit. (this damn thing has cost me 6 hours of my life;-)
2001-06-20 15:16:08 +00:00
Sebastian Bergmann
3f4a4a3643 Change copyright note. 2001-06-19 21:14:39 +00:00
Harald Radi
22790c9602 removed warnings 2001-06-10 23:26:35 +00:00
Sascha Schumann
5ebe991cfe Signal that no entry was found 2001-06-10 14:12:28 +00:00
Sascha Schumann
b31801b249 Check for http_session_vars != NULL. 2001-06-08 11:45:53 +00:00
Rasmus Lerdorf
9c55882133 Fold a bit more code 2001-06-06 14:32:27 +00:00
Sterling Hughes
db305fc6f7 small ws fix. 2001-05-30 20:16:23 +00:00
Sterling Hughes
28160f73d0 Revert as per Herr Schumann's request. 2001-05-30 19:56:11 +00:00
Sterling Hughes
506ceb28fc Try #2
# aka, flying blind in a shitstorm, but it shouldn't hurt anything
2001-05-30 19:43:27 +00:00
Sterling Hughes
948edd322b should fix warnings under winblows. 2001-05-30 18:33:46 +00:00
Stig Bakken
1beda9ee1e * include "config.h" if HAVE_CONFIG_H is defined (for standalone dso build) 2001-05-24 10:07:29 +00:00
Sascha Schumann
3ffaa634a2 fix buggy debug statements 2001-05-24 01:12:11 +00:00
Sascha Schumann
5e112d4384 Due to dynamic registration of storage handlers, OnUpdateSaveHandler
might be called before that registration takes place and hence the
INI update is dismissed.  In that case, we defer the lookup to the
first request init.
2001-05-23 23:18:51 +00:00
Andi Gutmans
14ac3d74b9 - Nuke GINIT 2001-05-23 17:10:40 +00:00
Andrei Zmievski
699489d456 @- Made $HTTP_SESSION_VARS['foo'] and $foo be references to the same value
@  when register_globals is on. (Andrei)
2001-05-22 17:55:07 +00:00
Sascha Schumann
e2eaf6342e Add support for systems where p{read|write} take a off64_t without
being properly prototyped.
2001-05-20 23:39:09 +00:00
Sascha Schumann
060983b184 Use zend_hash_add_empty_element 2001-05-19 14:51:39 +00:00
Sascha Schumann
6c3b8d5619 Improve reading from external data source for session id creation.
Improve generating the string representation of the md5 session id.
2001-05-19 09:58:31 +00:00
Sascha Schumann
90c2979144 Nuke some warnings. 2001-05-13 07:37:28 +00:00
Sascha Schumann
afdaee9e47 Nuke more quotes 2001-05-12 11:09:05 +00:00
Sascha Schumann
8a3eb51a26 Replace ssize_t with long, as Win32 lacks proper support for that type. 2001-05-12 08:39:33 +00:00
Sascha Schumann
814fa2c71c Save a couple of syscalls per session
Fix apparent new-session-files-were-not-locked bug

Replace %m with portable "%s", strerror(errno)
2001-05-11 17:43:40 +00:00
Sascha Schumann
9de9b7c1e9 add an interface for registering storage modules at run-time. 2001-05-03 15:48:49 +00:00
Andrei Zmievski
ea56318495 Patch from Sascha that abstracts session serializers. WDDX extension
now implements the encode/decode functions and registers them with
the session module.
2001-05-01 17:01:51 +00:00
Andi Gutmans
4c823e8a89 - Change macros from V_ to VCWD_ because of AIX name clash 2001-04-30 12:45:02 +00:00
Andi Gutmans
6e8f7a06f6 - use get_current_key_ex() in order to receive key length and not having
- to use strlen() everywhere.
2001-04-26 02:54:27 +00:00
Shane Caraveo
a7f48e470f compile was broken, new argument? 2001-04-26 01:46:18 +00:00
foobar
8a26918ed1 Renamed the AC_ prefixed macros defined in acinclude.m4 to PHP_* prefixes.
# Heads up people! I tested this before committing but you never know..
2001-03-27 20:35:04 +00:00
Sascha Schumann
667a1f1fdb buf is gone. Don't reference it. 2001-03-13 17:11:43 +00:00
Sascha Schumann
2b6698aaa9 Replace another sprintf 2001-03-13 16:58:36 +00:00
Sascha Schumann
86cf74a169 Nuke calls to sprintf, snprintf, strcat, strcpy and rely on
memcpy and smart_strs.
2001-03-13 16:53:34 +00:00
Andi Gutmans
01ed33d1b6 - Pointed out by Andrei. zval_ptr_dtor() should be used instead of the
zval_del_ref() function which should be nuked.
2001-02-27 20:16:35 +00:00
Andi Gutmans
eb6ba01d1c - Fix copyright notices with 2001 2001-02-26 06:11:02 +00:00
Sascha Schumann
1b15d1f166 Use MAKE_STD_ZVAL/FREE_ZVAL to handle zval memory allocation. 2001-01-07 10:42:15 +00:00
Sascha Schumann
41cd55dd44 Add a new test and refine the fourth test 2001-01-07 10:40:41 +00:00
Sascha Schumann
24c49a21b9 Use zval_ptr_dtor instead of zval_dtor/FREE_ZVAL pair.
Submitted by: Andi Gutmans
2001-01-07 10:32:06 +00:00
Sascha Schumann
8e22a8a73b Add session_set_save_handler test 2000-12-24 16:33:27 +00:00
Sascha Schumann
3ca8721e99 More instances of s/efree/FREE_ZVAL/ 2000-12-24 16:30:42 +00:00
Sascha Schumann
7574cd4360 Not freeing the zval using FREE_ZVAL caused a segfault in
shutdown_memory_manager.
2000-12-24 16:26:38 +00:00
Sascha Schumann
80ff1a3874 Also call some member functions of the deserialized objects 2000-12-24 16:06:32 +00:00
Sascha Schumann
72f99e668e Add session object deserialization test 2000-12-24 16:01:32 +00:00
Sascha Schumann
5722a0e1ce Add two regression tests for the session module 2000-12-24 15:57:05 +00:00
Sascha Schumann
92f61634eb (PHP session_unset) Return early, if no session was started.
PR: #8354
2000-12-22 22:53:14 +00:00
Zeev Suraski
aa6d2ac5d0 Heads up people!
Updated the get_current_key() API - the relevant authors, please take
a look at the updated code and make sure it's ok...
2000-12-22 12:57:09 +00:00
Sascha Schumann
225a08e8dd No need for GCC extensions in non-debugging mode.
PR: #8345
2000-12-21 05:31:18 +00:00
Sascha Schumann
5347ef1728 Whitespace fix and initialize ret properly 2000-11-22 04:10:04 +00:00
Stanislav Malyshev
119ee485c6 Move "replace value" logic to Zend 2000-11-20 12:39:14 +00:00
Hartmut Holzgraefe
1f6878e912 2nd step towards auto-credits 2000-11-20 10:33:33 +00:00
Stanislav Malyshev
92dd81ba7f Fix #3261 - variables declared as "global" in function do not get the right
value after session_start.
2000-11-19 13:13:36 +00:00
Sascha Schumann
0feb2a21e5 Add some additional checks
Submitted by: mookid@sigent.ru (Mikhail Zabaluev)
2000-11-03 12:00:49 +00:00
Sascha Schumann
b4ce4e2634 Fix implementation of hash algorithm 2000-11-03 11:59:41 +00:00
Sascha Schumann
43ff395b65 Const'ify part of sapi_request_info.
query_string, post_data, path_translated, request_uri, auth_user,
auth_password and argv0 are modified, so they cannot become const.
2000-11-02 15:47:02 +00:00
Stanislav Malyshev
c31faf0bd9 Add support for serializing references.
@- Add support for serializing references (Stas)
# WDDX and shared memory functions not covered yet
2000-10-30 17:10:06 +00:00
Zeev Suraski
1fd09132c2 Initial steps to move the INI mechanism to the Zend engine 2000-10-29 11:38:26 +00:00
Stanislav Malyshev
06de8e78cf Allow to send secure cookies 2000-10-28 17:13:28 +00:00
Sascha Schumann
4f757a3af0 Add session_adapt_url(). 2000-10-26 18:10:43 +00:00
Andrei Zmievski
27a1c12ad8 session_unset() now cleans up $HTTP_SESSION_VARS as well. 2000-10-26 17:37:47 +00:00
Alexander Feldman
7c11cfaf03 Fixed a bug in session.c. If the user calls session_module_name with a
parameter, then the mod_data pointer is initialized to NULL and then
php_session_save_current_state did not check this value before referencing
the pointer. Added a check in php_session_save_current_state.
2000-10-23 13:10:01 +00:00
foobar
7a54e0b10c Fixed crash (bus error) in readdir() and session cleanup when compiled
with Sun CC.
2000-10-18 14:14:14 +00:00
Sascha Schumann
7c0ba95806 fix indentation 2000-10-17 02:50:15 +00:00
Daniel Beulshausen
4086197d95 fixes bug 7055 & 7235 2000-10-16 10:35:43 +00:00
Sascha Schumann
d2d5320ee8 Add session_write_close(). This is primarily intended to enable
script writers to release the lock associated with the session lock
before the request finishes.

You can pass arrays now to session_set_save_handler(), so that the handlers
can be located in an object for better abstraction.
2000-10-11 19:47:15 +00:00
Sascha Schumann
11c88a0ff5 Return SUCCESS from write handler, if vallen is 0.
Submitted by: tcarroll@chc-chimes.com
PR: #6958
2000-09-29 21:44:45 +00:00
Sascha Schumann
5bf4e7857d Clean up STR_CAT macro (it is still ugly) 2000-09-27 15:24:09 +00:00
Sascha Schumann
d959c647e2 Remove superflucious variable 2000-09-26 11:00:02 +00:00
Sascha Schumann
9c6414d6fa Deactivate E_NOTICE message on gc 2000-09-20 01:38:39 +00:00
Sascha Schumann
07e71ce1f1 s/url_scanner.h/url_scanner_ex.h/ 2000-09-20 01:22:55 +00:00
Sascha Schumann
61dc840cdd Make the new url scanner the default.
If there are any problems (especially with characters > 127), let me know.
2000-09-20 01:22:17 +00:00
Sascha Schumann
51498e1d3f Kill warning 2000-09-19 17:46:23 +00:00
Sascha Schumann
2ec043606b *** empty log message *** 2000-09-19 17:22:37 +00:00
Sascha Schumann
bd616da7ca Libc5-readdir_r workaround 2000-09-11 15:24:28 +00:00
Sascha Schumann
cb410a2f3c Convert some more "complex" expressions manually to Z_* macros. 2000-09-06 14:25:47 +00:00
Sascha Schumann
5bbddee81e Rename symbols whose first character was an underscore. 2000-09-06 14:16:12 +00:00
Sascha Schumann
4fb5088f89 Convert to Z_* macros 2000-09-06 14:13:31 +00:00
Sascha Schumann
4eb2481830 Why make it more complex than necessary?
These changes should have been committed right after Zeev made the
original change to use the PHP_INI system months ago.

Instead of working around the system, we make proper use of it now.

This includes using php_alter_ini_entry(), so that we change the values
in the php_ps_globals struct indirectly.
2000-09-06 00:50:01 +00:00
Stanislav Malyshev
795083a15c Now it should not crash, though still leaks
# I'll continue with it tomorrow
2000-09-05 22:42:45 +00:00
Zeev Suraski
dd0ade23cf This fix wasn't quite right and is no longer necessary after the recent php_ini optimizations 2000-09-05 21:31:56 +00:00
Zeev Suraski
12adebbc3a - Fix leak
- Remove redundant php_ini code
2000-09-05 21:18:00 +00:00
Stanislav Malyshev
20a6474eae Fix crash
# This is getting worse... Seems that more work is needed
2000-09-05 19:29:03 +00:00
Zeev Suraski
eb32144902 - Remove track_vars - it is now always on
- Make the various $HTTP_*_VARS[] arrays be defined always,
  even if they're empty
- Fix Win32 build and warnings
2000-09-05 19:06:29 +00:00
Stanislav Malyshev
3c45b97804 Try to fix session INI variables handling
This should also fix #6538.
# This code gets really hairy, I do not like it,
# but it's the only working thing I could come with.
# If original creator reviews and cleans it up, it'd be great
2000-09-05 18:41:46 +00:00
Sascha Schumann
607486391a Extend HTTP headers for private-caching and add a new PHP function
session_cache_limiter.

Submitted by: Jon Parise <jon@csh.rit.edu>
2000-09-01 15:56:26 +00:00