[PHP-DEV] Zend resources

2005-09-11 Thread RG
I've created a new module, which is an improvement to the socket library. I however do not plan on re-writing every single function. So I need to find a way to somehow access the socket library's resources. My question is, is there a way to access another module's resource? -- PHP Internals - PHP

Re: [PHP-DEV] Zend resources

2005-09-11 Thread RG
n your extension? --Wez. On 9/11/05, RG <[EMAIL PROTECTED]> wrote: > I've created a new module, which is an improvement to the socket library. I > however do not plan on re-writing every single function. So I need to find a > way to somehow access the socket library's resou

Re: [PHP-DEV] Zend resources

2005-09-11 Thread RG
Yeah I have seen those functions, but they are quite bloated in my opnion. Is there any way of getting the resource id without modifying sockets? "Wez Furlong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On 9/11/05, RG <[EMAIL PROTECTED]> wrote: >

Re: [PHP-DEV] Zend resources

2005-09-13 Thread RG
wow thanks, I'm gonna go and try it out right now and tell you my results ""Sara Golemon"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > static int le_socket = -1; > > > Scratch that, those instances of -1 should have been 0 > (Which is what zend_fetch_list_dtor_id() returns a

Re: [PHP-DEV] Zend resources

2005-09-13 Thread RG
Yep, that did work, thanks a lot -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Zend resources

2005-09-13 Thread RG
n your extension? --Wez. On 9/11/05, RG <[EMAIL PROTECTED]> wrote: > I've created a new module, which is an improvement to the socket library. I > however do not plan on re-writing every single function. So I need to find a > way to somehow access the socket library's resou

[PHP-DEV] Segfault

2005-09-14 Thread RG
This is quite unusual, for some reason PHP segfaults after I call my function. The function deals with Resources from another module, it works, that's not the problem. The functions works exactly as anticipated, however if I call that function again or if I call die or exit PHP segfaults. Any ideas

[PHP-DEV] Re: Segfault

2005-09-15 Thread RG
The following code segfaults after either I call die/exit or call socketi_accept once again. Can anyone spot anything working with it? #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_hello.h" #include #include #include #include #include #include #include #def

[PHP-DEV] Re: Segfault

2005-09-15 Thread RG
For some reason I can't malloc php_socket structs, and that's not where it segfaults. The function works perfectly once. Then if I attempt to exit / die or call that function again, it dies. ""Sara Golemon"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > new_sock->bsd_socket = acc

[PHP-DEV] Re: Segfault

2005-09-15 Thread RG
That's not where it segfaults. The function works perfectly once. If I attempt to exit / die or call that function again, it segfaults. However, I have noticed that if I do not use ZEND_REGISTER_RESOURCE the program no longer segfaults. And sorry for the comments, someone people don't write the fin

[PHP-DEV] Re: Segfault

2005-09-16 Thread RG
Well I did try to use it in RINIT, but PHP just wasn't RINIT so I figured why not put it in MINIT ""Sara Golemon"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > That's not where it segfaults. The function works perfectly once. If I > > attempt to exit / > > die or call that f

[PHP-DEV] Re: Segfault

2005-09-16 Thread RG
Well I did try to use it in RINIT, but PHP just wasn't RINIT so I figured why not put it in MINIT. And I solved the problem, I guess I should have been more careful when reading the PHP API tutorials, I used malloc instead of emalloc, so malloc was causing gcc to miscalculate its size or make i

Re: [PHP-DEV] Re: Segfault

2005-09-17 Thread RG
> both claims above don't make *any* sense to me, making me think > you still really do not know what you are doing :( O_O, wow, sorry... I did not write that like that.. What I meant to say was that I did use zend_fetch_list_dtor_id in RINIT at first, but I noticed that PHP was not calling RI