path: root/Makefile
diff options
authorVincent Sanders <>2018-09-29 16:31:09 +0100
committerVincent Sanders <>2018-09-29 16:59:34 +0100
commit7a61c957243f8f4fe4d8b89dc19e90aa98e98a25 (patch)
tree07654ea5fd0d9f676a1323ff34568076ff4e5eb0 /Makefile
parent5b849b1e22f21cf349bee3103af949f62b344d83 (diff)
rewrite form_successful_controls_dom as form_dom_to_data
Trying to reason about error propagation and resource leakage within the form submission code was impossible because of the form_successful_controls_dom function. This function was over six hundred lines long, had twenty six top level local variables and six levels of indent in places. This commit splits it out into thirteen shorter and more obvious functions. The resulting operation is identical except errors are properly propagated (all failures were reported as out of memory) and resource management can be reasoned about. The compiler appears to inline the entirety of the code from form_submit() down excepting a handful of leaf functions. This results in similar code output size as previous implementation. The new implementation has a greater number of variables passed to sub functions than desirable because multiple character sets are required to encode names and values in the multipart data list. However as noted the compiler effectively inlines all these functions so this does not actually become a major problem.
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions