Re: com php-src: Fix handling of session user module custom handlers.: NEWS ext/session/mod_user.c

From: Date: Sun, 06 Jul 2014 21:29:11 +0000
Subject: Re: com php-src: Fix handling of session user module custom handlers.: NEWS ext/session/mod_user.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-79251@lists.php.net to get a copy of this message
On Sun, Jul 6, 2014 at 6:40 PM, Sara Golemon <pollita@php.net> wrote: > Commit: 2d9885c8cbbc2199bac4801eaef7c18c76f28033 > Author: Sara Golemon <pollita@php.net> Thu, 15 May 2014 > 14:00:15 -0700 > Parents: 5b925824edf3edc951fc41608d5cbd07a0baab08 > Branches: master > > Link: > > http://git.php.net/?p=php-src.git;a=commitdiff;h=2d9885c8cbbc2199bac4801eaef7c18c76f28033 > > Log: > Fix handling of session user module custom handlers. > > According to the documentation, returning TRUE from > user based session handlers should indicate success, > while returning FALSE should indicate failure. > > The existing logic relied on casting the return value > to an integer and returning that from the function. > However, the internal handlers use SUCCESS/FAILURE > where SUCCESS == 0, and FAILURE == -1, so the following > behavior map occurs: > > return false; => return 0; => return SUCCESS > return true; => return 1; => return <undefined> > > Since the session API checks against FAILURE, > both boolean responses wind up appearing like "not FAILURE". > > This diff reasserts boolean responses to behave as > documented and introduces some special handling > for integer responses of 0 and -1 so that code can be > written for older and newer versions of PHP. > After this changeset, the following tests fail on Travis ( https://travis-ci.org/php/php-src/builds/29257323): Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in write during exec [ext/session/tests/bug60634_error_1.phpt] Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - exception in write during exec [ext/session/tests/bug60634_error_2.phpt] Test session_module_name() function : variation [ext/session/tests/session_module_name_variation3.phpt] Test session_set_save_handler() function : basic functionality [ext/session/tests/session_set_save_handler_basic.phpt] Test session_set_save_handler() : full handler implementation [ext/session/tests/session_set_save_handler_class_002.phpt] Test session_set_save_handler() : incomplete implementation [ext/session/tests/session_set_save_handler_class_005.phpt] Test session_set_save_handler() : incorrect arguments for existing handler open [ext/session/tests/session_set_save_handler_class_012.phpt] Test session_set_save_handler() function: class with create_sid [ext/session/tests/session_set_save_handler_class_016.phpt] Test session_set_save_handler() function: class with create_sid [ext/session/tests/session_set_save_handler_class_017.phpt] Test session_set_save_handler() function : using closures as callbacks [ext/session/tests/session_set_save_handler_closures.phpt] Test session_set_save_handler() function : error functionality [ext/session/tests/session_set_save_handler_error3.phpt] Test session_set_save_handler() function : error functionality [ext/session/tests/session_set_save_handler_error4.phpt] Test session_set_save_handler() function: interface [ext/session/tests/session_set_save_handler_iface_001.phpt] Test session_set_save_handler() function : variation [ext/session/tests/session_set_save_handler_variation4.phpt] Test session_set_save_handler() function : test write short circuit [ext/session/tests/session_set_save_handler_write_short_circuit.phpt] Could you please take a look? Nikita

« previous php.cvs (#79251) next »