Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-04-11 Thread Jason Greene

If you look at their socket.h, they have a macro condition in the XPG4 compatibility 
section that
renames all the socket functions to __xnet_whatever. The condition either calls 
#pragma  redefine extname, or #define. #define was
bad in this situation becuase PHP_FUNCTION(socket) would become 
PHP_FUNCTION(__xnet_socket).

What #pragma redefine extname does, is change the name reference after compilation.
So , all references to socket,listen, bind, etc in socket.o, get renamed to the 
corresponding __xnet_
xopen functions.

-Jason




- Original Message -
From: "Andi Gutmans" <[EMAIL PROTECTED]>
To: "Jason Greene" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, April 11, 2001 5:21 PM
Subject: Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c


> Just curious. What does their pragma do?
>
> Andi
>
> At 03:16 AM 4/10/2001 +, Jason Greene wrote:
> >jason   Mon Apr  9 20:16:06 2001 EDT
> >
> >   Modified files:
> > /php4/ext/sockets   sockets.c
> >   Log:
> >   Fix for PR #9729, 9664, 9656, 8667.
> >   All compilers on Solaris should build this extension correctly now.
> >   It turns out the SUN CC, by default, enables a define that enables the
> > use of
> >   #pragma redefine extname in sun header files. This is why cc would work,
> >   and gcc wouldn't.
> >
> >   -Jason
> >
> >
> >Index: php4/ext/sockets/sockets.c
> >diff -u php4/ext/sockets/sockets.c:1.33 php4/ext/sockets/sockets.c:1.34
> >--- php4/ext/sockets/sockets.c:1.33 Thu Mar 22 05:16:58 2001
> >+++ php4/ext/sockets/sockets.c  Mon Apr  9 20:16:05 2001
> >@@ -17,7 +17,7 @@
> > +--+
> >   */
> >
> >-/* $Id: sockets.c,v 1.33 2001/03/22 13:16:58 sniper Exp $ */
> >+/* $Id: sockets.c,v 1.34 2001/04/10 03:16:05 jason Exp $ */
> >
> >  #include "php.h"
> >
> >@@ -34,6 +34,10 @@
> >  #define _XOPEN_SOURCE_EXTENDED
> >  #define _XPG4_2
> >  #define __EXTENSIONS__
> >+
> >+#ifndef __PRAGMA_REDEFINE_EXTNAME
> >+#define __PRAGMA_REDEFINE_EXTNAME
> >+#endif
> >
> >  #include "ext/standard/info.h"
> >  #include "php_sockets.h"
> >
> >
> >
> >--
> >PHP CVS Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-04-11 Thread Andi Gutmans

Just curious. What does their pragma do?

Andi

At 03:16 AM 4/10/2001 +, Jason Greene wrote:
>jason   Mon Apr  9 20:16:06 2001 EDT
>
>   Modified files:
> /php4/ext/sockets   sockets.c
>   Log:
>   Fix for PR #9729, 9664, 9656, 8667.
>   All compilers on Solaris should build this extension correctly now.
>   It turns out the SUN CC, by default, enables a define that enables the 
> use of
>   #pragma redefine extname in sun header files. This is why cc would work,
>   and gcc wouldn't.
>
>   -Jason
>
>
>Index: php4/ext/sockets/sockets.c
>diff -u php4/ext/sockets/sockets.c:1.33 php4/ext/sockets/sockets.c:1.34
>--- php4/ext/sockets/sockets.c:1.33 Thu Mar 22 05:16:58 2001
>+++ php4/ext/sockets/sockets.c  Mon Apr  9 20:16:05 2001
>@@ -17,7 +17,7 @@
> +--+
>   */
>
>-/* $Id: sockets.c,v 1.33 2001/03/22 13:16:58 sniper Exp $ */
>+/* $Id: sockets.c,v 1.34 2001/04/10 03:16:05 jason Exp $ */
>
>  #include "php.h"
>
>@@ -34,6 +34,10 @@
>  #define _XOPEN_SOURCE_EXTENDED
>  #define _XPG4_2
>  #define __EXTENSIONS__
>+
>+#ifndef __PRAGMA_REDEFINE_EXTNAME
>+#define __PRAGMA_REDEFINE_EXTNAME
>+#endif
>
>  #include "ext/standard/info.h"
>  #include "php_sockets.h"
>
>
>
>--
>PHP CVS Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-04-10 Thread Jason Greene

> /usr/src/web/php/php4/ext/standard/url_scanner_ex.re:19: php.h: Permission
Do you have any idea which php.h file is being accessed? That line is simply an 
include,
and this implies you don't have read access to php.h

-Jason

- Original Message -
From: "Derick Rethans" <[EMAIL PROTECTED]>
To: "Jason Greene" <[EMAIL PROTECTED]>
Cc: "Jani Taskinen" <[EMAIL PROTECTED]>; "Sascha Schumann" <[EMAIL PROTECTED]>; "PHP 
Quality Assurance Team Mailing List"
<[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 12:40 PM
Subject: Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c


> On Tue, 10 Apr 2001, Jason Greene wrote:
>
> > Out of those platforms you listed, I have tested this on Linux. I will test 
>FreeBSD today.
> > However, I do not have an OpenBSD box, does anyone out there want to try and
> > build the latest cvs with --enable-sockets on OpenBSD?
>
> The socket part builds fine, but I had a lot of other problems on it
> building PHP:
>
> gcc  -I. -I/home/derick/php4/ext/standard -I/home/derick/php4/main
> -I/home/derick/php4 -I/home/derick/php4/Zend
> -I/home/derick/php4/ext/mysql/libmysql
> -I/home/derick/php4/ext/xml/expat/xmltok
> -I/home/derick/php4/ext/xml/expat/xmlparse -I/home/derick/php4/TSRM
> -DSUPPORT_UTF8 -DXML_BYTE_ORDER=12 -g -O2  -c url_scanner_ex.c && touch
> url_scanner_ex.lo
> /usr/src/web/php/php4/ext/standard/url_scanner_ex.re:19: php.h: Permission
> denied
> *** Error code 1
>
> Stop in /home/derick/php4/ext/standard.
> *** Error code 1
>
> Stop in /home/derick/php4/ext/standard (line 37 of
> /home/derick/php4/build/rules.mk).
> *** Error code 1
>
>
> >
> > Thanks,
> > -Jason
> >
> >
> > ----- Original Message -
> > From: "Jani Taskinen" <[EMAIL PROTECTED]>
> > To: "Jason Greene" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Tuesday, April 10, 2001 5:01 AM
> > Subject: Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c
> >
> >
> > >
> > > Have you tested it on Linux, FreeBSD, OpenBSD... ? :)
> > > If you know for sure it will work on these, go ahead.
> > >
> > > --Jani
> > >
> > > On Mon, 9 Apr 2001, Jason Greene wrote:
> > >
> > > >Everyone,
> > > >
> > > >Can I merge this into the current RC? This should not cause
> > > >any problems.
> > > >
> > > >-Jason
> > > >
> > > >- Original Message -
> > > >From: "Jason Greene" <[EMAIL PROTECTED]>
> > > >To: <[EMAIL PROTECTED]>
> > > >Sent: Monday, April 09, 2001 10:16 PM
> > > >Subject: [PHP-CVS] cvs: php4 /ext/sockets sockets.c
> > > >
> > > >
> > > >> jason Mon Apr  9 20:16:06 2001 EDT
> > > >>
> > > >>   Modified files:
> > > >> /php4/ext/sockets sockets.c
> > > >>   Log:
> > > >>   Fix for PR #9729, 9664, 9656, 8667.
> > > >>   All compilers on Solaris should build this extension correctly now.
> > > >>   It turns out the SUN CC, by default, enables a define that enables the use 
>of
> > > >>   #pragma redefine extname in sun header files. This is why cc would work,
> > > >>   and gcc wouldn't.
> > > >>
> > > >>   -Jason
> > > >>
> > > >>
> > > >> Index: php4/ext/sockets/sockets.c
> > > >> diff -u php4/ext/sockets/sockets.c:1.33 php4/ext/sockets/sockets.c:1.34
> > > >> --- php4/ext/sockets/sockets.c:1.33 Thu Mar 22 05:16:58 2001
> > > >> +++ php4/ext/sockets/sockets.c Mon Apr  9 20:16:05 2001
> > > >> @@ -17,7 +17,7 @@
> > > >> +--+
> > > >>   */
> > > >>
> > > >> -/* $Id: sockets.c,v 1.33 2001/03/22 13:16:58 sniper Exp $ */
> > > >> +/* $Id: sockets.c,v 1.34 2001/04/10 03:16:05 jason Exp $ */
> > > >>
> > > >>  #include "php.h"
> > > >>
> > > >> @@ -34,6 +34,10 @@
> > > >>  #define _XOPEN_SOURCE_EXTENDED
> > > >>  #define _XPG4_2
> > > >>  #define __EXTENSIONS__
> > > >> +
> > > >> +#ifndef __PRAGMA_REDEFINE_EXTNAME
> > > >> +#define __PRAGMA_REDEFINE_EXTNAME
> > > >> +#endif
> > > >>
> > > >>  #include "ext/st

Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-04-10 Thread Jason Greene

Thanks,

-Jason
- Original Message - 
From: "Derick Rethans" <[EMAIL PROTECTED]>
To: "Jason Greene" <[EMAIL PROTECTED]>
Cc: "Jani Taskinen" <[EMAIL PROTECTED]>; "Jason Greene" <[EMAIL PROTECTED]>; 
<[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 11:32 AM
Subject: Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c 


> On Tue, 10 Apr 2001, Jason Greene wrote:
> 
> > Out of those platforms you listed, I have tested this on Linux. I will test 
>FreeBSD today.
> > However, I do not have an OpenBSD box, does anyone out there want to try and
> > build the latest cvs with --enable-sockets on OpenBSD?
> 
> I can test to build it... will do in 5 mins.
> 
> Derick Rethans
> 
> -
> PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED]
>  SRM: Site Resource Manager - www.vl-srm.net
> -
> JDI Media Solutions - www.jdimedia.nl - [EMAIL PROTECTED]
>  Boulevard Heuvelink 102 - 6828 KT Arnhem - The Netherlands
> -
> 
> 


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-04-10 Thread Derick Rethans

On Tue, 10 Apr 2001, Jason Greene wrote:

> Out of those platforms you listed, I have tested this on Linux. I will test FreeBSD 
>today.
> However, I do not have an OpenBSD box, does anyone out there want to try and
> build the latest cvs with --enable-sockets on OpenBSD?

I can test to build it... will do in 5 mins.

Derick Rethans

-
PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED]
 SRM: Site Resource Manager - www.vl-srm.net
-
JDI Media Solutions - www.jdimedia.nl - [EMAIL PROTECTED]
 Boulevard Heuvelink 102 - 6828 KT Arnhem - The Netherlands
-


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-04-10 Thread Jason Greene

Out of those platforms you listed, I have tested this on Linux. I will test FreeBSD 
today.
However, I do not have an OpenBSD box, does anyone out there want to try and
build the latest cvs with --enable-sockets on OpenBSD?

Thanks,
-Jason


- Original Message - 
From: "Jani Taskinen" <[EMAIL PROTECTED]>
To: "Jason Greene" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 5:01 AM
Subject: Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c 


> 
> Have you tested it on Linux, FreeBSD, OpenBSD... ? :)
> If you know for sure it will work on these, go ahead.
> 
> --Jani
> 
> On Mon, 9 Apr 2001, Jason Greene wrote:
> 
> >Everyone,
> >
> >Can I merge this into the current RC? This should not cause
> >any problems.
> >
> >-Jason
> >
> >- Original Message -
> >From: "Jason Greene" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Monday, April 09, 2001 10:16 PM
> >Subject: [PHP-CVS] cvs: php4 /ext/sockets sockets.c
> >
> >
> >> jason Mon Apr  9 20:16:06 2001 EDT
> >>
> >>   Modified files:
> >> /php4/ext/sockets sockets.c
> >>   Log:
> >>   Fix for PR #9729, 9664, 9656, 8667.
> >>   All compilers on Solaris should build this extension correctly now.
> >>   It turns out the SUN CC, by default, enables a define that enables the use of
> >>   #pragma redefine extname in sun header files. This is why cc would work,
> >>   and gcc wouldn't.
> >>
> >>   -Jason
> >>
> >>
> >> Index: php4/ext/sockets/sockets.c
> >> diff -u php4/ext/sockets/sockets.c:1.33 php4/ext/sockets/sockets.c:1.34
> >> --- php4/ext/sockets/sockets.c:1.33 Thu Mar 22 05:16:58 2001
> >> +++ php4/ext/sockets/sockets.c Mon Apr  9 20:16:05 2001
> >> @@ -17,7 +17,7 @@
> >> +--+
> >>   */
> >>
> >> -/* $Id: sockets.c,v 1.33 2001/03/22 13:16:58 sniper Exp $ */
> >> +/* $Id: sockets.c,v 1.34 2001/04/10 03:16:05 jason Exp $ */
> >>
> >>  #include "php.h"
> >>
> >> @@ -34,6 +34,10 @@
> >>  #define _XOPEN_SOURCE_EXTENDED
> >>  #define _XPG4_2
> >>  #define __EXTENSIONS__
> >> +
> >> +#ifndef __PRAGMA_REDEFINE_EXTNAME
> >> +#define __PRAGMA_REDEFINE_EXTNAME
> >> +#endif
> >>
> >>  #include "ext/standard/info.h"
> >>  #include "php_sockets.h"
> >>
> >>
> >>
> >> --
> >> PHP CVS Mailing List (http://www.php.net/)
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >>
> >
> 
> 


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-04-10 Thread Jani Taskinen


Have you tested it on Linux, FreeBSD, OpenBSD... ? :)
If you know for sure it will work on these, go ahead.

--Jani

On Mon, 9 Apr 2001, Jason Greene wrote:

>Everyone,
>
>Can I merge this into the current RC? This should not cause
>any problems.
>
>-Jason
>
>- Original Message -
>From: "Jason Greene" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Monday, April 09, 2001 10:16 PM
>Subject: [PHP-CVS] cvs: php4 /ext/sockets sockets.c
>
>
>> jason Mon Apr  9 20:16:06 2001 EDT
>>
>>   Modified files:
>> /php4/ext/sockets sockets.c
>>   Log:
>>   Fix for PR #9729, 9664, 9656, 8667.
>>   All compilers on Solaris should build this extension correctly now.
>>   It turns out the SUN CC, by default, enables a define that enables the use of
>>   #pragma redefine extname in sun header files. This is why cc would work,
>>   and gcc wouldn't.
>>
>>   -Jason
>>
>>
>> Index: php4/ext/sockets/sockets.c
>> diff -u php4/ext/sockets/sockets.c:1.33 php4/ext/sockets/sockets.c:1.34
>> --- php4/ext/sockets/sockets.c:1.33 Thu Mar 22 05:16:58 2001
>> +++ php4/ext/sockets/sockets.c Mon Apr  9 20:16:05 2001
>> @@ -17,7 +17,7 @@
>> +--+
>>   */
>>
>> -/* $Id: sockets.c,v 1.33 2001/03/22 13:16:58 sniper Exp $ */
>> +/* $Id: sockets.c,v 1.34 2001/04/10 03:16:05 jason Exp $ */
>>
>>  #include "php.h"
>>
>> @@ -34,6 +34,10 @@
>>  #define _XOPEN_SOURCE_EXTENDED
>>  #define _XPG4_2
>>  #define __EXTENSIONS__
>> +
>> +#ifndef __PRAGMA_REDEFINE_EXTNAME
>> +#define __PRAGMA_REDEFINE_EXTNAME
>> +#endif
>>
>>  #include "ext/standard/info.h"
>>  #include "php_sockets.h"
>>
>>
>>
>> --
>> PHP CVS Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>
>


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-04-10 Thread James Moore


>
> Everyone,
>
> Can I merge this into the current RC? This should not cause
> any problems.

What are we doing with the current release right now?
who is having problems and which problems are outstanding??

We have two possible MFH's that people want to do which shouldnt really be
included at this later stage but both are quite important.

We really need to get 4.0.5 out the door so please send a list of any
problems you are aware of or any fixes you feel should be in there so that
they can be reviewed and put in the branch if needed. Today is Tuesday lets
try and get a List by tomorrow and then an RC with any fixes tomorrow night
then two days testing and release on Friday, otherwise release on monday if
there are still unresolved issues.

-James


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-04-09 Thread Jason Greene

Everyone,

Can I merge this into the current RC? This should not cause
any problems.

-Jason

- Original Message - 
From: "Jason Greene" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 09, 2001 10:16 PM
Subject: [PHP-CVS] cvs: php4 /ext/sockets sockets.c 


> jason Mon Apr  9 20:16:06 2001 EDT
> 
>   Modified files:  
> /php4/ext/sockets sockets.c 
>   Log:
>   Fix for PR #9729, 9664, 9656, 8667.
>   All compilers on Solaris should build this extension correctly now.
>   It turns out the SUN CC, by default, enables a define that enables the use of
>   #pragma redefine extname in sun header files. This is why cc would work,
>   and gcc wouldn't.
>   
>   -Jason
>   
>   
> Index: php4/ext/sockets/sockets.c
> diff -u php4/ext/sockets/sockets.c:1.33 php4/ext/sockets/sockets.c:1.34
> --- php4/ext/sockets/sockets.c:1.33 Thu Mar 22 05:16:58 2001
> +++ php4/ext/sockets/sockets.c Mon Apr  9 20:16:05 2001
> @@ -17,7 +17,7 @@
> +--+
>   */
>  
> -/* $Id: sockets.c,v 1.33 2001/03/22 13:16:58 sniper Exp $ */
> +/* $Id: sockets.c,v 1.34 2001/04/10 03:16:05 jason Exp $ */
>  
>  #include "php.h"
>  
> @@ -34,6 +34,10 @@
>  #define _XOPEN_SOURCE_EXTENDED
>  #define _XPG4_2
>  #define __EXTENSIONS__
> +
> +#ifndef __PRAGMA_REDEFINE_EXTNAME
> +#define __PRAGMA_REDEFINE_EXTNAME
> +#endif
>  
>  #include "ext/standard/info.h"
>  #include "php_sockets.h"
> 
> 
> 
> -- 
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-04-09 Thread Jason Greene

jason   Mon Apr  9 20:16:06 2001 EDT

  Modified files:  
/php4/ext/sockets   sockets.c 
  Log:
  Fix for PR #9729, 9664, 9656, 8667.
  All compilers on Solaris should build this extension correctly now.
  It turns out the SUN CC, by default, enables a define that enables the use of
  #pragma redefine extname in sun header files. This is why cc would work,
  and gcc wouldn't.
  
  -Jason
  
  
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.33 php4/ext/sockets/sockets.c:1.34
--- php4/ext/sockets/sockets.c:1.33 Thu Mar 22 05:16:58 2001
+++ php4/ext/sockets/sockets.c  Mon Apr  9 20:16:05 2001
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.33 2001/03/22 13:16:58 sniper Exp $ */
+/* $Id: sockets.c,v 1.34 2001/04/10 03:16:05 jason Exp $ */
 
 #include "php.h"
 
@@ -34,6 +34,10 @@
 #define _XOPEN_SOURCE_EXTENDED
 #define _XPG4_2
 #define __EXTENSIONS__
+
+#ifndef __PRAGMA_REDEFINE_EXTNAME
+#define __PRAGMA_REDEFINE_EXTNAME
+#endif
 
 #include "ext/standard/info.h"
 #include "php_sockets.h"



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-03-22 Thread Jani Taskinen

sniper  Thu Mar 22 05:16:58 2001 EDT

  Modified files:  
/php4/ext/sockets   sockets.c 
  Log:
  Fix bugs: #9920, #9190
  
  
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.32 php4/ext/sockets/sockets.c:1.33
--- php4/ext/sockets/sockets.c:1.32 Sun Feb 25 22:07:16 2001
+++ php4/ext/sockets/sockets.c  Thu Mar 22 05:16:58 2001
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.32 2001/02/26 06:07:16 andi Exp $ */
+/* $Id: sockets.c,v 1.33 2001/03/22 13:16:58 sniper Exp $ */
 
 #include "php.h"
 
@@ -1130,6 +1130,7 @@
if (sock_type->sa_family == AF_UNIX) {
struct sockaddr_un *sa = (struct sockaddr_un *) sock_type;
memset(sa, 0, sizeof(sa_storage)); /* This is safe -> sock_type = 
&sa_storage -> sa = sock_type */
+   sa->sun_family = AF_UNIX;
snprintf(sa->sun_path, 108, "%s", Z_STRVAL_PP(arg1));
ret = bind(Z_LVAL_PP(arg0), (struct sockaddr *) sa, SUN_LEN(sa));
} else if (sock_type->sa_family == AF_INET) {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-04 Thread Derick Rethans

On Fri, 2 Feb 2001, Colin Viebrock wrote:

> I for one would like to see #8839 fixed ... hint, hint Derick! ;)

Gr :)

Derick Rethans

-
  PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED]
-
JDI Media Solutions - www.jdimedia.nl - [EMAIL PROTECTED]
 H.v. Tussenbroekstraat 1 - 6952 BL Dieren - The Netherlands
-



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-03 Thread Andi Gutmans

By the way, often compilers change switch() to if()/else() if they know 
that it would be faster (if you only have like 2 cases) so if the code is 
much nicer you don't need to be too afraid of switch() :)

Andi

At 03:44 PM 2/3/2001 +0200, Boian Bonev wrote:
>hi,
>
>
> > > What do you mean, switch() is expensive?
> > Well, isn't it slower?
>
>perhapse in php switch is slower. in c it sometimes is much faster than
>bunch of if statements. i mean the compiler makes jump tables for
>consequitive values and there are less comparisons etc. just a range check
>and jump.
>
>b.
>
>
>--
>PHP CVS Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-03 Thread Boian Bonev

hi,


> > What do you mean, switch() is expensive?
> Well, isn't it slower?

perhapse in php switch is slower. in c it sometimes is much faster than
bunch of if statements. i mean the compiler makes jump tables for
consequitive values and there are less comparisons etc. just a range check
and jump.

b.


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-02 Thread Colin Viebrock

> Well, sorry if it seemed harsh, but you tried to fix one problem and
> introduced another without really understanding what needed to be done.

True.  I was relying on a fix somebody suggested.  This is also why I
noted in the CVS comments that somebody else should look at this.  I'll
be the first to admit that *I* don't always understand what needs to be
done.

Anyway ...

There is another problem in that (in my opinion at least) there are quite
a number of open bug reports that no one seems to be working on.  Maybe half
of them are < 4.0.4 and should probably just be closed, telling the
submitter
to upgrade and resubmit if their problem persists.

I am willing to do this if people are too busy with other stuff.  But I'm
hoping that someone (or a few people) could start looking through the open
reports and (at least) closing the bogus or fixed ones.

- Colin

I for one would like to see #8839 fixed ... hint, hint Derick! ;)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-02 Thread Andrei Zmievski

On Fri, 02 Feb 2001, Colin Viebrock wrote:
> > Ok, I fixed it.
> 
> Thanks ... although "bogus patch" is kinda harsh, don't you think?  :)

Well, sorry if it seemed harsh, but you tried to fix one problem and
introduced another without really understanding what needed to be done.

-Andrei

Give a man a fish; you have fed him for today.  Teach a man to use
the Net and he won't bother you for weeks.
   -Author unknown

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-02 Thread Colin Viebrock

> Ok, I fixed it.

Thanks ... although "bogus patch" is kinda harsh, don't you think?  :)

- Colin

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-02 Thread Andrei Zmievski

On Fri, 02 Feb 2001, Colin Viebrock wrote:
> I dunno.  If I call the function with:
> 
>   
> 
> I guess it doesn't matter what the port *is* ... it just won't return it.
> Maybe just put if statements around any of the code that references port?

Ok, I fixed it.

-Andrei
* What were the first 15 billion years of the universe like for you? *

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-02 Thread Andrei Zmievski

andrei  Fri Feb  2 13:32:17 2001 EDT

  Modified files:  
/php4/ext/sockets   sockets.c 
  Log:
  Revert bogus patch and fix it properly.
  
  
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.30 php4/ext/sockets/sockets.c:1.31
--- php4/ext/sockets/sockets.c:1.30 Fri Feb  2 12:55:27 2001
+++ php4/ext/sockets/sockets.c  Fri Feb  2 13:32:16 2001
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.30 2001/02/02 20:55:27 cmv Exp $ */
+/* $Id: sockets.c,v 1.31 2001/02/02 21:32:16 andrei Exp $ */
 
 #include "php.h"
 
@@ -857,27 +857,10 @@
int salen = sizeof(php_sockaddr_storage);
int ret;
 
-   switch (ZEND_NUM_ARGS()) {
-   case 3:
-   if (zend_get_parameters_ex(ZEND_NUM_ARGS(), &fd, &addr, &port) 
== FAILURE)
-   WRONG_PARAM_COUNT;
-   break;
-   case 2:
-   if (zend_get_parameters_ex(ZEND_NUM_ARGS(), &fd, &addr) == 
FAILURE)
-   WRONG_PARAM_COUNT;
-   break;
-   MAKE_STD_ZVAL((*port));
-   
-   default:
-   WRONG_PARAM_COUNT;
-   }
-
-/*
if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 3 || 
zend_get_parameters_ex(ZEND_NUM_ARGS(), &fd, &addr, &port) == FAILURE) {
WRONG_PARAM_COUNT;
}
-*/
multi_convert_to_long_ex(ZEND_NUM_ARGS() - 1, fd, port);
convert_to_string_ex(addr);
 
@@ -906,7 +889,8 @@
 
Z_STRVAL_PP(addr) = tmp;
Z_STRLEN_PP(addr) = strlen(tmp);
-   Z_LVAL_PP(port)   = htons(sin->sin_port);
+   if (ZEND_NUM_ARGS() > 2)
+   Z_LVAL_PP(port)   = htons(sin->sin_port);
 
RETURN_LONG(ret);
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-02 Thread Colin Viebrock

> > Well, isn't it slower?
> 
> No, not really.

Ok.
 
> > The goal is to make getpeername() not seg-fault and core dump when
> > I only call it with 2 args. :)
> 
> What should the value of 'port' be by default, then?

I dunno.  If I call the function with:



I guess it doesn't matter what the port *is* ... it just won't return it.
Maybe just put if statements around any of the code that references port?

- Colin




-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-02 Thread Andrei Zmievski

On Fri, 02 Feb 2001, Colin Viebrock wrote:
> Well, isn't it slower?

No, not really.

> The goal is to make getpeername() not seg-fault and core dump when
> I only call it with 2 args. :)

What should the value of 'port' be by default, then?

-Andrei
* Who is Ray and why would we want to selectively trace him? *

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-02 Thread Colin Viebrock

> What do you mean, switch() is expensive?

Well, isn't it slower?

> Uh-uh - can't do that. What is your goal here, if port is not passed, it
> defaults to 0?

The goal is to make getpeername() not seg-fault and core dump when
I only call it with 2 args. :)

- Colin

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-02 Thread Andrei Zmievski

On Fri, 02 Feb 2001, Colin Viebrock wrote:
> cmv   Fri Feb  2 12:55:27 2001 EDT
> 
>   Modified files:  
> /php4/ext/sockets sockets.c 
>   Log:
>   Fix for http://bugs.php.net/bugs.php?id=9082
>   
>   I know switch() is expensive, so someone rewrite this "properly" if you
>   want.

What do you mean, switch() is expensive?

> + switch (ZEND_NUM_ARGS()) {
> + case 3:
> + if (zend_get_parameters_ex(ZEND_NUM_ARGS(), &fd, &addr, &port) 
>== FAILURE)
> + WRONG_PARAM_COUNT;
> + break;
> + case 2:
> + if (zend_get_parameters_ex(ZEND_NUM_ARGS(), &fd, &addr) == 
>FAILURE)
> + WRONG_PARAM_COUNT;
> + break;
> + MAKE_STD_ZVAL((*port));

Uh-uh - can't do that. What is your goal here, if port is not passed, it
defaults to 0?


-Andrei

'Any given program, when running correctly, is obsolete.'
  - First Law of Computer Programming

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-02 Thread Colin Viebrock

cmv Fri Feb  2 12:55:27 2001 EDT

  Modified files:  
/php4/ext/sockets   sockets.c 
  Log:
  Fix for http://bugs.php.net/bugs.php?id=9082
  
  I know switch() is expensive, so someone rewrite this "properly" if you
  want.
  
  
  
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.29 php4/ext/sockets/sockets.c:1.30
--- php4/ext/sockets/sockets.c:1.29 Thu Jan 18 12:49:12 2001
+++ php4/ext/sockets/sockets.c  Fri Feb  2 12:55:27 2001
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.29 2001/01/18 20:49:12 sterling Exp $ */
+/* $Id: sockets.c,v 1.30 2001/02/02 20:55:27 cmv Exp $ */
 
 #include "php.h"
 
@@ -857,10 +857,27 @@
int salen = sizeof(php_sockaddr_storage);
int ret;
 
+   switch (ZEND_NUM_ARGS()) {
+   case 3:
+   if (zend_get_parameters_ex(ZEND_NUM_ARGS(), &fd, &addr, &port) 
+== FAILURE)
+   WRONG_PARAM_COUNT;
+   break;
+   case 2:
+   if (zend_get_parameters_ex(ZEND_NUM_ARGS(), &fd, &addr) == 
+FAILURE)
+   WRONG_PARAM_COUNT;
+   break;
+   MAKE_STD_ZVAL((*port));
+   
+   default:
+   WRONG_PARAM_COUNT;
+   }
+
+/*
if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 3 || 
zend_get_parameters_ex(ZEND_NUM_ARGS(), &fd, &addr, &port) == FAILURE) {
WRONG_PARAM_COUNT;
}
+*/
multi_convert_to_long_ex(ZEND_NUM_ARGS() - 1, fd, port);
convert_to_string_ex(addr);
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-01-18 Thread Sterling Hughes

sterlingThu Jan 18 12:49:13 2001 EDT

  Modified files:  
/php4/ext/sockets   sockets.c 
  Log:
  Fix the proto
  
  
  
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.28 php4/ext/sockets/sockets.c:1.29
--- php4/ext/sockets/sockets.c:1.28 Tue Jan 16 12:37:51 2001
+++ php4/ext/sockets/sockets.c  Thu Jan 18 12:49:12 2001
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.28 2001/01/16 20:37:51 rasmus Exp $ */
+/* $Id: sockets.c,v 1.29 2001/01/18 20:49:12 sterling Exp $ */
 
 #include "php.h"
 
@@ -272,7 +272,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool fd_dealloc(void)
+/* {{{ proto bool fd_dealloc(int set)
De-allocates a file descriptor set */
 PHP_FUNCTION(fd_dealloc)
 {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-01-16 Thread Rasmus Lerdorf

rasmus  Tue Jan 16 12:37:51 2001 EDT

  Modified files:  
/php4/ext/sockets   sockets.c 
  Log:
  Kill some warnings
  
  
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.27 php4/ext/sockets/sockets.c:1.28
--- php4/ext/sockets/sockets.c:1.27 Wed Jan  3 10:06:10 2001
+++ php4/ext/sockets/sockets.c  Tue Jan 16 12:37:51 2001
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.27 2001/01/03 18:06:10 jon Exp $ */
+/* $Id: sockets.c,v 1.28 2001/01/16 20:37:51 rasmus Exp $ */
 
 #include "php.h"
 
@@ -1077,7 +1077,6 @@
 {
zval **error;
const char *buf;
-   char *obuf;
 
if (ZEND_NUM_ARGS() != 1 || 
zend_get_parameters_ex(1, &error) == FAILURE) {
@@ -1333,7 +1332,6 @@
 {
zval **iovec_id;
php_iovec_t *vector;
-   int pos;
 
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &iovec_id) == FAILURE) {
WRONG_PARAM_COUNT;
@@ -2028,9 +2026,8 @@
Creates a pair of indistinguishable sockets and stores them in fds. */
 PHP_FUNCTION(socketpair)
 {
-   zval **domain, **type, **protocol, **fds, **fd;
+   zval **domain, **type, **protocol, **fds;
int ret, fds_ar[2];
-   HashTable *fd_ar;

if (ZEND_NUM_ARGS() != 4 ||
zend_get_parameters_ex(4, &domain, &type, &protocol, &fds) == FAILURE) {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]