search for: connection_bad

Displaying 8 results from an estimated 8 matches for "connection_bad".

2010 Mar 25
2
A questions about consume_results (driver-pgsql.c)
Code -------------- static void consume_results(struct pgsql_db *db) { do { if (!PQconsumeInput(db->pg)) break; if (PQisBusy(db->pg)) return; } while (PQgetResult(db->pg) != NULL); if (PQstatus(db->pg) == CONNECTION_BAD) io_remove_closed(&db->io); else io_remove(&db->io); db->querying = FALSE; if (db->queue != NULL && db->connected) queue_send_next(db); } --------------- This is the only part of the driver-pgsql.c code where a CONNECTION_BAD does not result in driver_pgsql...
2004 Oct 05
1
Cannot compile Meetme2
...lared (first use in this function) app_meetme2.c:139: error: `conn' undeclared (first use in this function) app_meetme2.c:140: error: `PGresult' undeclared (first use in this function) app_meetme2.c:140: error: `res' undeclared (first use in this function) app_meetme2.c:153: error: `CONNECTION_BAD' undeclared (first use in this function) app_meetme2.c:164: error: `PGRES_TUPLES_OK' undeclared (first use in this function) app_meetme2.c:180: warning: passing arg 1 of `atoi' makes pointer from integer without a cast app_meetme2.c:181: warning: passing arg 1 of `atoi' makes poi...
2004 Jun 08
1
Meetme2
...app_meetme2.c:143: `result' undeclared (first use in this function) app_meetme2.c:144: `MYSQL_ROW' undeclared (first use in this function) app_meetme2.c:144: parse error before "row" app_meetme2.c:145: `my_ulonglong' undeclared (first use in this function) app_meetme2.c:153: `CONNECTION_BAD' undeclared (first use in this function) app_meetme2.c:164: `PGRES_TUPLES_OK' undeclared (first use in this function) app_meetme2.c:180: warning: passing arg 1 of `atoi' makes pointer from integer without a cast app_meetme2.c:181: warning: passing arg 1 of `atoi' makes pointer from...
2005 Mar 05
2
cant compile app_meetme2
...undeclared (first use in this function) app_meetme2.c:139: error: `res' undeclared (first use in this function) app_meetme2.c:151: warning: implicit declaration of function `PQsetdbLogin' app_meetme2.c:152: warning: implicit declaration of function `PQstatus' app_meetme2.c:152: error: `CONNECTION_BAD' undeclared (first use in this functio n) app_meetme2.c:154: warning: implicit declaration of function `PQerrorMessage' app_meetme2.c:154: warning: format argument is not a pointer (arg 6) app_meetme2.c:155: warning: implicit declaration of function `PQfinish' app_meetme2.c:162: warnin...
2004 Jun 23
0
UPDATE Patch for postgres enabled app_voicemail.c
...st_mutex_t postgreslock; static int sql_init(void) { ast_verbose( VERBOSE_PREFIX_3 "Logging into postgres database: %s\n", dboption); ! /* fprintf(stderr,"Logging into postgres database: %s\n", dboption); */ dbhandler=PQconnectdb(dboption); if (PQstatus(dbhandler) == CONNECTION_BAD) { --- 240,266 ---- #ifdef USEPOSTGRESVM ! PGconn *dbhandler = NULL; char dboption[256]; ast_mutex_t postgreslock; + static void sql_close(void) + { + fprintf (stderr, "postgres closing database\n"); + PQfinish(dbhandler); + } + static int sql_init(void) { + /* + * JMD + * 6/...
2004 Jun 23
0
Patch for postgres enabled app_voicemail.c
...st_mutex_t postgreslock; static int sql_init(void) { ast_verbose( VERBOSE_PREFIX_3 "Logging into postgres database: %s\n", dboption); ! /* fprintf(stderr,"Logging into postgres database: %s\n", dboption); */ dbhandler=PQconnectdb(dboption); if (PQstatus(dbhandler) == CONNECTION_BAD) { --- 240,266 ---- #ifdef USEPOSTGRESVM ! PGconn *dbhandler = NULL; char dboption[256]; ast_mutex_t postgreslock; + static void sql_close(void) + { + fprintf (stderr, "postgres closing database\n"); + PQfinish(dbhandler); + } + static int sql_init(void) { + /* + * JMD + * 6/...
2010 Mar 26
2
Fix for the consume_results leak
...pg); + if (!pgres) return 0; + + PQclear(pgres); + return 1; +} + static void consume_results(struct pgsql_db *db) { do { @@ -255,7 +266,7 @@ if (PQisBusy(db->pg)) return; - } while (PQgetResult(db->pg) != NULL); + } while (more_results(db->pg)); if (PQstatus(db->pg) == CONNECTION_BAD) io_remove_closed(&db->io);
2010 Apr 14
4
PostgreSQL driver supporting [round-robin] load balancing and redundancy [LONG]
...start_pgc_connect(struct multi_pgsql_pgc *pgc) +{ + PGconn *the_pgc; + + dprintf(("%s: %p", __func__, pgc)); + + pgc->pgc = the_pgc = PQconnectStart(pgc->connect_string); + if (!the_pgc) + i_fatal("%s: %p: out of memory", + __func__, pgc); + + if (PQstatus(the_pgc) == CONNECTION_BAD) { + log_pg_error(pgc, __func__, "PQconnectStart"); + pgc->timeout = timeout_add(RECONNECT_DELAY, + restart_pgc_connect, pgc); + return; + } + + pgc->io = io_add(PQsocket(the_pgc), IO_WRITE, + continue_pgc_connect, pgc); +} + +/*** query processing */ +/**** error han...