1. 04 Feb, 2021 4 commits
  2. 03 Feb, 2021 1 commit
  3. 02 Feb, 2021 6 commits
    • Nils Goroll's avatar
      vcc: teach VCC_SymbolGet() how to be a good partner for life · 5a974c75
      Nils Goroll authored
      In any good relationship, one should be clear about expectations. And
      VCL authors want to know what VCC wants to hear, so tell them.
      
      ;)
      5a974c75
    • Nils Goroll's avatar
      Make v1.vtc vcls syntactically correct · 5f07720a
      Nils Goroll authored
      besides the incorrect bits we want to check for.
      
      Ref c4ec4712
      
      Exposed by #3163
      5f07720a
    • Nils Goroll's avatar
      inline vcc_assert.h in generate.py · 54410f97
      Nils Goroll authored
      as requested by phk.
      
      I found no way to avoid having to escape the backslashes because python,
      even for uninterpolated ''' long strings, sees them as line continuations.
      
      The generated output is identical except for two comments (in the code
      and the code output by the code).
      
      --- ./lib/libvcc/vcc_fixed_token.o.c	2021-02-02 10:40:03.725244373 +0100
      +++ ./lib/libvcc/vcc_fixed_token.c	2021-02-02 10:52:04.921259718 +0100
      @@ -834,10 +834,7 @@
       	    "uct vre **, const char *);\nvoid VPI_re_fini(struct vre *);\n"
       	);
       	VSB_cat(sb, "\n");
      -
      -	/* ../include/vcc_assert.h */
      -
      -	VSB_cat(sb, "/* ---===### include/vcc_assert.h ###===--- */\n\n");
      +	VSB_cat(sb, "/* ---===### vgc asserts (generate.py) ###===--- */\n\n");
       	VSB_cat(sb, "#define assert(e)\t\t\t\t\t\t\t\\\ndo {\t\t\t\t"
       	    "\t\t\t\t\t\\\n\tif (!(e)) {\t\t\t\t\t\t\t\\\n\t\tVPI_Fail(__func"
       	    "__, __FILE__, __LINE__, #e);\t\t\\\n\t}\t\t\t\t\t\t\t\t\\\n"
      54410f97
    • Nils Goroll's avatar
      Trivial refactor of generate.py · 65e68232
      Nils Goroll authored
      to split the output formattings from emit_file() from reading the file
      
      The produced output lib/libvcc/vcc_fixed_token.c is identical
      before/after.
      65e68232
    • Poul-Henning Kamp's avatar
      0d746632
    • Poul-Henning Kamp's avatar
      Whitespace ocd · 9570000b
      Poul-Henning Kamp authored
      9570000b
  4. 01 Feb, 2021 4 commits
    • Nils Goroll's avatar
      assert() for VGC and arm assertions on ctx->method · 88c59685
      Nils Goroll authored
      We wrap VAS_Fail() as VPI_Fail() and add an assert() macro to the
      Varnish Generated C (VGC) code. This assert() definition is basically
      a copy of that in vas.h, but deliberately added to a source file which
      is only used by generate.py for VGC, such that this slightly different
      definition be only visible to VGC.
      
      I also pondered the option to include VCL source information in
      VPI_Fail: By using the information updated by VPI_count(), we could
      have that, but as the assert is, for now, intended only to ensure
      correctness of VCC and core VRT code, I decided against this
      complication.
      
      With assert() in place for VGC, we arm the assertions from
      75acb5cc
      88c59685
    • Nils Goroll's avatar
      Teach coccinelle our favourite macros · edb0ca98
      Nils Goroll authored
      It seems they do not parse attributes and how I read
      --macro-file-builtins they just define them to NIL.
      edb0ca98
    • Nils Goroll's avatar
      Slim struct vrt_ctx by 16 bytes on 64bit · adfac945
      Nils Goroll authored
      How 16, you ask? Consider alignment...
      adfac945
    • Dridi Boukelmoune's avatar
      vcl: Make resp.proto read-only · c4ec4712
      Dridi Boukelmoune authored
      One of the VCL 4.1 changes was to make the protocol read-only, which
      we've successfully done for all variables except resp.proto that
      kept the exact same definition for both 4.0 and 4.1 versions, despite
      having distinct definitions.
      c4ec4712
  5. 31 Jan, 2021 2 commits
  6. 30 Jan, 2021 2 commits
    • Nils Goroll's avatar
      vcc: error check in vcc_walksymbols() for the recursive case · b3f22f4c
      Nils Goroll authored
      Bail out upon first error, as for the non-recursive case.
      b3f22f4c
    • Nils Goroll's avatar
      Add disarmed assertions on ctx->method to vgc · 75acb5cc
      Nils Goroll authored
      in the course of #3163 we want to add a preamble to VCL subs, which,
      ideally, would perform as many checks based on constants as possible.
      
      This is a first step towards such checks: We add a commented-out
      assert() on ctx->method for built-in subs only. To add the same for
      custom subs, we will need the okmask from #3163, for which I would first
      want to coordinate with phk.
      
      Also, I would want to coordinate with him on arming the assertion, as
      there might be a good reason why assert() is not yet defined for vgc (it
      is already used in unused macros, though).
      
      Having assertions would help humans, flexelint and compilers alike. Until
      armed, the assertion helps humans at least.
      
      The resulting vgc looks like this:
      
      void v_matchproto_(vcl_func_f)
      VGC_function_vcl_backend_error(VRT_CTX)
      {
        // assert(ctx->method == (VCL_MET_BACKEND_ERROR));
      
        /* ... from ('Builtin' Line 165 Pos 23) */
      75acb5cc
  7. 29 Jan, 2021 3 commits
  8. 28 Jan, 2021 3 commits
  9. 27 Jan, 2021 1 commit
  10. 26 Jan, 2021 2 commits
  11. 25 Jan, 2021 6 commits
  12. 23 Jan, 2021 4 commits
    • Nils Goroll's avatar
      Fix pan_top() expected magic · c13c71f8
      Nils Goroll authored
      A copy-pasta in 55dffc35 prevented the
      top request from being dumped.
      c13c71f8
    • Nils Goroll's avatar
      Fix privs panic formatting · 75799239
      Nils Goroll authored
      55dffc35 introduced a PAN_dump_struct()
      call, which implies printing '{' and VSB_indent(vsb, 2). Fix missing '}'
      and wrong indentation.
      
      Also remove redundant "priv" output, which now happens in PAN_dump_struct()
      
      Diff best viewed ignoring whitespace (-b option).
      75799239
    • Nils Goroll's avatar
      Stabilize v51.vtc · 4bb1a118
      Nils Goroll authored
      This test fails constantly now on vtest arm / Freebsd 13.0 for timeout.
      
      As vcl compilations are probably the most expensive operations of vtcs,
      we speed up this test by reducing the number of vcls loaded from 19 to
      11. We do this by collapsing all of the client side failure tests into a
      single vcl. Being at it, we also reduce logexpect synchronization points.
      
      The number of vcl loads could be reduced further by also collapsing the
      backend side, but as this would reduce clarity more than for the client
      side alone, I first wanted to see if this first step brings down tuntime
      enough.
      4bb1a118
    • Nils Goroll's avatar
      Polish 50780f30 · a2c85e39
      Nils Goroll authored
      Do not overwrite an already latched errno.
      
      Note that it does not make any difference at the moment because we only
      ever use ENOMEM
      
      Ref #3502
      a2c85e39
  13. 22 Jan, 2021 2 commits
    • Nils Goroll's avatar
      Tigthen #1637 testcase · c7523b63
      Nils Goroll authored
      This is similar to #3502, but the out-of-storage condition happens after
      the object has been created successfully.
      
      Use a logexpect to ensure we test as intended.
      c7523b63
    • Nils Goroll's avatar
      Fix object access in ESI VFP when there is no object · 50780f30
      Nils Goroll authored
      We set up fetch filters (VFPs) before initializing a storage object to
      fetch into. If that fails, we close the filters again.
      
      The esi_gzip VFP interacts with the storage object and was missing
      error handling for the case of a teardown with no storage object.
      
      Implementation:
      
      We make sure that for the VFP_ERROR case, we do not interact with the
      storage object (which makes no sense if that is going to be C-4'ed any
      moment).
      
      vfp_vep_callback() keeps its hands off if (struct vef_priv).error is
      set, so we use that to avoid complications in the code.
      50780f30