summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/http.c12
-rw-r--r--main/manager.c2
-rw-r--r--main/utils.c4
3 files changed, 13 insertions, 5 deletions
diff --git a/main/http.c b/main/http.c
index cc32b9422..63d91c2b2 100644
--- a/main/http.c
+++ b/main/http.c
@@ -134,7 +134,7 @@ static AST_RWLIST_HEAD_STATIC(uri_redirects, http_uri_redirect);
static const struct ast_cfhttp_methods_text {
enum ast_http_method method;
- const char text[];
+ const char *text;
} ast_http_methods_text[] = {
{ AST_HTTP_UNKNOWN, "UNKNOWN" },
{ AST_HTTP_GET, "GET" },
@@ -145,7 +145,15 @@ static const struct ast_cfhttp_methods_text {
const char *ast_get_http_method(enum ast_http_method method)
{
- return ast_http_methods_text[method].text;
+ int x;
+
+ for (x = 0; x < ARRAY_LEN(ast_http_methods_text); x++) {
+ if (ast_http_methods_text[x].method == method) {
+ return ast_http_methods_text[x].text;
+ }
+ }
+
+ return NULL;
}
const char *ast_http_ftype2mtype(const char *ftype)
diff --git a/main/manager.c b/main/manager.c
index 9b8c9654d..7ce8bba16 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -5693,7 +5693,7 @@ static int auth_http_callback(struct ast_tcptls_session_instance *ser,
struct ast_variable *headers)
{
struct mansession_session *session = NULL;
- struct mansession s = { NULL, };
+ struct mansession s = { .session = NULL, .tcptls_session = ser };
struct ast_variable *v, *params = get_params;
char template[] = "/tmp/ast-http-XXXXXX"; /* template for temporary file */
struct ast_str *http_header = NULL, *out = NULL;
diff --git a/main/utils.c b/main/utils.c
index e67bdea10..eda125127 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -1995,7 +1995,7 @@ int ast_utils_init(void)
*/
int ast_parse_digest(const char *digest, struct ast_http_digest *d, int request, int pedantic) {
int i;
- char *c, key[512], val[512], tmp[512];
+ char *c, key[512], val[512];
struct ast_str *str = ast_str_create(16);
if (ast_strlen_zero(digest) || !d || !str) {
@@ -2007,7 +2007,7 @@ int ast_parse_digest(const char *digest, struct ast_http_digest *d, int request,
c = ast_skip_blanks(ast_str_buffer(str));
- if (strncasecmp(tmp, "Digest ", strlen("Digest "))) {
+ if (strncasecmp(c, "Digest ", strlen("Digest "))) {
ast_log(LOG_WARNING, "Missing Digest.\n");
ast_free(str);
return -1;