[Olsr-dev] [PATCH v1 00/44] jsoninfo/txinfo cleanup series

Ferry Huberts (spam-protected)
Fri Nov 27 10:42:53 CET 2015


From: Ferry Huberts <(spam-protected)>

This series is working towards making jsoninfo and txtinfo look as much
identical as possible again, since jsoninfo started out as a copy of
txtinfo. This work is not complete yet.
Once complete, both plugins can be 'merged' into common code that they share.

Most of the series is basic cleanup but there are a few significant changes:

16/44: The sent information is reordered (remember that you should not depend
       on screen scraping?)
18/44: txtinfo now also has a httpheaders configuration parameter,
       true by default to preserve behaviour
19/44: txtinfo now sends spec compliant http headers
20/44: txtinfo sends HTTP/1.1 headers
27/44: txtinfo now sends gateways, interfaces, 2hop and sgw too when 'all'
       is requested
32/44: jsoninfo now uses the set_plugin_boolean function instead of its own
38/44: jsoninfo now limits the number of in-flight connection like txtinfo,
       preventing buffer overflows
41/44] jsoninfo now sends a proper content type 'text/plain' for '/olsr.conf'
       when http headers are turned on

Feedback welcome.


Ferry Huberts (44):
  txtinfo: format code
  txtinfo: use the same c-basic-offset: 2 as jsoninfo
  txtinfo: simplify an ifdef
  txtinfo: simplify some string comparisons
  txtinfo: simplify some send_what checks
  txtinfo: use a define for the plugin name
  txtinfo: rename some functions
  txtinfo: use defines for some variables
  txtinfo: use a define to rename TXTINFO_ALLOW_LOCALHOST
  txtinfo: rename some SIW_x flags
  txtinfo: move ipc_print_mid function up a bit
  txtinfo: move ipc_print_gateways function up a bit
  txtinfo: move ipc_print_version function up a bit
  txtinfo: rename txtinfo_write_data function
  txtinfo: use the plugin name in a malloc call
  txtinfo: re-order the sent information
  txtinfo: simplify some comparisons
  txtinfo: add httpheaders configuration parameter
  txtinfo: http headers must use \r\n line endings
  txtinfo: use HTTP/1.1
  txtinfo: use a bigger (2 CPU pages) initial buffer
  txtinfo: renumber SIW_x defines and put them in 'groups'
  txtinfo: the configuration is a special case
  txtinfo: send everything on an unknown option
  txtinfo: some more formatting
  txtinfo: remove superfluous forward declarations
  txtinfo: expand SIW_RUNTIME_ALL to include all runtime information
  txtinfo: remove personal copyrights, just check the git log
  jsoninfo: use a define for the plugin name
  jsoninfo: use defines for some variables
  jsoninfo: use a define to rename TXTINFO_ALLOW_LOCALHOST
  jsoninfo: use the set_plugin_boolean function
  jsoninfo: initialise outbuffer_count
  jsoninfo: update some comments
  jsoninfo: move some functions around
  jsoninfo: use the plugin name in a malloc call
  jsoninfo: use a smaller (2 CPU pages) initial buffer
  jsoninfo: limit the number of in-flight connection to 3, like txtinfo
  jsoninfo: rename a function
  jsoninfo: more formatting
  jsoninfo: fix content type of http headers for /olsr.conf
  jsoninfo: remove personal copyrights, just check the git log
  jsoninfo: move some variables around
  jsoninfo: move json support functions into their own file

 lib/jsoninfo/src/olsrd_jsoninfo.c                  | 336 +++-------
 lib/jsoninfo/src/olsrd_jsoninfo.h                  |   2 -
 lib/jsoninfo/src/olsrd_jsoninfo_helpers.c          | 220 +++++++
 .../{olsrd_jsoninfo.h => olsrd_jsoninfo_helpers.h} |  59 +-
 lib/jsoninfo/src/olsrd_plugin.c                    |  15 +-
 lib/txtinfo/README_TXTINFO                         |   3 +
 lib/txtinfo/src/olsrd_plugin.c                     |  33 +-
 lib/txtinfo/src/olsrd_txtinfo.c                    | 680 ++++++++++-----------
 lib/txtinfo/src/olsrd_txtinfo.h                    |   2 +-
 9 files changed, 680 insertions(+), 670 deletions(-)
 create mode 100644 lib/jsoninfo/src/olsrd_jsoninfo_helpers.c
 copy lib/jsoninfo/src/{olsrd_jsoninfo.h => olsrd_jsoninfo_helpers.h} (63%)

-- 
2.5.0




More information about the Olsr-dev mailing list