Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.1.14

Bug #5220 connect() returns in some situations no false
Submitted: 2005-08-27 15:51 UTC
From: dwlnetnl at gmail dot com Assigned: amir
Status: Closed Package: Net_SmartIRC
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2005-08-27 15:51 UTC] dwlnetnl at gmail dot com
Description: ------------ USING DEVELOPMENT VERSION: * $Id: SmartIRC.php,v 1.90 2005/07/01 20:12:25 meebey Exp $ * $Revision: 1.90 $ * $Date: 2005/07/01 20:12:25 $ * SMARTIRC_VERSION: 1.1.0-dev ($Revision: 1.90 $) When reconnecting is set, the connect() functions die()'s when it fails to connect to the requested server. This does correspond to the API documentation, but the connect() function gives a TRUE (boolean) back when it's connected. It has to return a void when respecting the API documentation. My eyes falls on the last if-else control structure, because if you look with an "executing eye" to the code, it is impossible that $result at that time could be FALSE. So with this conclusion, the control structure has no function. It must be replaced with a single "return true;". Here is the diff: 1039c1039 < die(); --- > return false; 1057,1061c1057 < if ($result !== false) { < return true; < } else { < return false; < } --- > return true;

Comments

 [2005-09-13 04:12 UTC] ci-dev at gmx dot de
As far as I read the code, it is possible for $result to be (bool)false at the end: If the current connect attempt fails, but auto-reconnect is enabled and there are still tries "left".
 [2008-02-15 16:32 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!