Date: 08/27/01
- Next message: sniper <email protected>: "[PHP-DEV] Bug #12977 Updated: Unable to load dynamic library 'd:\applications\php\extensions\php_oci8.dll' -"
- Previous message: admin <email protected>: "[PHP-DEV] Bug #12983: crash due to infinite loop"
- In reply to: Jason Greene: "[PHP-DEV] ([PATCH] SOCKETS Solaris issues with gcc) & socket_read issue with new api"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Forgot one thing,
Let me know if you would like me to just apply this patch myself.
I just thought it should be reviewed first.
Thanks,
Jason
----- Original Message -----
From: "Jason Greene" <jason <email protected>>
To: <php-dev <email protected>>; "Chris Vandomelen" <chrisv <email protected>>; <sterling <email protected>>; "Daniel Beulshausen"
<daniel <email protected>>
Sent: Monday, August 27, 2001 1:36 PM
Subject: [PHP-DEV] ([PATCH] SOCKETS Solaris issues with gcc) & socket_read issue with new api
> Sterling,
>
> We had spoke in private correspondence several months ago about
> Solaris compatibility problems with the sockets extension. This basically
> was due to #defines in Solaris's socket header files that rename all socket
> functions to __xnet_##function_name ie. __xnet_socket, etc... This
> only happens if the compile does not support the redefine_extname pragma.
> (The reason for the define hack)
>
> Since you guys have redesigned the API to follow php naming conventions,
> this is no longer an issue with function naming. However, the php_socket
> structure has a member named socket, which causes compilation problems. I
> am sending a simple rename patch that changes this name and all references to
> bsd_socket. ( Could be any name of course, just the most appropriate I could
> come up with ). I aslo changed the php_read function to take a param of
> bsd_socket in place of socket.
>
> While testing I noticed another issue. The new socket_read function returns
> the read data instead of taking it as a parameter. This requires me to use the
> !== operator to verify there is nothing left to be read. Otherwise data could be
> misconstrued as an error.
>
> ie
> what once was
> while (read($socket, $out,100)){
> print $out;
> }
> is now
> while ((out=socket_read($socket, 100)) !== FALSE) {
> print $out;
> }
> This is very cumbersome
>
> The 3rd issue is that the php_read function will return 0 and set errno to 0 on a
> partial read. There probably should be a check for errno 0 and not print an error
> message in this case. I would have included it in this patch, but I assumed that you
> guys might have a better way to solve this problem.
>
>
> -Jason
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: sniper <email protected>: "[PHP-DEV] Bug #12977 Updated: Unable to load dynamic library 'd:\applications\php\extensions\php_oci8.dll' -"
- Previous message: admin <email protected>: "[PHP-DEV] Bug #12983: crash due to infinite loop"
- In reply to: Jason Greene: "[PHP-DEV] ([PATCH] SOCKETS Solaris issues with gcc) & socket_read issue with new api"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

