]> git.pld-linux.org Git - packages/php.git/blob - php-session-unregister.patch
- added session-unregister patch to avoid httpd SEGVs with msession module
[packages/php.git] / php-session-unregister.patch
1 --- php-4.3.0/ext/session/php_session.h.orig    Thu Oct  3 08:45:15 2002
2 +++ php-4.3.0/ext/session/php_session.h Tue Jan  7 12:45:39 2003
3 @@ -181,6 +181,7 @@
4  int php_get_session_var(char *name, size_t namelen, zval ***state_var TSRMLS_DC);
5  
6  PHPAPI int php_session_register_module(ps_module *);
7 +PHPAPI int php_session_unregister_module(const char *name);
8  
9  PHPAPI int php_session_register_serializer(const char *name,
10                 int (*encode)(PS_SERIALIZER_ENCODE_ARGS),
11 --- php-4.3.0/ext/session/session.c.orig        Thu Dec  5 21:42:05 2002
12 +++ php-4.3.0/ext/session/session.c     Tue Jan  7 12:45:38 2003
13 @@ -208,12 +208,33 @@
14                         ps_modules[i] = ptr;
15                         ret = 0;
16                         break;
17 -               }       
18 +               } else if((ps_modules[i]->name != NULL) && (ptr->name != NULL) && 
19 +                               !strcasecmp(ps_modules[i]->name, ptr->name)) {
20 +                       /* avoid double registration */
21 +                       ret = 0;
22 +                       break;
23 +               }
24         }
25         
26         return ret;
27  }
28  
29 +PHPAPI int php_session_unregister_module(const char *name)
30 +{
31 +       int ret = -1;
32 +       int i;
33 +
34 +       for (i = 0; i < MAX_MODULES; i++) {
35 +               if (ps_modules[i] && ps_modules[i]->name && !strcasecmp(ps_modules[i]->name, name)) {
36 +                       ps_modules[i] = 0;
37 +                       ret = 0;
38 +                       break;
39 +               }
40 +       }
41 +
42 +       return ret;
43 +}
44 +
45  PHP_MINIT_FUNCTION(session);
46  PHP_RINIT_FUNCTION(session);
47  PHP_MSHUTDOWN_FUNCTION(session);
48 --- php-4.3.0/ext/session/mod_mm.c.orig Thu Dec  5 21:42:05 2002
49 +++ php-4.3.0/ext/session/mod_mm.c      Tue Jan  7 12:46:21 2003
50 @@ -291,6 +291,7 @@
51  
52  PHP_MSHUTDOWN_FUNCTION(ps_mm)
53  {
54 +       php_session_unregister_module("mm");
55         if (ps_mm_instance) {
56                 ps_mm_destroy(ps_mm_instance);
57                 return SUCCESS;
58 --- php-4.3.0/ext/msession/msession.c.orig      Thu Aug 22 15:29:50 2002
59 +++ php-4.3.0/ext/msession/msession.c   Tue Jan  7 12:46:50 2003
60 @@ -188,6 +188,9 @@
61  
62  PHP_MSHUTDOWN_FUNCTION(msession)
63  {
64 +#ifdef HAVE_PHP_SESSION
65 +       php_session_unregister_module("msession");
66 +#endif
67         return SUCCESS;
68  }
69  
This page took 0.052579 seconds and 3 git commands to generate.