Compare commits

...

12 Commits

Author SHA1 Message Date
aks 2f2fc3ac4f
Merge 3d4a9133b7 into 5cb74797fe 2025-01-17 16:41:26 +00:00
Aron Podrigal 5cb74797fe
[mod_pgsql] err is now set correctly (dbh:last_error())
New function, `void pgsql_handle_set_error_if_not_set(switch_pgsql_handle_t *handle, char **err)` has been added to mod_pgsql module. This function is now called at several points where an error occurred but *err was not yet set.
2025-01-17 18:51:45 +03:00
aks 3d4a9133b7 cleaning master 2024-12-30 20:11:43 +04:00
aks 028cd9d36e
Merge branch 'signalwire:master' into master 2024-12-30 20:08:00 +04:00
aks 1340dc8ca4 added mod_curl_tts 2024-12-30 19:42:17 +04:00
aks 93d5d3158b new tts modules 2024-10-17 20:14:11 +04:00
aks 88b80e6c94
Merge branch 'signalwire:master' into master 2024-10-16 07:38:34 +04:00
aks efdd971c8f
Merge branch 'signalwire:master' into master 2024-10-13 10:00:24 +04:00
aks c302d6611c
Merge branch 'signalwire:master' into master 2024-09-30 14:31:03 +04:00
aks 68d6e5c6cb
Merge branch 'signalwire:master' into master 2024-09-10 03:53:48 +04:00
aks 187e40df5d
extra parentheses deleted 2024-06-15 04:53:54 +04:00
aks f49f739333 hashtable memset issue fix 2024-06-14 07:06:23 +04:00
4 changed files with 35 additions and 2 deletions

View File

@ -47,6 +47,9 @@ applications/mod_voicemail
#asr_tts/mod_flite
#asr_tts/mod_pocketsphinx
#asr_tts/mod_tts_commandline
#asr_tts/mod_google_tts
#asr_tts/mod_openai_tts
#asr_tts/mod_piper_tts
codecs/mod_amr
#codecs/mod_amrwb
codecs/mod_b64

View File

@ -2137,6 +2137,9 @@ AC_CONFIG_FILES([Makefile
src/mod/asr_tts/mod_flite/Makefile
src/mod/asr_tts/mod_pocketsphinx/Makefile
src/mod/asr_tts/mod_tts_commandline/Makefile
src/mod/asr_tts/mod_google_tts/Makefile
src/mod/asr_tts/mod_openai_tts/Makefile
src/mod/asr_tts/mod_piper_tts/Makefile
src/mod/codecs/mod_amr/Makefile
src/mod/codecs/mod_amrwb/Makefile
src/mod/codecs/mod_b64/Makefile

View File

@ -106,6 +106,22 @@ char * pgsql_handle_get_error(switch_pgsql_handle_t *handle)
return err_str;
}
void pgsql_handle_set_error_if_not_set(switch_pgsql_handle_t *handle, char **err)
{
char *err_str;
if (err && !(*err)) {
err_str = pgsql_handle_get_error(handle);
if (zstr(err_str)) {
switch_safe_free(err_str);
err_str = strdup((char *)"SQL ERROR!");
}
*err = err_str;
}
}
static int db_is_up(switch_pgsql_handle_t *handle)
{
int ret = 0;
@ -553,8 +569,15 @@ switch_status_t pgsql_handle_exec_detailed(const char *file, const char *func, i
goto error;
}
return pgsql_finish_results(handle);
if (pgsql_finish_results(handle) != SWITCH_STATUS_SUCCESS) {
goto error;
}
return SWITCH_STATUS_SUCCESS;
error:
pgsql_handle_set_error_if_not_set(handle, err);
return SWITCH_STATUS_FALSE;
}
@ -630,6 +653,7 @@ done:
pgsql_free_result(&result);
if (pgsql_finish_results(handle) != SWITCH_STATUS_SUCCESS) {
pgsql_handle_set_error_if_not_set(handle, err);
sstatus = SWITCH_STATUS_FALSE;
}
@ -638,6 +662,7 @@ done:
error:
pgsql_free_result(&result);
pgsql_handle_set_error_if_not_set(handle, err);
return SWITCH_STATUS_FALSE;
}
@ -1050,6 +1075,8 @@ switch_status_t pgsql_handle_callback_exec_detailed(const char *file, const char
return SWITCH_STATUS_SUCCESS;
error:
pgsql_handle_set_error_if_not_set(handle, err);
return SWITCH_STATUS_FALSE;
}

View File

@ -126,7 +126,7 @@ hashtable_expand(switch_hashtable_t *h)
realloc(h->table, newsize * sizeof(struct entry *));
if (NULL == newtable) { (h->primeindex)--; return 0; }
h->table = newtable;
memset(newtable[h->tablelength], 0, newsize - h->tablelength);
memset(&newtable[h->tablelength], 0, (newsize - h->tablelength) * sizeof(struct entry*));
for (i = 0; i < h->tablelength; i++) {
for (pE = &(newtable[i]), e = *pE; e != NULL; e = *pE) {
index = indexFor(newsize,e->h);