Browse Source

Ensure the stderr integration works

Anything the pirserver outputs to stderr should get logged by the tor
process.
Ian Goldberg 5 years ago
parent
commit
06e560897d
2 changed files with 9 additions and 1 deletions
  1. 7 1
      Makefile
  2. 2 0
      toyserver.cc

+ 7 - 1
Makefile

@@ -1,4 +1,10 @@
 CXXFLAGS=-g -Wall
 
 toyserver: toyserver.o pirserver.o
-	$(CXX) -o $@ $^
+	$(CXX) -Wall -o $@ $^
+
+clean:
+	-rm toyserver.o pirserver.o
+
+veryclean: clean
+	-rm toyserver

+ 2 - 0
toyserver.cc

@@ -5,6 +5,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
+#include <iostream>
 #include <map>
 
 using std::map;
@@ -72,6 +73,7 @@ ToyServer::store(const string &key, const string &value)
     } else {
         table.erase(key);
     }
+    std::cerr << "stored (" << key.length() << ") " << key << "\n";
 }
 
 bool