1. 23 Sep, 2019 1 commit
  2. 17 Sep, 2019 1 commit
  3. 16 Sep, 2019 6 commits
  4. 13 Sep, 2019 2 commits
  5. 11 Sep, 2019 1 commit
  6. 10 Sep, 2019 1 commit
    • Martin Blix Grydeland's avatar
      Retire the kill(SIGNULL) test in VSM · b845c278
      Martin Blix Grydeland authored
      A bug was uncovered in the VSM code that checks if kill(SIGNULL) would
      work as a test of liveness of the master and worker processes. If the user
      running the utility has the required permissions to send signal to the
      worker process, but not the management process, the code would wrongly
      assume it could do kill on both. It would then end up in a connect loop
      never succeeding.
      
      Because kill() can not always be successfully run (a common scenario when
      the user running varnishlog is not the same UID as the cache processes),
      there is a fall back to using fstat to check for Varnish restarts. Since
      this fallback is active for most use cases anyways, it was decided to
      retire the kill() mechanism rather than to fix it. This way the behaviour
      does not change depending on what user the utility is run as.
      
      This change was OK'd by PHK after discussing it on IRC.
      b845c278
  7. 09 Sep, 2019 14 commits
    • Nils Goroll's avatar
      name vmod function / constructor / method RST xref like VCL · 904ceabf
      Nils Goroll authored
      as @slimhazard pointed out when reviewing a suggestion I made to some
      vmod documentation, the vmodtool generated link target names are
      confusing to users: vmod_foo.func is nothing you can use as VCL, while
      foo.func() is.
      904ceabf
    • Poul-Henning Kamp's avatar
      06ffea87
    • Poul-Henning Kamp's avatar
    • Poul-Henning Kamp's avatar
      Fix header levels · 26e4fed0
      Poul-Henning Kamp authored
      26e4fed0
    • Poul-Henning Kamp's avatar
      Thinking about QUIC and OSI protocols · 8e40d254
      Poul-Henning Kamp authored
      8e40d254
    • Martin Blix Grydeland's avatar
      Adjust the segment length for the cluster allocation offset · b1a1c8a6
      Martin Blix Grydeland authored
      Clusters VSM allocations start at offset 16. Make sure that the published
      segment includes that adjustment.
      b1a1c8a6
    • Martin Blix Grydeland's avatar
      Do not advance the vs->vg pointer unless there was a match · ec19cc19
      Martin Blix Grydeland authored
      The vsm_set vg pointer points to the last matched segment insertion, and
      is used as an optimization when looking for existing entries in the
      list. varnishd guarantees that insertions are always ordered, so there is
      no need to search the preceeding entries on a successful match. When
      parsing an index containg elements that included entries that are added
      and then subsequently removed in a later entry, this pointer would be
      advanced to the very end, failing to match the entries in between when
      parsing the rest of the file.
      
      Fix this mechanism by only updating the pointer on a successful match, and
      also advancing it one step it if the entry it is pointing to is removed.
      
      Note that these types of events are not supposed to be possible, because
      varnishd will when rewriting the index only include the active ones,
      removing any add-then-remove pairs. But if for whatever reason an attempt
      is made to reread a list, with this patch it should not cause problems.
      ec19cc19
    • Martin Blix Grydeland's avatar
      Remove the st_mtime check in vsm_refresh_set · e264e7ea
      Martin Blix Grydeland authored
      Now that we incrementally read the file, the check if the mtime of the
      index file has checked has to go away. If not, the index file will always
      be marked as new, forcing a reread of the entire index.
      e264e7ea
    • Martin Blix Grydeland's avatar
      Sprinkle CHECK_OBJ_NOTNULL on struct vsm_seg · 374b9433
      Martin Blix Grydeland authored
      Several places in the code lacked checking that these were still valid
      objects (ie not free'd).
      374b9433
    • Martin Blix Grydeland's avatar
      Remove stale cluster segments when their refcount goes to zero · 63dbc260
      Martin Blix Grydeland authored
      When a cluster is marked stale, there is no mechanism to actually remove
      it once all its containing segments (which would also be marked stale)
      goes away.
      
      Fix this by executing vsm_delseg on the cluster in VSM_Unmap if it is marked
      stale.
      63dbc260
    • Martin Blix Grydeland's avatar
      Don't remove VSM_FLAG_CLUSTER too early · 68a04aec
      Martin Blix Grydeland authored
      If a segment will be marked stale, it should not have its cluster flag
      removed until its actually deleted.
      
      This problem was observed in varnishtest as an assert. What happened was
      that a VSM_Map() was executed on a stale segment inside a cluster, which
      caused an assert when the cluster segment it pointed to was no longer
      marked VSM_FLAG_CLUSTER.
      68a04aec
    • Martin Blix Grydeland's avatar
      Speed up vsm_findseg · 1e7b50b9
      Martin Blix Grydeland authored
      This speeds up vsm_findseg by keeping a direct pointer to the struct
      vsm_seg it points to in the vsm_fantom.
      
      To prevent stale vsm_fantoms in an application from causing segfaults, the
      last serial number seen is also kept on the fantom. If this serial number
      does not match, the slow path of iterating all segs to find the right
      match is done, and the fantom is updated to make any subsequent calls on
      the same fantom take the fast path.
      
      With this patch the fantoms store 2 serial numbers and a direct pointer to
      the seg. To fit this in struct vsm_fantom without breaking the ABI, the
      unused chunk pointer value has been repurposed, giving us two uintptr_t
      priv variables to work with. The direct segment pointer occupies one, and
      the two serial numbers occupy one half each of the other. This limits the
      bits for each serial to only 16 bits on 32 bit systems. But only direct
      matches is done, and it is unlikely that a stale fantom should have the
      exact right value to be accepted as valid.
      1e7b50b9
    • Martin Blix Grydeland's avatar
      Ignore index lines without either a '+' or '-' · e9436f63
      Martin Blix Grydeland authored
      When upgrading from when a previous release that doesn't have the latest
      VSM index file changes, the utilities will assert when trying to parse the
      index file from the previous version. Fix that by ignoring lines not
      starting with either '#', '+' or '-'.
      e9436f63
    • Martin Blix Grydeland's avatar
      Store VSC exposed state per segment · 06a9a0d4
      Martin Blix Grydeland authored
      This moves the exposed flag handling to the segment level, rather than the
      point level. This enables not having to iterate over each point when there
      is no change from the previous.
      06a9a0d4
  8. 03 Sep, 2019 10 commits
    • Poul-Henning Kamp's avatar
      My thoughts about vsv00003 · 2ce3ea3c
      Poul-Henning Kamp authored
      2ce3ea3c
    • Poul-Henning Kamp's avatar
      White-space nit · a58d59ed
      Poul-Henning Kamp authored
      a58d59ed
    • Martin Blix Grydeland's avatar
      Avoid some code duplication · 406b583f
      Martin Blix Grydeland authored
      Apply some adjustments to recent patches based off of review by Nils
      Goroll at UPLEX (@nigoroll)
      406b583f
    • Martin Blix Grydeland's avatar
    • Martin Blix Grydeland's avatar
      Fix HTTP header line continuation in http1_dissect_hdrs · ccfea8ba
      Martin Blix Grydeland authored
      When clearing the [CR]LF in a line continuation, we would continue
      replacing any [CR|LF|HT|SP] characters up until the end of the buffer,
      possibly overwriting later [CR]LFs. Fix this by only unconditionally
      overwrite one [CR]LF, and then only replace [HT|SP] with SP to keep with
      previous behaviour.
      
      Update r00494.vtc to include multiple line continuations to make sure they
      are parsed.
      ccfea8ba
    • Martin Blix Grydeland's avatar
      Be stricter on final [CR]LF parsing in http1_dissect_hdrs · c3cb8576
      Martin Blix Grydeland authored
      The end of http1_dissect_hdrs ends with skipping over the final [CR]LF
      that marks then end of the headers. Currently that skip is optional, that
      is, it is skipped if it was present.
      
      This patch adds an assert if the final [CR]LF is not found when finishing
      the parsing. HTTP1_Complete guarantees that it is there, if not we would
      not have started parsing the request or response in the first place, and
      if it is missing, there must be an error in the parsing leading up to it.
      c3cb8576
    • Martin Blix Grydeland's avatar
      Do not set the proto txt.b value when third field is missing · 5b1606ac
      Martin Blix Grydeland authored
      In http1_splitline, if the third field is missing, we would still set the
      txt.b value to where the field would have been, with a NULL txt.e
      entry. This would cause http_Proto to attempt to parse the values
      there. Fix this by only setting the .b and .e if the third field was
      present.
      5b1606ac
    • Martin Blix Grydeland's avatar
      Fix http1_splitline parsing of 2 field HTTP proto lines using NLNL · 1a820aaf
      Martin Blix Grydeland authored
      When parsing a request like this, "GET /\n\n", the first NL would be
      overwritten by nul guard inserted after the 2nd field, and the second NL
      would be overwritten by the nul guard after the missing 3rd field. This
      would cause http1_dissect_hdrs to attempt to decode the body as headers.
      1a820aaf
    • Martin Blix Grydeland's avatar
      Allow a NULL value in http_Proto · e2335929
      Martin Blix Grydeland authored
      The proto field is optional in HTTP, so it may not be set. Set the proto
      to 0 also for a NULL value instead of segfaulting if it were NULL.
      e2335929
    • Alf-André Walla's avatar
      Add bounds-checking to vct_iscrlf and vct_skipcrlf · 1b508d15
      Alf-André Walla authored
      The macros vct_iscrlf() and vct_skipcrlf() may look at one or two bytes
      after its pointer value, causing OOB reads. This would allow
      http1_dissect_hdrs to wrongly see a CRLF when one wasn't there (the last
      LF left over in the bufer from the previous request).
      
      Change the macros to inline functions, and harden them by always sending
      the end pointer so that they can't overflow.
      
      vct_iscrlf() will return an int value of 0 for no [CR]LF, 1 for LF and 2
      for CRLF.
      
      vct_skipcrlf() will return the pointer having been skipped 0, 1 or 2
      bytes.
      1b508d15
  9. 02 Sep, 2019 1 commit
  10. 26 Aug, 2019 1 commit
  11. 22 Aug, 2019 2 commits