Fix typo and use of hard-coded value
authorDavin McCall <davmac@davmac.org>
Wed, 1 Jan 2020 01:00:54 +0000 (11:00 +1000)
committerDavin McCall <davmac@davmac.org>
Wed, 1 Jan 2020 01:00:54 +0000 (11:00 +1000)
src/control.cc

index ec8217da580c2d9dcf513238fca2fdf18b9f27db..061cce0a7e1e08010edb2775ff8e41adee1dffc9 100644 (file)
@@ -1014,9 +1014,9 @@ bool control_conn_t::data_ready() noexcept
             return false;
         }
     }
-    else if (rbuf.get_length() == 1024) {
+    else if (rbuf.get_length() == rbuf.get_size()) {
         // Too big packet
-        log(loglevel_t::WARN, "Received too-large control package; dropping connection");
+        log(loglevel_t::WARN, "Received too-large control packet; dropping connection");
         bad_conn_close = true;
         iob.set_watches(OUT_EVENTS);
     }