Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit ef59de6

Browse files
authored
Merge pull request #1277 from qwu16/cascrefine
Remove unused code and fix klockwork issue
2 parents bc790e3 + 0968669 commit ef59de6

File tree

8 files changed

+2
-293
lines changed

8 files changed

+2
-293
lines changed

source/agent/addons/quicCascading/QuicTransportServer.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "owt/quic/quic_transport_factory.h"
1313
#include "owt/quic/quic_transport_session_interface.h"
1414

15-
//using namespace net;
1615
using namespace owt_base;
1716
using v8::Function;
1817
using v8::FunctionTemplate;
@@ -30,7 +29,6 @@ Nan::Persistent<v8::Function> QuicTransportServer::s_constructor;
3029
QuicTransportServer::QuicTransportServer(unsigned int port, const std::string& cert_file, const std::string& key_file)
3130
: m_quicServer(QuicFactory::getQuicTransportFactory()->CreateQuicTransportServer(port, cert_file.c_str(), key_file.c_str())) {
3231
m_quicServer->SetVisitor(this);
33-
printf("point address:%p\n", this);
3432
}
3533

3634
QuicTransportServer::~QuicTransportServer() {
@@ -78,7 +76,6 @@ NAN_METHOD(QuicTransportServer::newInstance)
7876
Nan::Utf8String pfxPath(Nan::To<v8::String>(info[1]).ToLocalChecked());
7977
Nan::Utf8String password(Nan::To<v8::String>(info[2]).ToLocalChecked());
8078
QuicTransportServer* obj = new QuicTransportServer(port, *pfxPath, *password);
81-
//owt_base::Utils::ZeroMemory(*password, password.length());
8279
obj->Wrap(info.This());
8380
uv_async_init(uv_default_loop(), &obj->m_asyncOnNewSession, &QuicTransportServer::onNewSessionCallback);
8481
uv_async_init(uv_default_loop(), &obj->m_asyncOnClosedSession, &QuicTransportServer::onClosedSessionCallback);
@@ -150,7 +147,7 @@ NAUV_WORK_CB(QuicTransportServer::onClosedSessionCallback){
150147
Nan::HandleScope scope;
151148
QuicTransportServer* obj = reinterpret_cast<QuicTransportServer*>(async->data);
152149
if (!obj) {
153-
printf("QuicTransportServer::onClosedSessionCallback obj is null");
150+
ELOG_DEBUG("QuicTransportServer::onClosedSessionCallback obj is null");
154151
return;
155152
}
156153

@@ -167,7 +164,6 @@ NAUV_WORK_CB(QuicTransportServer::onClosedSessionCallback){
167164
}
168165

169166
void QuicTransportServer::OnSession(owt::quic::QuicTransportSessionInterface* session) {
170-
//sessions_[session->Id()] = session;
171167
ELOG_DEBUG("QuicTransportServer::OnSession");
172168
boost::mutex::scoped_lock lock(mutex);
173169
this->session_messages.push(session);

source/agent/addons/quicCascading/QuicTransportSession.cc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
#include <thread>
88
#include <chrono>
99
#include <iostream>
10-
//#include <get-uv-event-loop-napi.h>
1110

12-
//using namespace net;
1311
using namespace owt_base;
1412
using v8::Function;
1513
using v8::FunctionTemplate;
@@ -118,8 +116,6 @@ NAN_METHOD(QuicTransportSession::close) {
118116
QuicTransportSession* obj = Nan::ObjectWrap::Unwrap<QuicTransportSession>(info.Holder());
119117
obj->m_session->Stop();
120118
obj->m_session->SetVisitor(nullptr);
121-
/*delete obj->asyncResource_;
122-
delete obj->asyncResourceStreamClosed_;*/
123119

124120
obj->has_stream_callback_ = false;
125121
delete obj->stream_callback_;
@@ -168,9 +164,6 @@ NAUV_WORK_CB(QuicTransportSession::onClosedStreamCallback){
168164
boost::mutex::scoped_lock lock(obj->mutex);
169165
while (!obj->streamclosed_messages.empty()) {
170166
ELOG_INFO("streamclosed_messages is not empty");
171-
//auto streamid = obj->streamclosed_messages.front();
172-
//v8::Local<v8::Object> streamObject = QuicTransportStream::newInstance(quicStream);
173-
//Local<Value> args[] = { streamObject };
174167
Local<Value> args[] = { Nan::New(obj->streamclosed_messages.front()) };
175168

176169
if (obj->streamClosed_callback_) {
@@ -184,9 +177,6 @@ NAUV_WORK_CB(QuicTransportSession::onClosedStreamCallback){
184177

185178
NAN_METHOD(QuicTransportSession::getId) {
186179
QuicTransportSession* obj = Nan::ObjectWrap::Unwrap<QuicTransportSession>(info.Holder());
187-
/*uint8_t length = obj->m_session->length();
188-
std::string s_data(obj->m_session->Id(), length);
189-
ELOG_INFO("QuicTransportSession::getId:%s\n",s_data.c_str());*/
190180
info.GetReturnValue().Set(Nan::New(obj->m_session->Id()).ToLocalChecked());
191181
}
192182

@@ -206,7 +196,6 @@ void QuicTransportSession::OnIncomingStream(owt::quic::QuicTransportStreamInterf
206196
} else {
207197
ELOG_INFO("OnIncomingStream uv_async_send failed");
208198
};
209-
//assert(false);
210199
ELOG_INFO("OnIncomingStream stream:%d in session:%s in thread:%d end\n", stream->Id(), m_session->Id(), std::this_thread::get_id());
211200
}
212201

source/agent/addons/quicCascading/QuicTransportSession.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ class QuicTransportSession : public owt::quic::QuicTransportSessionInterface::Vi
6060
Nan::AsyncResource *asyncResourceNewStream_;
6161
Nan::AsyncResource *asyncResourceClosedStream_;
6262
boost::mutex mutex;
63-
//std::unordered_map<uint32_t, v8::Local<v8::Object>> streams_;
6463
static Nan::Persistent<v8::Function> s_constructor;
6564
};
6665

source/agent/addons/quicCascading/QuicTransportStream.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ class QuicTransportStream : public owt_base::FrameSource, public owt_base::Frame
3838
static NAN_METHOD(newInstance);
3939
static NAN_METHOD(addDestination);
4040
static NAN_METHOD(removeDestination);
41-
// addInputStream(stream, kind)
42-
// kind could be "data", "audio" or "video".
4341
static NAN_METHOD(addInputStream);
4442
static NAN_METHOD(close);
4543
static NAN_METHOD(send);

source/agent/analytics/videoGstPipeline/VideoGstAnalyzer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ gboolean VideoGstAnalyzer::StreamEventCallBack(GstBus *bus, GstMessage *message,
194194
str.append(std::to_string(width));
195195
str.append(",\"height\":");
196196
str.append(std::to_string(height));
197-
str.append("}");
197+
str.append("}\0");
198198
pStreamObj->notifyAsyncEvent("streamadded", str.c_str());
199199

200200
gst_caps_unref (caps);

source/agent/media_bridge/quicTransportServer.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

source/event_bridge/eventCascading.js.bkm

Lines changed: 0 additions & 179 deletions
This file was deleted.

source/event_bridge/quicTransportServer.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)