]> git.ipfire.org Git - thirdparty/squid.git/commit
* create a new method in CallBack which does the cbdataReferenceValid()
authoradrian <>
Wed, 18 Feb 2004 08:58:59 +0000 (08:58 +0000)
committeradrian <>
Wed, 18 Feb 2004 08:58:59 +0000 (08:58 +0000)
commit85a56f1517fb49c3d31f7207f90f135a74a9bf9d
tree65636d7b688f87ea99da1066d7b4c05b21361c1b
parent805081ffdac6be1f3f8ff2da60048e5143cf2537
* create a new method in CallBack which does the cbdataReferenceValid()
  for us
* remove the extra cbdataReference/cbdataReferenceDone() in the comm
  connect codepath: this was exposing a bug with how cbdataReferenceDone()
  operates. In a nutshell, its a macro which sets the value to NULL after
  decrementing its refcount because, after that function call, the memory
  may have been freed. The problem was that we were doing it on the data
  pointer in a CallBack instance and so the instance never had a chance to
  remove _its_ reference count on the data because, at the time the
  destructor is called, the data pointer has been made NULL.

  Not nice.

* Fix the comm connect finish routine to properly get rid of any CallBack
  which may be allocated. cbdataReferenceDone() would NOT have been
  sufficient if the connection had timed out - we'd still have been left
  with an extra refcount without the above modifications.
src/CommRead.h
src/comm.cc