GithubHelp home page GithubHelp logo

glynos / cpp-netlib Goto Github PK

View Code? Open in Web Editor NEW
237.0 237.0 583.0 7.68 MB

The C++ Network Library Project -- header-only, cross-platform, standards compliant networking library.

Home Page: http://glynos.github.com/cpp-netlib/

License: Boost Software License 1.0

C++ 55.63% Python 1.26% Shell 0.20% CMake 1.58% HTML 33.97% Makefile 0.19% CSS 1.61% JavaScript 5.37% Batchfile 0.19%

cpp-netlib's Introduction

Hi there 👋

cpp-netlib's People

Contributors

3noch avatar anonimal avatar burannah avatar chenzhaoyu avatar cnagune avatar codemedic avatar danielbujnik avatar deanberris avatar dvd0101 avatar eakraly avatar el-bart avatar gjasny avatar glynos avatar igorpeshansky avatar infinity0 avatar jellevdd avatar kaspervandenberg avatar leecoder avatar lyytinen avatar mike-ect avatar nabagata avatar omalashenko avatar patlecat avatar povilasb avatar prantlf avatar susnux avatar tjadevries avatar umennel avatar vexocide avatar wujunzhuo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpp-netlib's Issues

Creating a Contributor's Guide

Hi everyone,

When fixing bugs in branch master, I found out too late that they were resolved in 0.12-release and 0.13-release. When wanting to PR other contributions, I could not find clear documentation that indicated which branch to PR too.

I'm wondering if a basic contributor's guide would be helpful to the project. Something that indicates workflow and/or any desired protocol. If the guide also included any style considerations, that would be helpful (our guide is under development but has been helpful so far).

Referencing our interest in cpp-netlib.

Error C2039: "value" is not a member of "boost::prot"

I installed boost and cpp-netlib using vcpkg,but when I'm using it by #include “boost/network/uri.hpp" ,I got error C2039.The error is reported at "F:\vcpkg\installed\x64-windows\include\boost\proto\generate.hpp",in line239 and line 248.
IDE: Viaual Studio Professional 2019
System: Windows 10 x64

Fetched in submodule path 'libs/network/doc/_ext/breathe'

When I type cmd "git submodule update",then I got the log below:

Cloning into '.../cpp-netlib/deps/asio'...
Cloning into '.../cpp-netlib/deps/cxxopts'...
Cloning into '.../cpp-netlib/deps/googlemock'...
Cloning into '.../cpp-netlib/deps/googletest'...
Cloning into '.../cpp-netlib/deps/uri'...
Cloning into '.../cpp-netlib/libs/network/doc/_ext/breathe'...
Submodule path 'deps/asio': checked out '66e76b9e4252ff4681227d0d8e34374ec1fa20e5'
Submodule path 'deps/cxxopts': checked out 'aec97a6f53c3486fc51e0d9857f10b683180d668'
Submodule path 'deps/googlemock': checked out 'f7d03d2734759ee12b57d2dbcb695607d89e8e05'
Submodule path 'deps/googletest': checked out 'd225acc90bc3a8c420a9bcd1f033033c1ccd7fe0'
Submodule path 'deps/uri': checked out 'c16a46ecb6bf0c936179e324891a74b5e6d8f4d3'
error: Server does not allow request for unadvertised object 853385ef4f0c3dd126887750e20d5f7456065998
Fetched in submodule path 'libs/network/doc/_ext/breathe', but it did not contain 853385ef4f0c3dd126887750e20d5f7456065998. Direct fetching of that commit failed.

[Docs] Create an appendix for concepts

All concept definitions belong in the appendix because, although the information is important, it is not easily readable and breaks up the flow of the text.

Implement byte source in HTTP request

The API of the request class should be something like this:

struct request {
  request(uri, shared_ptr<byte_source>=nullptr);
  void set_body_source(shared_ptr<byte_source>);
  // ...
};

and for the byte_source class itself:

struct byte_source {
  virtual ~byte_source() noexcept = 0;
  virtual size_t read(string&, size_t) = 0;
};

We can test using mock_byte_source class.

Body callback function is not called when some errors occur (timeout etc.)

When using cpp-netlib-0.11.2-final and async client with body callback function:

boost::network::http::client::options options;
options.timeout( timeout_seconds );
options.follow_redirects( true );

boost::network::http::client client( options );
client.get( request, callback );

The callback is not called when some network etc. errors occur. I observed it that when timeout should occur my callback function is still not called, but when I looked at cpp-netlib's async_normal.hpp file I found not only for timeout, but in many places in which body_promise IS set (either to empty value or exception), but callback either IS NOT called at all, or is called with uninitialized boost::system::error_code instead of the same error code body_promise was set, which would make my own callback function expect another call instead of finish the processing (since uninitialized error_code means no error occurred and we are still waiting for boost::asio::error::eof or other error to finish the processing).

Constants should be header only

To do:

  • Remove "methods" namespace as it is duplicated in the methods.hpp header.
  • Make the status codes an enum class.
  • Maybe remove the headers for now, these don't need to be constants, I think.

Implement a base 64 encoder for the request byte source

request r{“http://www.example.com”,
          base64_encode(new file_byte_source{“/tmp/input”})};

So the base64_encode function would look like this:

template <class ByteSource>
auto gzip_encode(ByteSource* source) -> shared_ptr<gzip_encoder<ByteSource>> {
  shared_ptr<gzip_encoder<ByteSource>> ptr{new gzip_encoder<ByteSource>(source)};
  return ptr;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.