]> granicus.if.org Git - libevent/commitdiff
r16735@catbus: nickm | 2007-11-26 14:24:58 -0500
authorNick Mathewson <nickm@torproject.org>
Mon, 26 Nov 2007 19:25:09 +0000 (19:25 +0000)
committerNick Mathewson <nickm@torproject.org>
Mon, 26 Nov 2007 19:25:09 +0000 (19:25 +0000)
 Fix test for EVBUFFER_LENGTH in evhttp_make_header().  Since appending an empty buffer to another is a no-op, this is not really a bug-fix.

svn:r554

http.c

diff --git a/http.c b/http.c
index 49d803eff18f8c20fcc471d22744756502ca5d87..f0f1f6c81c046d459386845e075eb39419653983 100644 (file)
--- a/http.c
+++ b/http.c
@@ -441,9 +441,7 @@ evhttp_make_header(struct evhttp_connection *evcon, struct evhttp_request *req)
        }
        evbuffer_add(evcon->output_buffer, "\r\n", 2);
 
-       /* XXX EVBUFFER_LENGTH returns an unsigned value, so this test
-        *      is always true. What is the intent of this test? -NM */
-       if (1) { // || EVBUFFER_LENGTH(req->output_buffer) >= 0) {
+       if (EVBUFFER_LENGTH(req->output_buffer) > 0) {
                /*
                 * For a request, we add the POST data, for a reply, this
                 * is the regular data.