Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings #17649

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/inspector_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ class WsHandler : public ProtocolHandler {
} while (processed > 0 && !data->empty());
}

void Write(const std::vector<char> data) {
void Write(const std::vector<char> data) override {
std::vector<char> output = encode_frame_hybi17(data);
WriteRaw(output, WriteRequest::Cleanup);
}
Expand Down Expand Up @@ -446,7 +446,7 @@ class HttpHandler : public ProtocolHandler {
}
}

void CancelHandshake() {
void CancelHandshake() override {
const char HANDSHAKE_FAILED_RESPONSE[] =
"HTTP/1.0 400 Bad Request\r\n"
"Content-Type: text/html; charset=UTF-8\r\n\r\n"
Expand Down
11 changes: 1 addition & 10 deletions src/inspector_socket_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ const char* MatchPathSegment(const char* path, const char* expected) {
return nullptr;
}

void OnBufferAlloc(uv_handle_t* handle, size_t len, uv_buf_t* buf) {
buf->base = new char[len];
buf->len = len;
}

void PrintDebuggerReadyMessage(const std::string& host,
int port,
const std::vector<std::string>& ids,
Expand Down Expand Up @@ -235,7 +230,6 @@ class SocketSession {
private:
const int id_;
InspectorSocket::Pointer ws_socket_;
InspectorSocketServer* server_;
const int server_port_;
std::string ws_key_;
};
Expand Down Expand Up @@ -531,10 +525,7 @@ void InspectorSocketServer::Send(int session_id, const std::string& message) {
// InspectorSession tracking
SocketSession::SocketSession(InspectorSocketServer* server, int id,
int server_port)
: id_(id),
server_(server),
server_port_(server_port) { }

: id_(id), server_port_(server_port) {}

void SocketSession::Send(const std::string& message) {
ws_socket_->Write(message.data(), message.length());
Expand Down
18 changes: 18 additions & 0 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2849,6 +2849,24 @@ int SSLWrap<Base>::SetCACerts(SecureContext* sc) {
}


Connection::Connection(Environment* env,
v8::Local<v8::Object> wrap,
SecureContext* sc,
SSLWrap<Connection>::Kind kind)
: AsyncWrap(env, wrap, AsyncWrap::PROVIDER_SSLCONNECTION),
SSLWrap<Connection>(env, sc, kind),
bio_read_(nullptr),
bio_write_(nullptr),
hello_offset_(0) {
MakeWeak<Connection>(this);
Wrap(wrap, this);
hello_parser_.Start(SSLWrap<Connection>::OnClientHello,
OnClientHelloParseEnd,
this);
enable_session_callbacks();
}


void Connection::OnClientHelloParseEnd(void* arg) {
Connection* conn = static_cast<Connection*>(arg);

Expand Down
14 changes: 1 addition & 13 deletions src/node_crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,19 +432,7 @@ class Connection : public AsyncWrap, public SSLWrap<Connection> {
Connection(Environment* env,
v8::Local<v8::Object> wrap,
SecureContext* sc,
SSLWrap<Connection>::Kind kind)
: AsyncWrap(env, wrap, AsyncWrap::PROVIDER_SSLCONNECTION),
SSLWrap<Connection>(env, sc, kind),
bio_read_(nullptr),
bio_write_(nullptr),
hello_offset_(0) {
MakeWeak<Connection>(this);
Wrap(wrap, this);
hello_parser_.Start(SSLWrap<Connection>::OnClientHello,
OnClientHelloParseEnd,
this);
enable_session_callbacks();
}
SSLWrap<Connection>::Kind kind);

private:
static void SSLInfoCallback(const SSL *ssl, int where, int ret);
Expand Down
15 changes: 15 additions & 0 deletions src/node_crypto_clienthello-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@
namespace node {
namespace crypto {

inline ClientHelloParser::ClientHelloParser()
: state_(kEnded),
onhello_cb_(nullptr),
onend_cb_(nullptr),
cb_arg_(nullptr),
session_size_(0),
session_id_(nullptr),
servername_size_(0),
servername_(nullptr),
ocsp_request_(0),
tls_ticket_size_(0),
tls_ticket_(nullptr) {
Reset();
}

inline void ClientHelloParser::Reset() {
frame_len_ = 0;
body_offset_ = 0;
Expand Down
14 changes: 1 addition & 13 deletions src/node_crypto_clienthello.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,7 @@ namespace crypto {

class ClientHelloParser {
public:
ClientHelloParser() : state_(kEnded),
onhello_cb_(nullptr),
onend_cb_(nullptr),
cb_arg_(nullptr),
session_size_(0),
session_id_(nullptr),
servername_size_(0),
servername_(nullptr),
ocsp_request_(0),
tls_ticket_size_(0),
tls_ticket_(nullptr) {
Reset();
}
inline ClientHelloParser();

class ClientHello {
public:
Expand Down
1 change: 0 additions & 1 deletion test/cctest/test_inspector_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ class TestInspectorDelegate : public InspectorSocket::Delegate {

void process(inspector_handshake_event event, const std::string& path);

bool disposed_ = false;
delegate_fn handshake_delegate_;
InspectorSocket::Pointer socket_;
std::string ws_key_;
Expand Down