diff options
| author | Frank M. Kromann <fmk@php.net> | 2001-04-25 19:45:13 +0000 |
|---|---|---|
| committer | Frank M. Kromann <fmk@php.net> | 2001-04-25 19:45:13 +0000 |
| commit | a09c88cb6a259e347268cfa13b0e2ef9c348741e (patch) | |
| tree | a4950089f404b2256f601dfb48aaf672d192a60c /ext/fbsql/php_fbsql.c | |
| parent | 7873ab04b360348c206edf9824671b4ee404e7e5 (diff) | |
| download | php-git-a09c88cb6a259e347268cfa13b0e2ef9c348741e.tar.gz | |
Remove c++ comment
Move errormessage when FBExec is not running. This error should not show if we connect through a port number.
Diffstat (limited to 'ext/fbsql/php_fbsql.c')
| -rw-r--r-- | ext/fbsql/php_fbsql.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c index 040dc85d52..8de3697852 100644 --- a/ext/fbsql/php_fbsql.c +++ b/ext/fbsql/php_fbsql.c @@ -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; |
