Close message file after parsing message headers
authorMikhail Gusarov <dottedmag@dottedmag.net>
Tue, 17 Nov 2009 15:28:37 +0000 (21:28 +0600)
committerCarl Worth <cworth@cworth.org>
Tue, 17 Nov 2009 16:53:16 +0000 (08:53 -0800)
Keeping unused files open helps to see "Too many open files" often.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
lib/message-file.c

index 8a3f8ee0fd2b66e04e0dd3e68b4abea37ae591f7..197ab0143f18e029cdd3b8858ce087fde507c3a4 100644 (file)
@@ -325,6 +325,11 @@ notmuch_message_file_get_header (notmuch_message_file_t *message,
            return decoded_value;
     }
 
            return decoded_value;
     }
 
+    if (message->parsing_finished) {
+        fclose (message->file);
+        message->file = NULL;
+    }
+
     if (message->line)
        free (message->line);
     message->line = NULL;
     if (message->line)
        free (message->line);
     message->line = NULL;