INN commit: trunk/nnrpd (python.c)

INN Commit Russ_Allbery at isc.org
Sat Jul 5 11:10:06 UTC 2008


    Date: Saturday, July 5, 2008 @ 04:10:05
  Author: iulius
Revision: 7930

Use the same internal error codes as perl.c.

Modified:
  trunk/nnrpd/python.c

----------+
 python.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Modified: python.c
===================================================================
--- python.c	2008-06-29 17:55:04 UTC (rev 7929)
+++ python.c	2008-07-05 11:10:05 UTC (rev 7930)
@@ -171,7 +171,7 @@
         || ((PyTuple_Size(result) != 2) && (PyTuple_Size(result) != 3)))
     {
         syslog(L_ERROR, "python authenticate method returned wrong result");
-	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
+	Reply("%d Internal Error (2).  Goodbye\r\n", NNTP_ERR_ACCESS);
 	ExitWithStats(1, true);
     }
 
@@ -182,7 +182,7 @@
     if (!PyInt_Check(item))
     {
         syslog(L_ERROR, "python authenticate method returned bad NNTP response code");
-	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
+	Reply("%d Internal Error (2).  Goodbye\r\n", NNTP_ERR_ACCESS);
 	ExitWithStats(1, true);
     }
 
@@ -196,7 +196,7 @@
     if (!PyString_Check(item))
     {
         syslog(L_ERROR, "python authenticate method returned bad error string");
-	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
+	Reply("%d Internal Error (2).  Goodbye\r\n", NNTP_ERR_ACCESS);
 	ExitWithStats(1, true);
     }
 
@@ -212,7 +212,7 @@
         /* Check the item. */
         if (!PyString_Check(item)) {
             syslog(L_ERROR, "python authenticate method returned bad username string");
-            Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
+            Reply("%d Internal Error (2).  Goodbye\r\n", NNTP_ERR_ACCESS);
             ExitWithStats(1, true);
         }
 
@@ -260,7 +260,7 @@
     /* Exit if access method is not defined. */
     if (proc == NULL) {
         syslog(L_ERROR, "python access method not defined");
- 	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
+ 	Reply("%d Internal Error (3).  Goodbye\r\n", NNTP_ERR_ACCESS);
  	ExitWithStats(1, true);
      }
  
@@ -307,7 +307,7 @@
     /* Check the response. */
     if (result == NULL || result == Py_None || !PyDict_Check(result)) {
         syslog(L_ERROR, "python access method returned wrong result -- expected a dictionary");
-	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
+	Reply("%d Internal Error (2).  Goodbye\r\n", NNTP_ERR_ACCESS);
 	ExitWithStats(1, true);
      }
  
@@ -321,12 +321,12 @@
     while(PyDict_Next(result, &i, &key, &value)) {
         if (!PyString_Check(key)) {
             syslog(L_ERROR, "python access method return dictionary key %i not a string", i);
-            Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
+            Reply("%d Internal Error (2).  Goodbye\r\n", NNTP_ERR_ACCESS);
             ExitWithStats(1, false);
         }
         if (!PyString_Check(value)) {
             syslog(L_ERROR, "python access method return dictionary value %i not a string", i);
-            Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
+            Reply("%d Internal Error (2).  Goodbye\r\n", NNTP_ERR_ACCESS);
             ExitWithStats(1, false);
         }
         
@@ -445,7 +445,7 @@
     if (result == NULL || (result != Py_None && !PyString_Check(result)))
     {
         syslog(L_ERROR, "python dynamic method (%s access) returned wrong result", PostFlag ? "post" : "read");
-	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
+	Reply("%d Internal Error (2).  Goodbye\r\n", NNTP_ERR_ACCESS);
 	ExitWithStats(1, false);
     }
 
@@ -760,7 +760,7 @@
         /* See if nnrpd auth object is defined in auth module. */
         if (PYAuthObject == NULL) {
             syslog(L_ERROR, "python auth object is not defined");
-            Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
+            Reply("%d Internal Error (3).  Goodbye\r\n", NNTP_ERR_ACCESS);
             PY_close_python();
             ExitWithStats(1, false);
         } else {



More information about the inn-committers mailing list