Skip to content

Commit

Permalink
Make members accessible in derived class (uNetworking#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
otamachan authored and Alex Hultman committed Feb 2, 2018
1 parent 63581f6 commit 8b0a89c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ enum Options : unsigned int {

template <bool isServer>
class ExtensionsNegotiator {
private:
protected:
int options;
public:
ExtensionsNegotiator(int wantedOptions);
Expand Down
2 changes: 1 addition & 1 deletion src/Group.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum ListenOptions {
struct Hub;

template <bool isServer>
struct WIN32_EXPORT Group : private uS::NodeData {
struct WIN32_EXPORT Group : protected uS::NodeData {
protected:
friend struct Hub;
friend struct WebSocket<isServer>;
Expand Down
2 changes: 1 addition & 1 deletion src/HTTPSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ struct WIN32_EXPORT HttpSocket : uS::Socket {
size_t extensionsLength, const char *subprotocol,
size_t subprotocolLength, bool *perMessageDeflate);

private:
protected:
friend struct uS::Socket;
friend struct HttpResponse;
friend struct Hub;
Expand Down
2 changes: 1 addition & 1 deletion src/Hub.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace uWS {

struct WIN32_EXPORT Hub : private uS::Node, public Group<SERVER>, public Group<CLIENT> {
struct WIN32_EXPORT Hub : protected uS::Node, public Group<SERVER>, public Group<CLIENT> {
protected:
struct ConnectionData {
std::string path;
Expand Down
2 changes: 1 addition & 1 deletion src/Networking.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ struct Context {
namespace TLS {

class WIN32_EXPORT Context {
private:
protected:
SSL_CTX *context = nullptr;
std::shared_ptr<std::string> password;

Expand Down
3 changes: 1 addition & 2 deletions src/Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ enum ListenOptions : int {
};

class WIN32_EXPORT Node {
private:
protected:
template <void C(Socket *p, bool error)>
static void connect_cb(Poll *p, int status, int events) {
C((Socket *) p, status < 0);
Expand Down Expand Up @@ -71,7 +71,6 @@ class WIN32_EXPORT Node {
} while ((clientFd = netContext->acceptSocket(serverFd)) != INVALID_SOCKET);
}

protected:
Loop *loop;
NodeData *nodeData;
std::recursive_mutex asyncMutex;
Expand Down
2 changes: 1 addition & 1 deletion src/WebSocketProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class WIN32_EXPORT WebSocketProtocol {
static const unsigned int MEDIUM_MESSAGE_HEADER = isServer ? 8 : 4;
static const unsigned int LONG_MESSAGE_HEADER = isServer ? 14 : 10;

private:
protected:
static inline bool isFin(char *frame) {return *((unsigned char *) frame) & 128;}
static inline unsigned char getOpCode(char *frame) {return *((unsigned char *) frame) & 15;}
static inline unsigned char payloadLength(char *frame) {return ((unsigned char *) frame)[1] & 127;}
Expand Down

0 comments on commit 8b0a89c

Please sign in to comment.