mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-19 17:37:43 +00:00
log connection compression status, bugfix
This commit is contained in:
@ -46,7 +46,7 @@ static std::string renderSize(uint64_t si) {
|
||||
unit = 'T';
|
||||
} while(0);
|
||||
|
||||
::snprintf(buf, sizeof(buf), "%.2f %c", s, unit);
|
||||
::snprintf(buf, sizeof(buf), "%.2f%c", s, unit);
|
||||
return std::string(buf);
|
||||
}
|
||||
|
||||
@ -125,7 +125,14 @@ void RelayServer::runWebsocket(ThreadPool<MsgWebsocket>::Thread &thr) {
|
||||
hubGroup->onConnection([&](uWS::WebSocket<uWS::SERVER> *ws, uWS::HttpRequest req) {
|
||||
std::string addr = ws->getAddress().address;
|
||||
uint64_t connId = nextConnectionId++;
|
||||
LI << "[" << connId << "] Connect from " << addr;
|
||||
|
||||
bool compEnabled, compSlidingWindow;
|
||||
ws->getCompressionState(compEnabled, compSlidingWindow);
|
||||
LI << "[" << connId << "] Connect from " << addr
|
||||
<< " compression=" << (compEnabled ? 'Y' : 'N')
|
||||
<< " sliding=" << (compSlidingWindow ? 'Y' : 'N')
|
||||
;
|
||||
|
||||
Connection *c = new Connection(ws, connId);
|
||||
c->ipAddr = addr;
|
||||
ws->setUserData((void*)c);
|
||||
|
@ -29,7 +29,7 @@ struct WriterPipeline {
|
||||
|
||||
for (auto &m : msgs) {
|
||||
if (m.is_null()) {
|
||||
writerInbox.push_move({ "", "", 0 });
|
||||
writerInbox.push_move({});
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -75,6 +75,8 @@ struct EventToWrite {
|
||||
uint64_t nodeId = 0;
|
||||
EventWriteStatus status = EventWriteStatus::Pending;
|
||||
|
||||
EventToWrite() {}
|
||||
|
||||
EventToWrite(std::string flatStr, std::string jsonStr, uint64_t receivedAt, void *userData = nullptr) : flatStr(flatStr), jsonStr(jsonStr), receivedAt(receivedAt), userData(userData) {
|
||||
const NostrIndex::Event *flat = flatbuffers::GetRoot<NostrIndex::Event>(flatStr.data());
|
||||
quadKey = flatEventToQuadrableKey(flat);
|
||||
|
Reference in New Issue
Block a user