Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51577 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70159 invoked from network); 5 Mar 2011 16:16:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Mar 2011 16:16:00 -0000 Received: from [127.0.0.1] ([127.0.0.1:25112]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id DD/C2-54597-0C1627D4 for ; Sat, 05 Mar 2011 11:16:00 -0500 X-Host-Fingerprint: 195.68.251.133 gw-0.mp.inet.t0x.net Received: from [195.68.251.133] ([195.68.251.133:21284] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/60-54597-484527D4 for ; Sat, 05 Mar 2011 10:19:33 -0500 Message-ID: <43.60.54597.484527D4@pb1.pair.com> To: internals@lists.php.net Date: Sat, 05 Mar 2011 16:19:31 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.14) Gecko/20110221 Lightning/1.0b2 Thunderbird/3.1.8 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 195.68.251.133 Subject: [patch] allow socket_[gs]et_options() to work on streams From: vnegrier@optilian.com (Vincent NEGRIER) Hi internals, The goal of this patch is to allow user handling of low level socket options for stream sockets created with stream_socket_*() or fsockopen() functions. I choose to extend the socket_get_options() and socket_set_options() functions and keep the functionality inside the sockets extension so this won't add seldom used "bloat" to streams if built without it. With the patch, these two functions check if their first argument is a stream, and then attempt to cast it to php_sock before trying to fetch it as a socket resource. Patch is here: http://si.kz/php-sockets-stream-options.diff.txt Anyone with karma care to comment / commit ? :) Regards, Vincent