mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
Added back in eq stream ident timeout, also fixed bug with opcode manager
This commit is contained in:
parent
1ada60b611
commit
d83e8b7d8f
@ -45,13 +45,12 @@ void EQStreamIdentifier::Process() {
|
|||||||
Record &r = *cur;
|
Record &r = *cur;
|
||||||
|
|
||||||
//first see if this stream has expired
|
//first see if this stream has expired
|
||||||
//if(r.expire.Check(false)) {
|
if(r.expire.Check(false)) {
|
||||||
// //this stream has failed to match any pattern in our timeframe.
|
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", r.stream->GetRemoteAddr().c_str(), ntohs(r.stream->GetRemotePort()));
|
||||||
// Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()));
|
r.stream->Close();
|
||||||
// r.stream->ReleaseFromUse();
|
cur = m_streams.erase(cur);
|
||||||
// cur = m_streams.erase(cur);
|
continue;
|
||||||
// continue;
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
//then make sure the stream is still active
|
//then make sure the stream is still active
|
||||||
//if stream hasn't finished initializing then continue;
|
//if stream hasn't finished initializing then continue;
|
||||||
|
|||||||
@ -57,6 +57,7 @@ void EQ::Net::DaybreakConnectionManager::Attach(uv_loop_t *loop)
|
|||||||
rc = uv_udp_recv_start(&m_socket,
|
rc = uv_udp_recv_start(&m_socket,
|
||||||
[](uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) {
|
[](uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) {
|
||||||
buf->base = new char[suggested_size];
|
buf->base = new char[suggested_size];
|
||||||
|
memset(buf->base, 0, suggested_size);
|
||||||
buf->len = suggested_size;
|
buf->len = suggested_size;
|
||||||
},
|
},
|
||||||
[](uv_udp_t* handle, ssize_t nread, const uv_buf_t* buf, const struct sockaddr* addr, unsigned flags) {
|
[](uv_udp_t* handle, ssize_t nread, const uv_buf_t* buf, const struct sockaddr* addr, unsigned flags) {
|
||||||
|
|||||||
@ -42,14 +42,12 @@ void EQ::Net::EQStreamManager::DaybreakPacketRecv(std::shared_ptr<DaybreakConnec
|
|||||||
auto iter = m_streams.find(connection);
|
auto iter = m_streams.find(connection);
|
||||||
if (iter != m_streams.end()) {
|
if (iter != m_streams.end()) {
|
||||||
auto &stream = iter->second;
|
auto &stream = iter->second;
|
||||||
if (stream->m_opcode_manager && stream->m_opcode_manager) {
|
std::unique_ptr<EQ::Net::Packet> t(new EQ::Net::WritablePacket());
|
||||||
std::unique_ptr<EQ::Net::Packet> t(new EQ::Net::WritablePacket());
|
t->PutPacket(0, p);
|
||||||
t->PutPacket(0, p);
|
stream->m_packet_queue.push_back(std::move(t));
|
||||||
stream->m_packet_queue.push_back(std::move(t));
|
|
||||||
|
|
||||||
if (m_on_data_avail) {
|
if (m_on_data_avail) {
|
||||||
m_on_data_avail(stream);
|
m_on_data_avail(stream);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user