]> granicus.if.org Git - php/commitdiff
Remove c++ comment
authorFrank M. Kromann <fmk@php.net>
Wed, 25 Apr 2001 19:45:13 +0000 (19:45 +0000)
committerFrank M. Kromann <fmk@php.net>
Wed, 25 Apr 2001 19:45:13 +0000 (19:45 +0000)
Move errormessage when FBExec is not running. This error should not show if we connect through a port number.

ext/fbsql/php_fbsql.c

index 040dc85d52261c0c4412959a2e10058f1daffbf1..8de369785258c59085b88b8e354bcf958af702b2 100644 (file)
@@ -521,12 +521,6 @@ PHPFBLink* phpfbConnect(INTERNAL_FUNCTION_PARAMETERS, char *hostName, char *user
        {
                FBCExecHandler* execHandler = fbcehHandlerForHost(hostName,128);
                list_entry le;
-               if (execHandler == NULL)
-               {
-                       php_error(E_WARNING,"Cannot connect to host '%s'",hostName);
-                       php_error(E_WARNING,fbcehClassErrorMessage());
-//                     return NULL;
-               }
                result = malloc(sizeof(PHPFBLink));
                result->retainCount     = 1;
                result->persistant      = persistant;
@@ -1115,7 +1109,15 @@ PHP_FUNCTION(fbsql_select_db)
                phpLink = phpfbGetLink(FB_SQL_G(linkIndex));
        }
        if (phpLink == NULL) RETURN_FALSE;
-/*     printf("Select db at link %s@%s\n",phpLink->hostName,phpLink->userName); */
+       if (phpLink->execHandler == NULL)
+       {
+               int port = atoi(name);
+               if (port == 0 || port > 64535) {
+                       php_error(E_WARNING,"Cannot connect to FBExec for database '%s'",name);
+                       php_error(E_WARNING,fbcehClassErrorMessage());
+                       RETURN_FALSE;
+               }
+       }
 
        database = phpfbSelectDB(INTERNAL_FUNCTION_PARAM_PASSTHRU,name,phpLink);
        if (database == NULL) RETURN_FALSE;