mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 01:02:12 +00:00
FS-5921 --resolve mod_mongo: use jsonString() instead of toString(), tabs instead of spaces
This commit is contained in:
parent
ad8796f581
commit
381caad87f
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||||
* Copyright (C) 2005-2012, Anthony Minessale II <anthm@freeswitch.org>
|
* Copyright (C) 2005-2013, Anthony Minessale II <anthm@freeswitch.org>
|
||||||
*
|
*
|
||||||
* Version: MPL 1.1
|
* Version: MPL 1.1
|
||||||
*
|
*
|
||||||
@ -82,7 +82,7 @@ SWITCH_STANDARD_API(mongo_mapreduce_function)
|
|||||||
conn->runCommand(conn->nsGetDB(ns), cmd.done(), out);
|
conn->runCommand(conn->nsGetDB(ns), cmd.done(), out);
|
||||||
mongo_connection_pool_put(globals.conn_pool, conn, SWITCH_FALSE);
|
mongo_connection_pool_put(globals.conn_pool, conn, SWITCH_FALSE);
|
||||||
|
|
||||||
stream->write_function(stream, "-OK\n%s\n", out.toString().c_str());
|
stream->write_function(stream, "-OK\n%s\n", out.jsonString().c_str());
|
||||||
} else {
|
} else {
|
||||||
stream->write_function(stream, "-ERR\nNo connection\n");
|
stream->write_function(stream, "-ERR\nNo connection\n");
|
||||||
}
|
}
|
||||||
@ -130,7 +130,7 @@ SWITCH_STANDARD_API(mongo_find_one_function)
|
|||||||
BSONObj res = conn->findOne(ns, Query(query), &fields);
|
BSONObj res = conn->findOne(ns, Query(query), &fields);
|
||||||
mongo_connection_pool_put(globals.conn_pool, conn, SWITCH_FALSE);
|
mongo_connection_pool_put(globals.conn_pool, conn, SWITCH_FALSE);
|
||||||
|
|
||||||
stream->write_function(stream, "-OK\n%s\n", res.toString().c_str());
|
stream->write_function(stream, "-OK\n%s\n", res.jsonString().c_str());
|
||||||
} else {
|
} else {
|
||||||
stream->write_function(stream, "-ERR\nNo connection\n");
|
stream->write_function(stream, "-ERR\nNo connection\n");
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||||
* Copyright (C) 2005-2012, Anthony Minessale II <anthm@freeswitch.org>
|
* Copyright (C) 2005-2013, Anthony Minessale II <anthm@freeswitch.org>
|
||||||
*
|
*
|
||||||
* Version: MPL 1.1
|
* Version: MPL 1.1
|
||||||
*
|
*
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||||
* Copyright (C) 2005-2012, Anthony Minessale II <anthm@freeswitch.org>
|
* Copyright (C) 2005-2013, Anthony Minessale II <anthm@freeswitch.org>
|
||||||
*
|
*
|
||||||
* Version: MPL 1.1
|
* Version: MPL 1.1
|
||||||
*
|
*
|
||||||
@ -103,7 +103,6 @@ switch_status_t mongo_connection_pool_create(mongo_connection_pool_t **conn_pool
|
|||||||
cpool->min_connections = min_connections;
|
cpool->min_connections = min_connections;
|
||||||
cpool->max_connections = max_connections;
|
cpool->max_connections = max_connections;
|
||||||
cpool->conn_str = switch_core_strdup(pool, conn_str);
|
cpool->conn_str = switch_core_strdup(pool, conn_str);
|
||||||
|
|
||||||
cpool->pool = pool;
|
cpool->pool = pool;
|
||||||
|
|
||||||
for (cpool->size = 0; cpool->size < min_connections; cpool->size++) {
|
for (cpool->size = 0; cpool->size < min_connections; cpool->size++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user