1. 18
  1.  

  2. 4

    I know the point of the post is to show how you could go about working on an unfamiliar code base, but I thought I would mention that Nginx already is able to returning a plain string in a response using the return statement: http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#return.

    Perhaps it would be interesting as a follow up to see how it implements the functionality and if it uses some higher-level methods to do it?

    1. 1

      Oh nice, thanks! I should have remembered this. Yes that could be good to look into.

    2. 3

      Run make -j to compile using all cores.

      Noooo, don’t do this. Run make -j 16 (or however many threads you’ve got). Bare make -j will run with maximum parallelism, so eg if you have 200 source files, and 16 threads, it will start 200 compiler processes at once, and start time slicing them back and forth (and you may run out of ram and start swapping too).

      1. 2

        Ah! Thanks for that!

      2. 3

        The hassle with getting it to build felt like building up to comedy; “don’t be afraid of hacking, let’s dig in” and some six hours of googling-for-folklore later just giving up! And throughout, the cynical humor felt just around the corner ;)

        Liked it better this way, thanks, and looking at these codebases is encouraged :)

        1. 2

          There was a six hour period or so where I couldn’t find the right place to inject in the response, bunch of segfaults and or just unfilled out fields. I got super annoyed. 😂 By the time I had a better idea it was too far along for me to document all those mistakes. But I did call out this part took a few hours.