Skip to content

Commit

Permalink
TS-2802: SNI support for origin servers - fix WCCP compile errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidWallOfCode committed Aug 1, 2014
1 parent 4b2429b commit 4268793
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 25 deletions.
26 changes: 9 additions & 17 deletions lib/ts/TsBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions lib/tsconfig/TsValue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 !;
Expand Down Expand Up @@ -332,7 +332,7 @@ Configuration::getRoot() const {
Rv<Configuration>
Configuration::loadFromPath(char const* path) {
Rv<Configuration> zret;
Buffer buffer(0);
Buffer buffer;
FILE* in = fopen(path, "r");

if (in) {
Expand Down
6 changes: 3 additions & 3 deletions lib/tsconfig/TsValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@ namespace detail {
inline ValueItem const& ValueTable::operator [] (ValueIndex idx) const { return const_cast<self*>(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; }
}

Expand Down Expand Up @@ -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; }

Expand Down
2 changes: 1 addition & 1 deletion lib/wccp/WccpLocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<char*>(p),n)
Expand Down
1 change: 0 additions & 1 deletion proxy/http/HttpTransact.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4268793

Please sign in to comment.