}
AST_LIST_UNLOCK(&global_curl_info);
- if (chan && (store = ast_channel_datastore_find(chan, &curl_info, NULL))) {
- list = store->data;
- AST_LIST_LOCK(list);
- AST_LIST_TRAVERSE(list, cur, list) {
- if (cur->key == CURLOPT_SPECIAL_HASHCOMPAT) {
- hashcompat = (long) cur->value;
- } else {
- curl_easy_setopt(*curl, cur->key, cur->value);
+ if (chan) {
+ ast_channel_lock(chan);
+ store = ast_channel_datastore_find(chan, &curl_info, NULL);
+ ast_channel_unlock(chan);
+ if (store) {
+ list = store->data;
+ AST_LIST_LOCK(list);
+ AST_LIST_TRAVERSE(list, cur, list) {
+ if (cur->key == CURLOPT_SPECIAL_HASHCOMPAT) {
+ hashcompat = (long) cur->value;
+ } else {
+ curl_easy_setopt(*curl, cur->key, cur->value);
+ }
}
}
}
if (resultslen > len) {
ast_log(LOG_WARNING, "Failed to fetch. Realtime data is too large: need %zu, have %zu.\n", resultslen, len);
+ if (chan) {
+ ast_autoservice_stop(chan);
+ }
return -1;
}
* someones data without giving him the chance to look
* at it. */
ast_log(LOG_WARNING, "Failed to fetch/destroy. Realtime data is too large: need %zu, have %zu.\n", resultslen, len);
+ if (chan) {
+ ast_autoservice_stop(chan);
+ }
return -1;
}
ast_debug(4, "ast_get_txt: Number = '%s', suffix = '%s'\n", number, suffix);
- if (chan && ast_autoservice_start(chan) < 0) {
- return -1;
- }
-
if (pos > 128) {
pos = 128;
}
} else {
ast_copy_string(txt, context.txt, txtlen);
}
- if (chan) {
- ret |= ast_autoservice_stop(chan);
- }
return ret;
}