Commit 1da807d
authored
Rework fldigixmlrpc code (Tlf#467)
* reset connerr in fldigi_toggle()
after a toggle we shall start from a fresh state
no extra method is needed as this is done implicitly
in changepars refreshbp can be dropped, it's done later in the code
* wait a bit after :FLDigi in changepars.c
in order to see the current setting
* move 'xmlrpc_env env' to fldigi_xmlrpc_init()
it is used there locally for error reporting
* use xmlrpc_release() for both failed init and cleanup
* extend xmlrpc_res_init() and use it in fldigi_xmlrpc_query()
* earlier exit from fldigi_xmlrpc_query() if not use_fldigi
* extract build_param_array() from fldigi_xmlrpc_query()
in order to reduce complexity
also check DECREFs
* use constant from xmlrpc lib
* take early exit on connerr
to reduce indentation
* use own xmlrpc_env in fldigi_xmlrpc_query()
used for internal error reporting anyway, no need to pass it by the caller
* return error on failed init
* allow void call for fldigi_xmlrpc_query()
and use xmlrpc_res_free() to free result
* reduce indent in fldigi_get_log_call() and fldigi_get_log_serial_number()
* extract parse_call_result()
* switch to "private" xmlrpc client mode
The problem is that the xmlrpc_client_call_server_params()
or other function using the "global" client mode return
a non-initialized result pointer (a local variable containing garbage)
in case of some error situations.
This makes impossible to decide whether the result should be free'd or not.
The xmlrpc documentation contains no hint on this.
The "private" functions on the other can use a pointer passed by the caller,
so in this case if the initial NULL is untouched then it hasn't been allocated
yet, hence no free'ing is needed.
* switch to standard XML-RPC format specification
* make mutexes static
* fldigi: set rig mode/freq only if needed
* define xmlrpc_res only if xmlrpc is in use
* fldigixmlrpc.c: make locals static and protect them with #if HAVE_LIBXMLRPC
* poll Fldigi less frequently (10 times per sec)
* rework fldigi_get_log_call
- optimize fldigi polling
- reuse valid_call_char() from callinput.c
* move UI code out of fldigi_get_log_call()
* change thiscall to a boolean flag
* rework fldigi_get_log_serial_number()
- it now allows slash (/) also; this can be fixed later if it makes problems
* change fldigi_set_callfield to bool
* clarify :miniterm feature in man page1 parent 2af6a5f commit 1da807d
6 files changed
Lines changed: 368 additions & 283 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
| |||
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
126 | | - | |
| 125 | + | |
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
655 | | - | |
656 | 655 | | |
657 | 656 | | |
658 | 657 | | |
659 | 658 | | |
660 | 659 | | |
| 660 | + | |
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
| |||
0 commit comments