httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1125048 - in /httpd/apreq/trunk/library/t: at.c at.h
Date Thu, 19 May 2011 18:42:09 GMT
Author: joes
Date: Thu May 19 18:42:09 2011
New Revision: 1125048

URL: http://svn.apache.org/viewvc?rev=1125048&view=rev
Log:
bugs

Modified:
    httpd/apreq/trunk/library/t/at.c
    httpd/apreq/trunk/library/t/at.h

Modified: httpd/apreq/trunk/library/t/at.c
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/library/t/at.c?rev=1125048&r1=1125047&r2=1125048&view=diff
==============================================================================
--- httpd/apreq/trunk/library/t/at.c (original)
+++ httpd/apreq/trunk/library/t/at.c Thu May 19 18:42:09 2011
@@ -21,7 +21,7 @@
 
 #define AT_SUCCESS 0
 #define AT_EGENERAL 14
-
+#define min(a, b) ((a < b) ? a : b)
 
 int at_begin(at_t *t, int total)
 {
@@ -57,12 +57,12 @@ int at_comment(at_t *t, const char *fmt,
         return EINVAL;
 
 
-    end = b + rv;
+    end = b + min(rv, 250);
 
     buf[0] = '#';
     buf[1] = ' ';
 
-    if (rv == 250) {
+    if (rv >= 250) {
         end[-1] = '.';
         *end++ = '.';
         *end++ = '.';
@@ -117,10 +117,13 @@ void at_ok(at_t *t, int is_ok, const cha
         t->todo++;
         is_todo = 1;
     }
+    
+    if (AT_FLAG_TODO(t->flags))
+        is_todo = 1;
 
     if (AT_FLAG_CONCISE(t->flags))
         format[9] = '\0';
-    else if (is_ok && !AT_FLAG_TRACE(t->flags))
+    else if (is_ok && ! is_todo && !AT_FLAG_TRACE(t->flags))
         format[14] = '\0';
     else if (is_fatal && ! is_ok)
         comment = "fatal";
@@ -133,9 +136,9 @@ void at_ok(at_t *t, int is_ok, const cha
     if (rv <= 0)
         exit(-1);
 
-    end = buf + rv;
+    end = buf + min(rv, 250);
 
-    if (rv == 250) {
+    if (rv >= 250) {
         *end++ = '.';
         *end++ = '.';
         *end++ = '.';

Modified: httpd/apreq/trunk/library/t/at.h
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/library/t/at.h?rev=1125048&r1=1125047&r2=1125048&view=diff
==============================================================================
--- httpd/apreq/trunk/library/t/at.h (original)
+++ httpd/apreq/trunk/library/t/at.h Thu May 19 18:42:09 2011
@@ -100,6 +100,9 @@ void at_end(at_t *t);
 #define AT_end() at_end(AT)
 
 
+#define AT_FLAG_TODO(f)       ((f) & 8)
+#define AT_FLAG_TODO_ON(f)    ((f) |= 8)
+#define AT_FLAG_TODO_OFF(f)   ((f) &= ~8)
 #define AT_FLAG_DEBUG(f)       ((f) & 4)
 #define AT_FLAG_DEBUG_ON(f)    ((f) |= 4)
 #define AT_FLAG_DEBUG_OFF(f)   ((f) &= ~4)
@@ -110,6 +113,8 @@ void at_end(at_t *t);
 #define AT_FLAG_CONCISE_ON(f)  ((f) |= 1)
 #define AT_FLAG_CONCISE_OFF(f) ((f) &= ~1)
 
+#define AT_todo_on()       AT_FLAG_TODO_ON(AT->flags)
+#define AT_todo_off()      AT_FLAG_TODO_OFF(AT->flags)
 #define AT_debug_on()      AT_FLAG_DEBUG_ON(AT->flags)
 #define AT_debug_off()     AT_FLAG_DEBUG_OFF(AT->flags)
 #define AT_trace_on()      AT_FLAG_TRACE_ON(AT->flags)



Mime
View raw message