From eb2f8225fad1cd8d2d7d67fa7266a87ada8a97e0 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 8 Feb 2009 18:01:51 +0100 Subject: [PATCH] Add FTP protocol debugging facilities. --- Makefile | 2 +- Telnet.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2935786..17d5403 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CFLAGS = -g -Wall +CFLAGS = -g -Wall -DDEBUG LDFLAGS = LIBS = -lpthread diff --git a/Telnet.cpp b/Telnet.cpp index 3687bc3..be48618 100644 --- a/Telnet.cpp +++ b/Telnet.cpp @@ -6,6 +6,7 @@ #include #include "Telnet.hpp" #include "Exceptions.hpp" +#include "Log.hpp" static const char CRLF[] = { 13, 10, 0 }; static const char IAC[] = { 255, 0 }; @@ -84,6 +85,10 @@ bool Telnet::Read() void Telnet::Write( const std::string& msg ) { +#ifdef DEBUG + g_log->Print( "> " + msg ); +#endif + std::string buf; for( unsigned int i=0; iPrint( "< " + ret ); +#endif + return ret; } -- 2.11.4.GIT