[Debtags-commits] [svn] r2017 - in daemon: . src

Enrico Zini enrico at costa.debian.org
Fri Oct 6 12:47:32 UTC 2006


Author: enrico
Date: Fri Oct  6 12:47:31 2006
New Revision: 2017

Modified:
   daemon/   (props changed)
   daemon/src/debtagsd.cpp
   daemon/src/dp
   daemon/src/dq
Log:
 r3528 at viaza:  enrico | 2006-10-06 14:46:12 +0200
 Improved the patch submission protocol and implemented support for it in Debtagsd.py


Modified: daemon/src/debtagsd.cpp
==============================================================================
--- daemon/src/debtagsd.cpp	(original)
+++ daemon/src/debtagsd.cpp	Fri Oct  6 12:47:31 2006
@@ -134,6 +134,23 @@
 		return line;
 	}
 
+	// Consume all the input
+	void discardRemainingInput()
+	{
+		char buf[1024];
+		while (true)
+		{
+			int res = read(fd, buf, 1024);
+			if (res == 0)
+			{
+				m_eof = true;
+				break;
+			}
+			if (res < 0)
+				throw wibble::exception::System("reading data");
+		}
+	}
+
 	// Write a string
 	void write(const std::string& str)
 	{
@@ -438,6 +455,7 @@
 					buf += line;
 					buf += "\n";
 				}
+				// conn.discardRemainingInput();
 				cfg.log() << "Got the patch" << endl;
 
 				// Parse the patch
@@ -489,6 +507,7 @@
 				out.close();
 
 				cfg.log() << "XX saved in " << fname << endl;
+				conn.write("200 OK\n");
 			}
 			else
 				conn.write("Command not recognized: " + cmd + "\n");

Modified: daemon/src/dp
==============================================================================
--- daemon/src/dp	(original)
+++ daemon/src/dp	Fri Oct  6 12:47:31 2006
@@ -17,7 +17,10 @@
 #
 
 # Read the query
-srv.patch(sys.stdin)
+srv.patch(sys.stdin.readlines())
+
+for line in srv.resultraw():
+	print line
 
 #for pkg, tags, desc in srv.resultpkgs():
 #	print pkg, "-", tags, "-", desc

Modified: daemon/src/dq
==============================================================================
--- daemon/src/dq	(original)
+++ daemon/src/dq	Fri Oct  6 12:47:31 2006
@@ -18,7 +18,7 @@
 
 # Read the query
 srv.query(" ".join(sys.argv[1:]))
-for line in srv.resulttag():
+for line in srv.resultraw():
 	print line
 #for pkg, tags, desc in srv.resultpkgs():
 #	print pkg, "-", tags, "-", desc



More information about the Debtags-commits mailing list