C++ HTTP server code with curl-based test.

Tested on both Mac and Linux.
Tackled this too.

Thanks,
Dima

http://dimakorolev.com/ | http://www.linkedin.com/in/dimakorolev |
dmitry.korolev@gmail.com | +1 (312) 593 2783


On Sun, Dec 7, 2014 at 10:40 AM, John Babak <notifications@github.com>
wrote:

> In net/posix_tcp_server.h:
>
> > + public:
> > +  inline explicit GenericConnection(const int fd) : fd_(fd) {
> > +  }
> > +
> > +  inline GenericConnection(GenericConnection&& rhs) : fd_(-1) {
> > +    std::swap(fd_, rhs.fd_);
> > +  }
> > +
> > +  inline ~GenericConnection() {
> > +    if (fd_ != -1) {
> > +      close(fd_);
> > +    }
> > +  }
> > +
> > +  template <typename T>
> > +  inline size_t BlockingRead(T* buffer, size_t max_length = kDefaultMaxLengthToReceive) const {
>
> Having a default on the buffer length could lead to a developer error
> (buffer/length mismatch) in a code that uses BlockingRead.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/KnowSheet/Bricks/pull/3/files#r21427943>.
>