replacing crlf with lf
This commit is contained in:
@@ -9,20 +9,8 @@ LLMessageLogEntry::LLMessageLogEntry(EType type, LLHost from_host, LLHost to_hos
|
||||
{
|
||||
if(data)
|
||||
{
|
||||
mData.resize(data_size);
|
||||
mData.assign(data,data + data_size);
|
||||
}
|
||||
}
|
||||
LLMessageLogEntry::LLMessageLogEntry(EType type, LLHost from_host, LLHost to_host, std::vector<U8> data, S32 data_size)
|
||||
: mType(type),
|
||||
mFromHost(from_host),
|
||||
mToHost(to_host),
|
||||
mDataSize(data_size)
|
||||
{
|
||||
if(data.size())
|
||||
{
|
||||
mData.resize(data.size());
|
||||
std::copy(data.begin(),data.end(),mData.begin());
|
||||
mData = new U8[data_size];
|
||||
memcpy(mData, data, data_size);
|
||||
}
|
||||
}
|
||||
LLMessageLogEntry::~LLMessageLogEntry()
|
||||
@@ -44,6 +32,7 @@ void LLMessageLog::setCallback(void (*callback)(LLMessageLogEntry))
|
||||
void LLMessageLog::log(LLHost from_host, LLHost to_host, U8* data, S32 data_size)
|
||||
{
|
||||
LLMessageLogEntry entry = LLMessageLogEntry(LLMessageLogEntry::TEMPLATE, from_host, to_host, data, data_size);
|
||||
if(!entry.mDataSize || !entry.mData) return;
|
||||
if(sCallback) sCallback(entry);
|
||||
if(!sMaxSize) return;
|
||||
sDeque.push_back(entry);
|
||||
|
||||
@@ -1,41 +1,40 @@
|
||||
// <edit>
|
||||
#ifndef LL_LLMESSAGELOG_H
|
||||
#define LL_LLMESSAGELOG_H
|
||||
#include "stdtypes.h"
|
||||
#include "llhost.h"
|
||||
#include <queue>
|
||||
#include <string.h>
|
||||
|
||||
class LLMessageSystem;
|
||||
class LLMessageLogEntry
|
||||
{
|
||||
public:
|
||||
enum EType
|
||||
{
|
||||
TEMPLATE,
|
||||
HTTP_REQUEST,
|
||||
HTTP_RESPONSE
|
||||
};
|
||||
LLMessageLogEntry(EType type, LLHost from_host, LLHost to_host, U8* data, S32 data_size);
|
||||
LLMessageLogEntry(EType type, LLHost from_host, LLHost to_host, std::vector<U8> data, S32 data_size);
|
||||
~LLMessageLogEntry();
|
||||
EType mType;
|
||||
LLHost mFromHost;
|
||||
LLHost mToHost;
|
||||
S32 mDataSize;
|
||||
std::vector<U8> mData;
|
||||
};
|
||||
class LLMessageLog
|
||||
{
|
||||
public:
|
||||
static void setMaxSize(U32 size);
|
||||
static void setCallback(void (*callback)(LLMessageLogEntry));
|
||||
static void log(LLHost from_host, LLHost to_host, U8* data, S32 data_size);
|
||||
static std::deque<LLMessageLogEntry> getDeque();
|
||||
private:
|
||||
static U32 sMaxSize;
|
||||
static void (*sCallback)(LLMessageLogEntry);
|
||||
static std::deque<LLMessageLogEntry> sDeque;
|
||||
};
|
||||
#endif
|
||||
// </edit>
|
||||
// <edit>
|
||||
#ifndef LL_LLMESSAGELOG_H
|
||||
#define LL_LLMESSAGELOG_H
|
||||
#include "stdtypes.h"
|
||||
#include "llhost.h"
|
||||
#include <queue>
|
||||
#include <string.h>
|
||||
|
||||
class LLMessageSystem;
|
||||
class LLMessageLogEntry
|
||||
{
|
||||
public:
|
||||
enum EType
|
||||
{
|
||||
TEMPLATE,
|
||||
HTTP_REQUEST,
|
||||
HTTP_RESPONSE
|
||||
};
|
||||
LLMessageLogEntry(EType type, LLHost from_host, LLHost to_host, U8* data, S32 data_size);
|
||||
~LLMessageLogEntry();
|
||||
EType mType;
|
||||
LLHost mFromHost;
|
||||
LLHost mToHost;
|
||||
S32 mDataSize;
|
||||
U8* mData;
|
||||
};
|
||||
class LLMessageLog
|
||||
{
|
||||
public:
|
||||
static void setMaxSize(U32 size);
|
||||
static void setCallback(void (*callback)(LLMessageLogEntry));
|
||||
static void log(LLHost from_host, LLHost to_host, U8* data, S32 data_size);
|
||||
static std::deque<LLMessageLogEntry> getDeque();
|
||||
private:
|
||||
static U32 sMaxSize;
|
||||
static void (*sCallback)(LLMessageLogEntry);
|
||||
static std::deque<LLMessageLogEntry> sDeque;
|
||||
};
|
||||
#endif
|
||||
// </edit>
|
||||
|
||||
@@ -568,7 +568,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
|
||||
//dumpPacketToLog();
|
||||
|
||||
// <edit>
|
||||
if(mTrueReceiveSize)
|
||||
if(mTrueReceiveSize && receive_size > (S32) LL_MINIMUM_VALID_PACKET_SIZE)
|
||||
{
|
||||
LLMessageLog::log(mLastSender, LLHost(16777343, mPort), buffer, mTrueReceiveSize);
|
||||
}
|
||||
|
||||
@@ -41,10 +41,10 @@ LLFloaterMessageLogItem::LLFloaterMessageLogItem(LLMessageLogEntry entry)
|
||||
{
|
||||
BOOL decode_invalid = FALSE;
|
||||
S32 decode_len = mDataSize;
|
||||
std::vector<U8> DecodeBuffer(MAX_PACKET_LEN,0);
|
||||
DecodeBuffer.assign(mData.begin(),mData.end());
|
||||
mFlags = DecodeBuffer[0];
|
||||
U8 DecodeBuffer[MAX_PACKET_LEN];
|
||||
memcpy(&(DecodeBuffer[0]),mData,decode_len);
|
||||
U8* decodep = &(DecodeBuffer[0]);
|
||||
mFlags = DecodeBuffer[0];
|
||||
gMessageSystem->zeroCodeExpand(&decodep, &decode_len);
|
||||
if(decode_len < 7)
|
||||
decode_invalid = TRUE;
|
||||
@@ -142,8 +142,8 @@ std::string LLFloaterMessageLogItem::getFull(BOOL show_header)
|
||||
{
|
||||
BOOL decode_invalid = FALSE;
|
||||
S32 decode_len = mDataSize;
|
||||
std::vector<U8> DecodeBuffer(MAX_PACKET_LEN,0);
|
||||
DecodeBuffer.assign(mData.begin(),mData.end());
|
||||
U8 DecodeBuffer[MAX_PACKET_LEN];
|
||||
memcpy(&(DecodeBuffer[0]),mData,decode_len);
|
||||
U8* decodep = &(DecodeBuffer[0]);
|
||||
gMessageSystem->zeroCodeExpand(&decodep, &decode_len);
|
||||
if(decode_len < 7)
|
||||
@@ -447,10 +447,8 @@ BOOL LLMessageLogFilterApply::tick()
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
if((*mIter).mData.size())
|
||||
{
|
||||
LLFloaterMessageLog::sInstance->conditionalLog(LLFloaterMessageLogItem((*mIter)));
|
||||
}
|
||||
|
||||
LLFloaterMessageLog::sInstance->conditionalLog(LLFloaterMessageLogItem((*mIter)));
|
||||
|
||||
mIter++;
|
||||
mProgress++;
|
||||
|
||||
Reference in New Issue
Block a user