mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-08 12:34:53 +00:00
FS-9924: Removed extra space in source files
This commit is contained in:
1 parent
60d4e87487
commit
df1ab07ca4
455 files changed
+9699
-9698
No files matched your search
@@ -559,7 +559,7 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu
|
||||
/* Add xml handler global variables */
|
||||
|
||||
Handle<Array> XML_REQUEST = Array::New(isolate, 4);
|
||||
|
||||
|
||||
XML_REQUEST->Set(String::NewFromUtf8(isolate, "key_name"), String::NewFromUtf8(isolate, js_safe_str(xml_handler->key_name)));
|
||||
XML_REQUEST->Set(String::NewFromUtf8(isolate, "key_value"), String::NewFromUtf8(isolate, js_safe_str(xml_handler->key_value)));
|
||||
XML_REQUEST->Set(String::NewFromUtf8(isolate, "section"), String::NewFromUtf8(isolate, js_safe_str(xml_handler->section)));
|
||||
@@ -661,7 +661,7 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu
|
||||
}
|
||||
|
||||
if (xml_handler)
|
||||
{
|
||||
{
|
||||
Local<Value> value = context->Global()->Get(String::NewFromUtf8(isolate, "XML_STRING"));
|
||||
String::Utf8Value str(value);
|
||||
if (strcmp(js_safe_str(*str), "undefined"))
|
||||
@@ -698,7 +698,7 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu
|
||||
#endif
|
||||
}
|
||||
//isolate->Exit();
|
||||
|
||||
|
||||
if (res.length() == 0) {
|
||||
result = -1;
|
||||
} else {
|
||||
@@ -741,16 +741,16 @@ static switch_xml_t v8_fetch(const char *section,
|
||||
if (zstr(xml_handler.XML_STRING)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Result\n");
|
||||
}
|
||||
else if (!(xml = switch_xml_parse_str_dynamic(xml_handler.XML_STRING, SWITCH_TRUE))) {
|
||||
else if (!(xml = switch_xml_parse_str_dynamic(xml_handler.XML_STRING, SWITCH_TRUE))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing XML Result!\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Don't forget to free XML_STRING
|
||||
switch_safe_free(xml_handler.XML_STRING);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
switch_safe_free(mycmd);
|
||||
|
||||
return xml;
|
||||
@@ -919,7 +919,7 @@ SWITCH_STANDARD_JSON_API(json_function)
|
||||
switch_stream_handle_t stream = { 0 };
|
||||
|
||||
if ((data = cJSON_GetObjectItem(json, "data"))) {
|
||||
path = cJSON_GetObjectItem(data, "path");
|
||||
path = cJSON_GetObjectItem(data, "path");
|
||||
}
|
||||
|
||||
if (!(path && data)) {
|
||||
@@ -934,7 +934,7 @@ SWITCH_STANDARD_JSON_API(json_function)
|
||||
switch_safe_free(json_text);
|
||||
|
||||
v8_parse_and_execute(session, (char *) path->valuestring, &stream, NULL, NULL);
|
||||
|
||||
|
||||
*json_reply = cJSON_Parse((char *)stream.data);
|
||||
|
||||
end:
|
||||
@@ -946,7 +946,7 @@ SWITCH_STANDARD_JSON_API(json_function)
|
||||
|
||||
switch_event_destroy(&stream.param_event);
|
||||
switch_safe_free(stream.data);
|
||||
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ JS_COREDB_FUNCTION_IMPL(Exec)
|
||||
}
|
||||
|
||||
/* Evaluate a prepared statement
|
||||
stepSuccessCode expected success code from switch_core_db_step()
|
||||
stepSuccessCode expected success code from switch_core_db_step()
|
||||
return true if step return expected success code, false otherwise
|
||||
*/
|
||||
void FSCoreDB::StepEx(const v8::FunctionCallbackInfo<Value>& info, int stepSuccessCode)
|
||||
@@ -214,7 +214,7 @@ void FSCoreDB::StepEx(const v8::FunctionCallbackInfo<Value>& info, int stepSucce
|
||||
}
|
||||
}
|
||||
|
||||
/* Evaluate a prepared statement, to be used with statements that return data
|
||||
/* Evaluate a prepared statement, to be used with statements that return data
|
||||
return true while data is available, false when done or error
|
||||
*/
|
||||
JS_COREDB_FUNCTION_IMPL(Next)
|
||||
@@ -223,8 +223,8 @@ JS_COREDB_FUNCTION_IMPL(Next)
|
||||
StepEx(info, SWITCH_CORE_DB_ROW);
|
||||
}
|
||||
|
||||
/* Evaluate a prepared statement, to be used with statements that return no data
|
||||
return true if statement has finished executing successfully, false otherwise
|
||||
/* Evaluate a prepared statement, to be used with statements that return no data
|
||||
return true if statement has finished executing successfully, false otherwise
|
||||
*/
|
||||
JS_COREDB_FUNCTION_IMPL(Step)
|
||||
{
|
||||
|
||||
@@ -70,7 +70,7 @@ size_t FSCURL::FileCallback(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
|
||||
HandleScope handle_scope(obj->GetIsolate());
|
||||
Handle<Function> func;
|
||||
|
||||
|
||||
if (!obj->_function.IsEmpty()) {
|
||||
func = Local<Function>::New(obj->GetIsolate(), obj->_function);
|
||||
}
|
||||
|
||||
@@ -227,10 +227,10 @@ JS_DBH_FUNCTION_IMPL(query)
|
||||
|
||||
void *arg = NULL;
|
||||
switch_core_db_callback_func_t cb_func = NULL;
|
||||
|
||||
|
||||
Handle<Function> func = Handle<Function>();
|
||||
|
||||
if (info.Length() > 1)
|
||||
if (info.Length() > 1)
|
||||
func = JSBase::GetFunctionFromArg(info.GetIsolate(), info[1]);
|
||||
|
||||
if (!func.IsEmpty()) {
|
||||
@@ -238,7 +238,7 @@ JS_DBH_FUNCTION_IMPL(query)
|
||||
cb_func = FSDBH::Callback;
|
||||
arg = this;
|
||||
}
|
||||
|
||||
|
||||
if (dbh) {
|
||||
if (!func.IsEmpty()) {
|
||||
if (switch_cache_db_execute_sql_callback(dbh, sql, cb_func, arg, &err) == SWITCH_STATUS_SUCCESS) {
|
||||
|
||||
@@ -62,7 +62,7 @@ Handle<Object> FSDTMF::New(switch_dtmf_t *dtmf, const char *name, JSMain *js)
|
||||
delete obj;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return Handle<Object>();
|
||||
}
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ void FSEventHandler::DoSubscribe(const v8::FunctionCallbackInfo<v8::Value>& info
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
info.GetReturnValue().Set(ret);
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ JS_EVENTHANDLER_FUNCTION_IMPL(UnSubscribe)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
info.GetReturnValue().Set(ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ JS_GLOBAL_FUNCTION_IMPL_STATIC(Include)
|
||||
}
|
||||
switch_safe_free(path);
|
||||
}
|
||||
|
||||
|
||||
info.GetIsolate()->ThrowException(String::NewFromUtf8(info.GetIsolate(), "Failed to include javascript file"));
|
||||
}
|
||||
}
|
||||
@@ -582,7 +582,7 @@ JS_GLOBAL_FUNCTION_IMPL_STATIC(Email)
|
||||
JS_CHECK_SCRIPT_STATE();
|
||||
HandleScope handle_scope(info.GetIsolate());
|
||||
string to, from, headers, body, file, convert_cmd, convert_ext;
|
||||
|
||||
|
||||
if (info.Length() > 0) {
|
||||
String::Utf8Value str(info[0]);
|
||||
to = js_safe_str(*str);
|
||||
@@ -642,7 +642,7 @@ JS_GLOBAL_FUNCTION_IMPL_STATIC(Bridge)
|
||||
if (info.Length() > 1) {
|
||||
if (info[0]->IsObject()) {
|
||||
obj_a = Handle<Object>::Cast(info[0]);
|
||||
|
||||
|
||||
if (!(jss_a = JSBase::GetInstance<FSSession>(obj_a))) {
|
||||
info.GetIsolate()->ThrowException(String::NewFromUtf8(info.GetIsolate(), "Cannot find session A"));
|
||||
return;
|
||||
|
||||
@@ -316,7 +316,7 @@ JS_ODBC_FUNCTION_IMPL(GetData)
|
||||
SQLCHAR name[1024] = "";
|
||||
SQLCHAR *data = _colbuf;
|
||||
SQLLEN pcbValue;
|
||||
|
||||
|
||||
SQLDescribeCol(_stmt, x, name, sizeof(name), &NameLength, &DataType, &ColumnSize, &DecimalDigits, &Nullable);
|
||||
SQLGetData(_stmt, x, SQL_C_CHAR, _colbuf, _cblen, &pcbValue);
|
||||
|
||||
|
||||
@@ -1778,7 +1778,7 @@ JS_SESSION_FUNCTION_IMPL(Bridge)
|
||||
if (info.Length() > 0) {
|
||||
if (info[0]->IsObject()) {
|
||||
obj_b = Handle<Object>::Cast(info[0]);
|
||||
|
||||
|
||||
if (!(jss_b = JSBase::GetInstance<FSSession>(obj_b))) {
|
||||
info.GetIsolate()->ThrowException(String::NewFromUtf8(info.GetIsolate(), "Cannot find session B"));
|
||||
return;
|
||||
|
||||
@@ -39,12 +39,12 @@ FSXML::~FSXML(void)
|
||||
{
|
||||
if (!_rootObject) {
|
||||
/* This is the root object */
|
||||
|
||||
|
||||
/* Free the xml struct if it still exists */
|
||||
if (_xml) {
|
||||
switch_xml_free(_xml);
|
||||
}
|
||||
|
||||
|
||||
/* Free all sub-objects in the hash and destroy the hash */
|
||||
DestroyHash();
|
||||
} else if (_rootObject && _xml && _rootObject->_obj_hash) {
|
||||
@@ -118,7 +118,7 @@ Handle<Value> FSXML::GetJSObjFromXMLObj(const switch_xml_t xml, const v8::Functi
|
||||
} else {
|
||||
rootObj = _rootObject;
|
||||
}
|
||||
|
||||
|
||||
if (!rootObj) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not find XML root node\n");
|
||||
return Handle<Value>();
|
||||
@@ -140,9 +140,9 @@ Handle<Value> FSXML::GetJSObjFromXMLObj(const switch_xml_t xml, const v8::Functi
|
||||
newObj->RegisterInstance(info.GetIsolate(), "", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (newObj) {
|
||||
return newObj->GetJavaScriptObject();
|
||||
return newObj->GetJavaScriptObject();
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to create new object - memory error?\n");
|
||||
@@ -345,7 +345,7 @@ JS_XML_IMPL_STATIC(Remove)
|
||||
JS_CHECK_SCRIPT_STATE();
|
||||
|
||||
FSXML *obj = JSBase::GetInstance<FSXML>(info);
|
||||
|
||||
|
||||
if (obj) {
|
||||
switch_xml_remove(obj->_xml);
|
||||
if (!obj->_rootObject) {
|
||||
|
||||
@@ -98,7 +98,7 @@ const string JSMain::LoadFileToString(const string& filename)
|
||||
JSMain::JSMain(void)
|
||||
{
|
||||
isolate = Isolate::New();
|
||||
|
||||
|
||||
extenderClasses = new vector<const js_class_definition_t *>();
|
||||
extenderFunctions = new vector<js_function_t *>();
|
||||
extenderInstances = new vector<registered_instance_t*>();
|
||||
@@ -178,7 +178,7 @@ const string JSMain::GetExceptionInfo(Isolate* isolate, TryCatch* try_catch)
|
||||
ostringstream ss;
|
||||
|
||||
ss << filename_string << ":" << linenum << ": " << exception_string << "\r\n";
|
||||
|
||||
|
||||
// Print line of source code.
|
||||
String::Utf8Value sourceline(message->GetSourceLine());
|
||||
const char *sourceline_string = js_safe_str(*sourceline);
|
||||
@@ -223,7 +223,7 @@ void JSMain::Include(const v8::FunctionCallbackInfo<Value>& args)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
args.GetReturnValue().Set(Undefined(args.GetIsolate()));
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ void JSMain::Log(const v8::FunctionCallbackInfo<Value>& args)
|
||||
String::Utf8Value str(args[0]);
|
||||
|
||||
printf("%s\r\n", js_safe_str(*str));
|
||||
|
||||
|
||||
args.GetReturnValue().Set(Undefined(args.GetIsolate()));
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ const string JSMain::ExecuteString(const string& scriptData, const string& fileN
|
||||
#endif
|
||||
}
|
||||
//isolate->Exit();
|
||||
|
||||
|
||||
if (resultIsError) {
|
||||
*resultIsError = isError;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user