Log occurrance of oversized request only once, so that the integrityhuge check doesn...
authorWouter Verhelst <w@uter.be>
Thu, 21 Jul 2011 07:47:50 +0000 (09:47 +0200)
committerWouter Verhelst <w@uter.be>
Thu, 21 Jul 2011 07:48:02 +0000 (09:48 +0200)
nbd-server.c

index c4ea270ac18e0633e88a033f1c728924d1152ceb..b342ac4d67935fc93b3ab08dc8a5a967dd3aabd5 100644 (file)
@@ -179,6 +179,8 @@ char* modern_listen;          /**< listenaddr value for modernsock */
 char* modernport=NBD_DEFAULT_PORT; /**< Port number on which to listen for
                                      new-style nbd-client connections */
 
+bool logged_oversized=false;  /**< whether we logged oversized requests already */
+
 /**
  * Types of virtuatlization
  **/
@@ -1551,7 +1553,10 @@ int mainloop(CLIENT *client) {
                        currlen = len;
                        if (currlen > BUFSIZE - sizeof(struct nbd_reply)) {
                                currlen = BUFSIZE - sizeof(struct nbd_reply);
-                               msg2(LOG_DEBUG, "oversized request (this is not a problem)");
+                               if(!logged_oversized) {
+                                       msg2(LOG_DEBUG, "oversized request (this is not a problem)");
+                                       logged_oversized = true;
+                               }
                        }
                }