From 426879358105f80785ceeb4ca375581b0c7cf79a Mon Sep 17 00:00:00 2001 From: "Alan M. Carroll" Date: Fri, 1 Aug 2014 09:17:08 -0500 Subject: [PATCH] TS-2802: SNI support for origin servers - fix WCCP compile errors. --- lib/ts/TsBuffer.h | 26 +++++++++----------------- lib/tsconfig/TsValue.cc | 6 +++--- lib/tsconfig/TsValue.h | 6 +++--- lib/wccp/WccpLocal.h | 2 +- proxy/http/HttpTransact.cc | 1 - 5 files changed, 16 insertions(+), 25 deletions(-) diff --git a/lib/ts/TsBuffer.h b/lib/ts/TsBuffer.h index 1abc6fed73f..4ed8cccf900 100644 --- a/lib/ts/TsBuffer.h +++ b/lib/ts/TsBuffer.h @@ -52,7 +52,7 @@ namespace ts { char * _ptr; ///< Pointer to base of memory chunk. size_t _size; ///< Size of memory chunk. - /// Default constructor. + /// Default constructor (empty buffer). Buffer(); /** Construct from pointer and size. @@ -65,13 +65,11 @@ namespace ts { ); /** Construct from two pointers. @note This presumes a half open range, (start, end] - @note Due to ambiguity issues do not invoke this with - @a start == 0. */ Buffer( - char* start, ///< First valid character. - char* end ///< First invalid character. - ); + char* start, ///< First valid character. + char* end ///< First invalid character. + ); /** Equality. @return @c true if @a that refers to the same memory as @a this, @@ -129,10 +127,6 @@ namespace ts { /** A chunk of read only memory. A convenience class because we pass this kind of pair frequently. - - @note The default construct leaves the object - uninitialized. This is for performance reasons. To construct an - empty @c Buffer use @c Buffer(0). */ struct ConstBuffer { typedef ConstBuffer self; ///< Self reference type. @@ -141,12 +135,10 @@ namespace ts { char const * _ptr; ///< Pointer to base of memory chunk. size_t _size; ///< Size of memory chunk. - /// Default constructor. + /// Default constructor (empty buffer). ConstBuffer(); /** Construct from pointer and size. - @note Due to ambiguity issues do not call this with - two arguments if the first argument is 0. */ ConstBuffer( char const * ptr, ///< Pointer to buffer. @@ -158,12 +150,12 @@ namespace ts { @a start == 0. */ ConstBuffer( - char const* start, ///< First valid character. - char const* end ///< First invalid character. - ); + char const* start, ///< First valid character. + char const* end ///< First invalid character. + ); /// Construct from writable buffer. ConstBuffer( - Buffer const& buffer ///< Buffer to copy. + Buffer const& buffer ///< Buffer to copy. ); /** Equality. diff --git a/lib/tsconfig/TsValue.cc b/lib/tsconfig/TsValue.cc index d7c1db11ba6..06beaecea7f 100644 --- a/lib/tsconfig/TsValue.cc +++ b/lib/tsconfig/TsValue.cc @@ -37,8 +37,8 @@ // --------------------------------------------------------------------------- namespace ts { namespace config { // --------------------------------------------------------------------------- -Buffer const detail::NULL_BUFFER(0); -ConstBuffer const detail::NULL_CONST_BUFFER(0); +Buffer const detail::NULL_BUFFER; +ConstBuffer const detail::NULL_CONST_BUFFER; detail::ValueItem detail::ValueTableImpl::NULL_ITEM(VoidValue); detail::PseudoBool::Type const detail::PseudoBool::FALSE = 0; detail::PseudoBool::Type const detail::PseudoBool::TRUE = &detail::PseudoBool::operator !; @@ -332,7 +332,7 @@ Configuration::getRoot() const { Rv Configuration::loadFromPath(char const* path) { Rv zret; - Buffer buffer(0); + Buffer buffer; FILE* in = fopen(path, "r"); if (in) { diff --git a/lib/tsconfig/TsValue.h b/lib/tsconfig/TsValue.h index 19c0f0c5fa7..3919ba3cc4b 100644 --- a/lib/tsconfig/TsValue.h +++ b/lib/tsconfig/TsValue.h @@ -644,8 +644,8 @@ namespace detail { inline ValueItem const& ValueTable::operator [] (ValueIndex idx) const { return const_cast(this)->operator [] (idx); } inline ValueTable& ValueTable::reset() { _ptr = 0; return *this; } - inline ValueItem::ValueItem() : _type(VoidValue), _text(0), _name(0) {} - inline ValueItem::ValueItem(ValueType type) : _type(type), _text(0), _name(0) {} + inline ValueItem::ValueItem() : _type(VoidValue) {} + inline ValueItem::ValueItem(ValueType type) : _type(type) {} inline ValueType ValueItem::getType() const { return _type; } } @@ -722,7 +722,7 @@ inline Path& Path::append(size_t index) { this->instance()->_elements.push_back( inline size_t Path::count() const { return _ptr ? _ptr->_elements.size() : 0; } inline ConstBuffer const& Path::operator [] (size_t idx) const { return _ptr ? _ptr->_elements[idx] : detail::NULL_CONST_BUFFER; } -inline Path::Parser::Parser() : _input(0), _c(0) { } +inline Path::Parser::Parser() { } inline Path::Parser::Parser( ConstBuffer const& text ) : _input(text), _c(text._ptr) { } inline bool Path::Parser::hasInput() const { return _input._ptr && _input._ptr + _input._size > _c; } diff --git a/lib/wccp/WccpLocal.h b/lib/wccp/WccpLocal.h index 3430ccfadc7..d039bc0dfb2 100644 --- a/lib/wccp/WccpLocal.h +++ b/lib/wccp/WccpLocal.h @@ -3231,7 +3231,7 @@ detail::Assignment::getMask() const { return *m_mask_assign; } -inline MsgBuffer::MsgBuffer() : super(0), _count(0) { } +inline MsgBuffer::MsgBuffer() : super(), _count(0) { } inline MsgBuffer::MsgBuffer(super const& that) : super(that), _count(0) { } inline MsgBuffer::MsgBuffer(void* p, size_t n) : super(static_cast(p),n) diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index 0a8f93a43ec..9a59b474c9f 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -46,7 +46,6 @@ #include "StatPages.h" #include "HttpClientSession.h" #include "I_Machine.h" -#include "IPAllow.h" static char range_type[] = "multipart/byteranges; boundary=RANGE_SEPARATOR"; #define RANGE_NUMBERS_LENGTH 60