1. 30 Aug, 2022 7 commits
  2. 29 Aug, 2022 11 commits
  3. 26 Aug, 2022 5 commits
    • Dridi Boukelmoune's avatar
      cocci: Make isomorphisms actually work · dab8e4ac
      Dridi Boukelmoune authored
      It turns out declaring typedefs in coccinelle works better with the
      typedef keyword. Reusing the same keyword for the same purposes seems
      so obvious in hindsight.
      
      What happened before was that a generic type would be created, making
      VCL_BOOL or VCL_VOID match virtually any type, completely defeating
      the isomorphism purpose. With this out of the way, we can actually
      resume the effort of adding more typedefs.
      
      To summarize:
      
      - we should declare a typedef as an isomorphism
      - we should define macros as such
      
      I'm considering renaming tools/coccinelle/vdef.h to varnish.h to match
      the varnish.iso file name and wrapping the README instructions in a new
      shell script.
      dab8e4ac
    • Dridi Boukelmoune's avatar
      Revert "Swap isomorphism subjects" · 2af77a57
      Dridi Boukelmoune authored
      This reverts commit c722eb77.
      
      It didn't change anything and it certainly didn't fix anything either.
      2af77a57
    • Dridi Boukelmoune's avatar
      cocci: Remove VRT_CTX isomorphism attempt · eb834f8e
      Dridi Boukelmoune authored
      It does not work, and it is inaccurate since it doesn't include the ctx
      identifier that is normally part of the definition (it can't anyway).
      
      Refs f5b0b201
      eb834f8e
    • 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
  4. 23 Aug, 2022 2 commits
  5. 16 Aug, 2022 4 commits
  6. 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
  7. 12 Aug, 2022 1 commit