freeswitch icon indicating copy to clipboard operation
freeswitch copied to clipboard

xml_int/mod_xml_rpc: const compiler errors

Open dilyanpalauzov opened this issue 1 year ago • 2 comments

Closes https://github.com/signalwire/freeswitch/issues/2495.

dilyanpalauzov avatar Jun 22 '24 13:06 dilyanpalauzov

This pull request may introduce an issue with presenting a const where a const is not expected. I am not certain if this is any issue or not (I have not had the time to test both options), but I have made the following patch and figured I should present it in case it is useful and/or the preferred fix (although it is casting pointer types):

diff -Naur freeswitch-1.10.12.pristine/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c freeswitch-1.10.12/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
--- freeswitch-1.10.12.pristine/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c       2024-11-05 19:30:49.844398348 +0000
+++ freeswitch-1.10.12/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c        2024-11-05 19:30:08.446685036 +0000
@@ -359,7 +359,7 @@
 
        err = 686;
 
-       if (!user_attributes(user, domain_name, NULL, NULL, NULL, &allowed_commands)) {
+       if (!user_attributes(user, domain_name, NULL, NULL, NULL, (const char **)(&allowed_commands))) {
                goto end;
        }
 
@@ -944,7 +944,7 @@
                                                        break;
                                                }
 
-                                               ConnRead(r->connP, 2000, NULL, NULL, &readError);
+                                               ConnRead(r->connP, 2000, NULL, NULL, (const char ** const)(&readError));
                                if (readError) {
                                                        succeeded = FALSE;
                                                        free(readError);

Korynkai avatar Nov 05 '24 21:11 Korynkai

What needs to happen to get this merged?

brianmay avatar Jun 05 '25 01:06 brianmay