]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8706: Fix a segfault where no response status was set previously, and try to preve...
authorEliot Gable <egable@gmail.com>
Mon, 4 Jan 2016 12:46:41 +0000 (12:46 +0000)
committerEliot Gable <egable@gmail.com>
Tue, 5 Jan 2016 11:46:59 +0000 (11:46 +0000)
src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c

index a71726c357dd7c6a1245319f587ee9b8df0cc3c4..3ef840ea87681f3af88593e55941231714a5c70e 100644 (file)
@@ -534,6 +534,7 @@ static abyss_bool http_directory_auth(TSession *r, char *domain_name)
 
                                ResponseAddField(r, "freeswitch-user", (box ? box : user));
                                ResponseAddField(r, "freeswitch-domain", domain_name);
+                               ResponseStatus(r, 200);
                                rval = TRUE;
                                goto done;
                        }
@@ -707,6 +708,11 @@ abyss_bool auth_hook(TSession * r)
        char *domain_name, *e;
        abyss_bool ret = FALSE;
 
+       /* Default to 500 status to avoid assert. It should be
+          overridden later if we actually handle it or if the
+          default handler in abyss handles it. */
+       ResponseStatus(r, 500);
+
        if (globals.enable_websocket && !strncmp(r->requestInfo.uri, "/socket", 7)) {
                // Chrome has no Authorization support yet
                // https://code.google.com/p/chromium/issues/detail?id=123862
@@ -827,6 +833,11 @@ abyss_bool handler_hook(TSession * r)
                return FALSE;
        }
 
+       /* Default to 500 status to avoid assert. It should be
+          overridden later if we actually handle it or if the
+          default handler in abyss handles it. */
+       ResponseStatus(r, 500);
+
        stream.data = r;
        stream.write_function = http_stream_write;
        stream.raw_write_function = http_stream_raw_write;