]> granicus.if.org Git - php/commitdiff
Be more verbose, if headers were already sent and remove RSHUTDOWN handler
authorSascha Schumann <sas@php.net>
Sat, 15 Jan 2000 13:20:39 +0000 (13:20 +0000)
committerSascha Schumann <sas@php.net>
Sat, 15 Jan 2000 13:20:39 +0000 (13:20 +0000)
ext/session/session.c

index 20ad12b3c397fe08709c71fa18eb9b9464cad2da..04dd67f1a383dc1e8c35af8515fd064aa6ea9814 100644 (file)
@@ -101,7 +101,6 @@ const static ps_serializer ps_serializers[] = {
 PHP_MINIT_FUNCTION(session);
 PHP_RINIT_FUNCTION(session);
 PHP_MSHUTDOWN_FUNCTION(session);
-PHP_RSHUTDOWN_FUNCTION(session);
 PHP_MINFO_FUNCTION(session);
 
 static void php_rinit_session_globals(PSLS_D);
@@ -111,7 +110,7 @@ zend_module_entry session_module_entry = {
        "Session Management",
        session_functions,
        PHP_MINIT(session), PHP_MSHUTDOWN(session),
-       PHP_RINIT(session), PHP_RSHUTDOWN(session),
+       PHP_RINIT(session), NULL,
        PHP_MINFO(session),
        STANDARD_MODULE_PROPERTIES,
 };
@@ -525,6 +524,11 @@ static void _php_session_cache_limiter(PSLS_D)
 {
        php_session_cache_limiter *lim;
 
+       if (SG(headers_sent)) {
+               php_error(E_WARNING, "Cannot send session cache limiter - headers already sent");
+               return;
+       }
+       
        for (lim = php_session_cache_limiters; lim->name; lim++) {
                if (!strcasecmp(lim->name, PS(cache_limiter))) {
                        lim->func(PSLS_C);
@@ -546,6 +550,11 @@ static void _php_session_send_cookie(PSLS_D)
        char *cookie;
        char *date_fmt = NULL;
 
+       if (SG(headers_sent)) {
+               php_error(E_WARNING, "Cannot send session cookie - headers already sent");
+               return;
+       }
+
        len = strlen(PS(session_name)) + strlen(PS(id)) + sizeof(COOKIE_FMT);
        if (PS(cookie_lifetime) > 0) {
                date_fmt = php_std_date(time(NULL) + PS(cookie_lifetime));
@@ -1205,24 +1214,6 @@ PHP_RINIT_FUNCTION(session)
        return SUCCESS;
 }
 
-PHP_RSHUTDOWN_FUNCTION(session)
-{
-    /* 
-       this now done in _php_session_shutdown
-
-       PSLS_FETCH();
-
-       if(PS(nr_open_sessions) > 0) {
-               _php_session_save_current_state(PSLS_C);
-               PS(nr_open_sessions)--;
-       }
-       php_rshutdown_session_globals(PSLS_C);
-
-    */
-  
-    return SUCCESS;
-}
-
 PHP_MINIT_FUNCTION(session)
 {
 #ifdef ZTS