Skip to content

[#94][#109][#116] More maintainable M & misc

Sam Habiel requested to merge shabiel/YDB-Web-Server:mws109-refactor into master

Convert the entire source base to expand M language keywords, use lowercase variables and lowercase entrypoints. The exception is that various HTTP* variables used by end user applications that use the web server are alaised to their lower case versions so that end users that prefer to use the uppercase HTTP* variables for clarity's sake can continue to do so.

Bump version to 4.0.0 as public APIs that were avaiable previously in uppercase versions have now been removed.

The HTTP variables available for end user applications are:

  • Input: HTTPREQ/httpreq
  • Input: HTTPARGS/httpargs
  • Input: HTTPHASUSERS/httphasusers
  • Input: HTTPREADWRITE/httpreadwrite
  • Output: HTTPRSP/httprsp
  • Output: HTTPLOC/httploc
  • Output: HTTPERR/httperr

Misc stuff that got changed

  • [#116 (closed)] Remove --tls option in favor of --tlsconfig config-name. --tls supported using the system's Certificate Authority list vs the named configuration. I found this to be too complex, and thought better of it, so decided to keep it simple and symmetrical for end users. Now, it's --tlsconfig server to start, and --tlsconfig client to stop. When YDBEncrypt#6 get fixed, it would be nice if they both can use the same entry.
  • [#94 (closed)] Create entry points; moved the original ones out of %ydbwebreq
    • stdout^%ydbwebutils(msg) to print debugging data to Standard Output
    • stdoutzw^%ydbwebutils(variable) to zwrite a variable to Standard Output
  • Some variables were only used briefly from httpoptions array. Instead of making them their own variables, we just use the httpoptions values directly.
  • Add single stepping debugging, activated by --log 4. This is experiemental right now, as it breaks responses, but I have found it to be quite useful.
  • Single run debugging option --debug now takes an argument, which is a place to break. --debug respond^%ydbwebrsp makes the server stop at respond^%ydbwebrsp.
  • Remove STARTUPZUT (it wasn't used after switch to libsodium).
  • Change variable DIRECTORY to httpdirectory.
  • Convert some non Z functions to Z functions; but some stuff broke, and it will be a harder change to ensure that everything is handled correctly. Created #126 for that issue.
  • tUppercase test added to verify that uppercase HTTP variables still work, but it only uses two of them: HTTPARGS and HTTPRSP.

This MR has been tested with YDBGUI; after some initial failures, it's now shown to work correctly, and all tests now pass.

Merge request reports