Browse files

The peer address is now stored along each article.

  • Loading branch information...
1 parent 3730f3d commit 3d359fc675a7c84491213df53599c946517e9009 @s-ludwig s-ludwig committed Aug 8, 2012
Showing with 4 additions and 0 deletions.
  1. +1 −0 source/vibenews/db.d
  2. +2 −0 source/vibenews/nntp/server.d
  3. +1 −0 source/vibenews/vibenews.d
View
1 source/vibenews/db.d
@@ -23,6 +23,7 @@ struct Article {
ubyte[] message;
long messageLength;
long messageLines;
+ string peerAddress;
string getHeader(string name)
const {
View
2 source/vibenews/nntp/server.d
@@ -57,6 +57,7 @@ void listenNntp(NntpServerSettings settings, void delegate(NntpServerRequest, Nn
auto req = new NntpServerRequest(conn);
req.command = cmd;
req.parameters = params;
+ req.peerAddress = conn.peerAddress;
try {
command_handler(req, res);
} catch( Exception e ){
@@ -92,6 +93,7 @@ class NntpServerRequest {
string command;
string[] parameters;
+ string peerAddress;
this(InputStream str)
{
View
1 source/vibenews/vibenews.d
@@ -348,6 +348,7 @@ void post(NntpServerRequest req, NntpServerResponse res)
foreach( k, v; headers ) art.addHeader(k, v);
art.message = req.bodyReader.readAll();
+ art.peerAddress = req.peerAddress;
postArticle(art);

0 comments on commit 3d359fc

Please sign in to comment.