All pastes #1866708 Raw Edit

argonel

public text v1 · immutable
#1866708 ·published 2010-04-18 19:56 UTC
rendered paste body
From 1b7e56b581accd385d8f1b1f5ee607b4659c822e Mon Sep 17 00:00:00 2001From: eli mackenzie <argonel@gmail.com>Date: Sun, 18 Apr 2010 15:55:02 -0400Subject: [PATCH] add hexdump to raw log--- src/irc/server.cpp |   17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-)diff --git a/src/irc/server.cpp b/src/irc/server.cppindex dde396d..c3dfa59 100644--- a/src/irc/server.cpp+++ b/src/irc/server.cpp@@ -944,6 +944,20 @@ void Server::processIncomingData()     } } +static QString qstrToHex( const QByteArray in)+{+    int l = in.length(), i=0;+    QString out;+    for (;i<l;i++)+    {+        if (i) out += ' ';+        uint a = in.at(i);+        kDebug() << a;+        out += QString::number( a, 16 ).rightJustified( 4, '0', true );+    }+    return out;+}+ void Server::incoming() {     //if (getConnectionSettings().server().SSLEnabled())@@ -1042,7 +1056,10 @@ void Server::incoming()          //send to raw log before decryption         if(m_rawLog)+        {             m_rawLog->appendRaw("&gt;&gt; " + QString(first).remove(QChar(0xFDD0)).remove(QChar(0xFDD1)).replace('&',"&amp;").replace('<',"&lt;").replace('>',"&gt;").replace(QRegExp("\\s"), "&nbsp;"));+            m_rawLog->appendRaw(qstrToHex(first));+        }          #ifdef HAVE_QCA2         QByteArray cKey = getKeyForRecipient(channelKey);-- 1.6.6.1