1. 26 Aug, 2022 2 commits
    • Dridi Boukelmoune's avatar
      cocci: Apply printf_nofmt.cocci again · b43d539c
      Dridi Boukelmoune authored
      b43d539c
    • Dridi Boukelmoune's avatar
      cocci: Help spatch operate on VMODs · 077ed037
      Dridi Boukelmoune authored
      Successfully tested with a dummy semantic patch:
      
          @@
          idexpression ctx, caller;
          @@
      
          -CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
          +AN(ctx);
           CHECK_OBJ_NOTNULL(caller, DEBUG_CALLER_MAGIC);
          -AN(caller->sub);
          +assert(caller->sub);
      
      I decided to cram all definitions in the existing vdef.h file to keep
      our relatively simple setup. We can add more macros as we learn what
      coccinelle trips over.
      
      Refs f5b0b201
      077ed037
  2. 23 Aug, 2022 2 commits
  3. 16 Aug, 2022 4 commits
  4. 15 Aug, 2022 10 commits
    • Nils Goroll's avatar
      Flexelinting · 373caaf2
      Nils Goroll authored
      After #3515 merge
      
      I do not understand
           Warning 552: Symbol 'vpi_wrk_len' (line 50, file cache/cache_vpi.c) not accessed
      
      It is used for array sizing, so I have silenced the warning.
      373caaf2
    • Nils Goroll's avatar
      Add VCL source information to panics · 4f285262
      Nils Goroll authored
      Now that we have the vpi ref as set by VPI_Count() available via struct
      wrk_vpi, we can dump our position in VCL at the time of the panic.
      
      Additional changes:
      
      * move handling info from pan_wrk() to the new VPI_Panic()
      * output the source index of vcl sources with the name in
        VCL_Panic()
      
      The additional panic section looks like this:
      
      vpi = 0x7f5478be93b0 {
        handling (VCL::return) = 0x0 (none),
        ref = 6,
        vpi_ref = 0x7f54753fb530 {
          source = 0 (\"<vcl.inline>\"),
          offset = 365,
          line = 20,
          pos = 25,
          src = \"vtc.panic(\\\"Had Panic header: \\\" + resp.ht[...]\"
        },
      },
      
      The source line is truncated (and truncation denoted by [...]) if longer
      than 40 characters.
      
      If the in-memory vcl data source string looks truncated, tok = "..." may
      be output instead of src "...".
      4f285262
    • Nils Goroll's avatar
      Give struct vpi_ref a magic · 1ad31020
      Nils Goroll authored
      to be able to use our standard miniobj facilities on it, PAN_dump_struct
      in this case.
      
      As vpi_ref is static const in VGC, there is no real reason for magic
      checks other than that.
      1ad31020
    • Nils Goroll's avatar
      Save VPI_count() info to struct wrk_vpi · 21eb6a17
      Nils Goroll authored
      So we have it available for Panics in a follow-up commit
      21eb6a17
    • Nils Goroll's avatar
      503e231b
    • Nils Goroll's avatar
    • Nils Goroll's avatar
      Give VPI its private struct in the worker · a8483cf5
      Nils Goroll authored
      (struct vrt_ctx).handling is a special animal: As seen by VGC, struct
      vrt_ctx is const (and rightly so), yet VCL needs to have a way to
      communicate up to core code the return value from subs.
      
      So, handling was a (non-const) pointer into struct worker. This is all
      good and well, with the minor drawback that VMODs would get to see it,
      while we should make it very clear that they have to go through
      VRT_handling() / VRT_handled() and know the rules (no reset of
      handling).
      
      As we now want to move also the vpi count into "the ctx", before adding
      another unsigned pointer, we introduce struct wrk_vpi, provided by the
      worker, but owned by vpi.
      
      With this change, we thus formalize the vpi count requirement and also
      remove the handling variable from vmods' direct line of sight.
      
      This commit comprises the manual changes which either could not be or
      were not worth being automated.
      
      The next two commits contain a coccinelle script to do the rest of the
      work, and the reult of it.
      a8483cf5
    • Poul-Henning Kamp's avatar
      Revert last two changes, I totally misunderstood why there are two buffers. · 91e130fe
      Poul-Henning Kamp authored
      Add a comment so nobody makes that mistake again.
      
      Also: Dont trust brain to work in heat-wave.
      91e130fe
    • Poul-Henning Kamp's avatar
      Duh! Monday morning typo. · 7c287edd
      Poul-Henning Kamp authored
      7c287edd
    • Poul-Henning Kamp's avatar
      2aa70ca5
  5. 12 Aug, 2022 1 commit
  6. 10 Aug, 2022 4 commits
  7. 09 Aug, 2022 3 commits
    • Nils Goroll's avatar
      allow bgthreads to terminate for vmod use · 3a22f5f0
      Nils Goroll authored
      3a22f5f0
    • Martin Blix Grydeland's avatar
      Clean up assertions in http_hdr_flags() · 3056e30a
      Martin Blix Grydeland authored
      The input argument assertions and checks in http_hdr_flags() were
      misleading and lacking. With this patch it returns (NULL) on either input
      being NULL, and also when called with an empty string instead of
      asserting.
      3056e30a
    • Martin Blix Grydeland's avatar
      Do not call http_hdr_flags() on pseudo-headers · c5fd097e
      Martin Blix Grydeland authored
      In http_EstimateWS(), all headers are passed to the http_isfiltered()
      function to calculate how many bytes is needed to serialize the entire
      struct http. http_isfiltered() will check the headers for whether they are
      going to be filtered out later and if so skip them.
      
      However http_isfiltered() would attempt to treat all elements of struct
      http as regular headers with an implicit structure. That does not hold for
      the first three pseudo-header entries, which would lead to asserts in
      later steps.
      
      This patch skips the filter step for pseudo-headers.
      
      Fixes: #3830
      c5fd097e
  8. 08 Aug, 2022 1 commit
  9. 05 Aug, 2022 13 commits