Oops. I did not know that the system only accepts text/plain
attachments. Here is the attachment for TSRM diff. This is in
text format. I will send the diff for the whole project soon.
Thanks,
Ananth.
>>> Derick Rethans <[EMAIL PROTECTED]> 1/29/2004 5:26:01 PM >>>
On Thu, 29 Jan 2004, Ananth Kesari wrote:
> Our changes are spread across many files, so I am not sure if we can
> checkin at this stage of the release of PHP 5.0. Anyway, I have
> attached the diff file for TSRM. Please review the same and give me
> your comments. There are similar changes in other files. If you
think
> I should send across the diffs for other files also, then I will do
> so. Let me know.
Just make *one* diff against latest CVS of all changes? And you didn't
add an attachment (we only accept text/plain attachments here).
> In the meantime, I have a question. I am interested in contributing
> to the Open source PHP. I was thinking that the good way to start
> could be to begin working on some simple defects and fix them.
> Can you let me know if I can do that and if yes, how? I mean,
> where to look for the defects filed and what is the procedure to
> start fixing them?
Have a look at bugs.php.net, there are plenty of open bugs.
regards,
Derick
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Index: ./tsrm/TSRM.c
===================================================================
RCS file: /repository/TSRM/TSRM.c,v
retrieving revision 1.55
diff -r1.55 TSRM.c
108a109,120
> #ifdef NETWARE
> /* Anantha Kesari
> * For NetWare we have made it such a way that TSRM is started twice when
> * Apache 2 is reloaded. When Apache2 is restarted, TSRM is started only once.
> * Due to this, pthread_key_create is called twice. First time when TSRM
> * is unloaded, the value associated with the key doesn't get cleared properly
> * though the value itself is freed up. So for safety, the pthread_setspecific
> * call below clears this value every time the key is created. Without this
> call,
> * Apache 2.0 would crash even when it is loading.
> */
> pthread_setspecific(tls_key, 0);
> #endif
297,305d308
< #ifdef NETWARE
< /* The below if loop is added for NetWare to fix an abend while unloading PHP
< * when an Apache unload command is issued on the system console.
< * While exiting from PHP, at the end for some reason, this function is called
< * with tsrm_tls_table = NULL. When this happened, the server abends when
< * tsrm_tls_table is accessed since it is NULL.
< */
< if(tsrm_tls_table) {
< #endif
368,370d370
< #ifdef NETWARE
< } /* if(tsrm_tls_table) */
< #endif
437,443d436
< #elif defined(NETWARE)
< /* There seems to be some problem with the LibC call: NXThreadGetId().
< * Due to this, the PHPMyAdmin application is abending in PHP calls.
< * Used the call, kCurrentThread instead and it works fine.
< */
< /* return NXThreadGetId(); */
< return kCurrentThread();
453a447,460
> #elif defined(NETWARE)
> /* Anantha Kesari. 20 Aug 2003.
> *
> * Apache 1.3 is Clib based and it creats the threads using Clib calls.
> * PHP is LibC based and so here also we should use the Clib calls to
> * get the ID for these threads. If not, there will be a mismatch in the
> * threads created and its usage. This will lead to abend when complex scripts
> * are run and also when multiple scripts are run simulataneously.
> */
> #ifdef APACHE_2_BUILD
> return NXThreadGetId();
> #else
> return kCurrentThread();
> #endif
464,471d470
< #ifdef NETWARE
< #ifndef USE_MPK
< /* To use the Recursive Mutex Locking of LibC */
< long flags = NX_MUTEX_RECURSIVE;
< NXHierarchy_t order = 0;
< NX_LOCK_INFO_ALLOC (lockInfo, "PHP-TSRM", 0);
< #endif
< #endif
476,481d474
< #elif defined(NETWARE)
< #ifdef USE_MPK
< mutexp = kMutexAlloc((BYTE*)"PHP-TSRM");
< #else
< mutexp = NXMutexAlloc(flags, order, &lockInfo);
< #endif
493a487,497
> #elif defined(NETWARE)
> #ifdef USE_MPK
> mutexp = kMutexAlloc((BYTE*)"PHP-TSRM");
> #else
> /* To use the Recursive Mutex Locking of LibC */
> long flags = NX_MUTEX_RECURSIVE;
> NXHierarchy_t order = 0;
> NX_LOCK_INFO_ALLOC (lockInfo, "PHP-TSRM", 0);
>
> mutexp = NXMutexAlloc(flags, order, &lockInfo);
> #endif
513,518d516
< #elif defined(NETWARE)
< #ifdef USE_MPK
< kMutexFree(mutexp);
< #else
< NXMutexFree(mutexp);
< #endif
529a528,533
> #elif defined(NETWARE)
> #ifdef USE_MPK
> kMutexFree(mutexp);
> #else
> NXMutexFree(mutexp);
> #endif
548,553d551
< #elif defined(NETWARE)
< #ifdef USE_MPK
< return kMutexLock(mutexp);
< #else
< return NXLock(mutexp);
< #endif
563a562,567
> #elif defined(NETWARE)
> #ifdef USE_MPK
> return kMutexLock(mutexp);
> #else
> return NXLock(mutexp);
> #endif
579,584d582
< #elif defined(NETWARE)
< #ifdef USE_MPK
< return kMutexUnlock(mutexp);
< #else
< return NXUnlock(mutexp);
< #endif
594a593,598
> #elif defined(NETWARE)
> #ifdef USE_MPK
> return kMutexUnlock(mutexp);
> #else
> return NXUnlock(mutexp);
> #endif
Index: ./tsrm/TSRM.h
===================================================================
RCS file: /repository/TSRM/TSRM.h,v
retrieving revision 1.43
diff -r1.43 TSRM.h
44a45,50
> #elif defined(GNUPTH)
> # include <pth.h>
> #elif defined(PTHREADS)
> # include <pthread.h>
> #elif defined(TSRM_ST)
> # include <st.h>
52,57d57
< #elif defined(GNUPTH)
< # include <pth.h>
< #elif defined(PTHREADS)
< # include <pthread.h>
< #elif defined(TSRM_ST)
< # include <st.h>
69,75d68
< #elif defined(NETWARE)
< # define THREAD_T NXThreadId_t
< #ifdef USE_MPK
< # define MUTEX_T MUTEX
< #else
< # define MUTEX_T NXMutex_t *
< #endif
90a84,90
> #elif defined(NETWARE)
> # define THREAD_T NXThreadId_t
> #ifdef USE_MPK
> # define MUTEX_T MUTEX
> #else
> # define MUTEX_T NXMutex_t *
> #endif
Index: ./tsrm/acconfig.h
===================================================================
RCS file: /repository/TSRM/acconfig.h,v
retrieving revision 1.3
diff -r1.3 acconfig.h
0a1,22
> /* Anantha Kesari. 20 Aug 2003.
> *
> * Define PTHREADS only for Apache 2 and not for Apache 1.3.
> * This is because the former is LibC based and everything works fine in that case.
> * The latter is Clib based and so the thread calls will change if we use PTHREADS
> * and the server abends if we use PTHREADS in PHP for Apache 1.3.
> *
> * Explanation:
> *
> * In the case of Apache 1.3, pthread_self always returns 0 due to mismatch in
> * the function calls used to create the treads and getting the IDs for them.
> * (Threads are created by Apache 1.3 using Clib calls whereas LibC's PTHREAD call
> * is used to get the ID for these threads).
> * Now, using this thread specific ID returned by pthread_self, we store some
> * thread specific data into different hash tables. When we execute multiple scripts
> * simultaneously, since the ID is always 0, one thread reads/writs data from/into
> * another thread's data area.
> * This causes the server to abend.
> */
> #ifdef APACHE_2_BUILD
> #define PTHREADS
> #else
1a24
> #endif
Index: ./tsrm/tsrm_virtual_cwd.c
===================================================================
RCS file: /repository/TSRM/tsrm_virtual_cwd.c,v
retrieving revision 1.60
diff -r1.60 tsrm_virtual_cwd.c
45d44
< /*#include "pipe.h"*/
103,106c102,107
< /* NetWare has strtok() (in LibC) and allows both slashes in paths, like Windows --
< but rest of the stuff is like Unix */
< /* strtok() call in LibC is abending when used in a different address space -- hence
using
< PHP's version itself for now */
---
> /* NetWare has strtok() (in LibC) and allows both slashes in paths, like Windows.
> * But rest of the stuff is like Unix
> */
> /* strtok() call in LibC is abending when used in a different address space.
> * Hence using PHP's version itself for now
> */
142,143c143,144
<
< static int php_is_dir_ok(const cwd_state *state)
---
>
> static int php_is_dir_ok(const cwd_state *state)
145c146,148
< #if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
---
> #if (defined(NETWARE) && defined(CLIB_STAT_PATCH))
> struct stat_libc buf;
> #else
146a150
> #endif
149,153d152
< #else
< struct stat_libc buf;
<
< if (stat(state->cwd, (struct stat*)(&buf)) == 0 && S_ISDIR(buf.st_mode))
< #endif
161c160,162
< #if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
---
> #if (defined(NETWARE) && defined(CLIB_STAT_PATCH))
> struct stat_libc buf;
> #else
162a164
> #endif
165,169d166
< #else
< struct stat_libc buf;
<
< if (stat(state->cwd, (struct stat*)(&buf)) == 0 && S_ISREG(buf.st_mode))
< #endif
375a373,375
> #elif defined(NETWARE)
> } else if (IS_SLASH(path_copy[0])) {
> copy_amount = 4; /* This is the size of the string "sys:" which
> is 4 */
696c696,698
< #if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
---
> #if (defined(NETWARE) && defined(CLIB_STAT_PATCH))
> CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC)
> #else
697a700
> #endif
710,724d712
< #else
< CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC)
< {
< cwd_state new_state;
< int retval;
<
< CWD_STATE_COPY(&new_state, &CWDG(cwd));
< virtual_file_ex(&new_state, path, NULL, 1);
<
< retval = stat(new_state.cwd, (struct stat*)buf);
<
< CWD_STATE_FREE(&new_state);
< return retval;
< }
< #endif
814,815c802,803
< /* On NetWare, the trick of prepending "cd cwd; " doesn't work so we need to perform
< a VCWD_CHDIR() and mutex it
---
> /* On NetWare, the trick of prepending "cd cwd;" doesn't work.
> * So we need to perform a VCWD_CHDIR() and mutex it.
Index: ./tsrm/tsrm_virtual_cwd.h
===================================================================
RCS file: /repository/TSRM/tsrm_virtual_cwd.h,v
retrieving revision 1.42
diff -r1.42 tsrm_virtual_cwd.h
144,146c144
< #if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
< CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC);
< #else
---
> #if (defined(NETWARE) && defined(CLIB_STAT_PATCH))
147a146,147
> #else
> CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC);
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php