Mailing List Archive

NessusClient/nessus plugin_cache.c,1.2,1.3
Update of /usr/local/cvs/NessusClient/nessus
In directory raccoon.nessus.org:/tmp/cvs-serv16954/nessus

Modified Files:
plugin_cache.c
Log Message:
Correct and extend some comments


Index: plugin_cache.c
===================================================================
RCS file: /usr/local/cvs/NessusClient/nessus/plugin_cache.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- plugin_cache.c 4 Feb 2006 00:14:09 -0000 1.2
+++ plugin_cache.c 11 Apr 2006 15:23:26 -0000 1.3
@@ -276,6 +276,10 @@
* The parameter CONTEXT is the context whose plugins are to be written.
* The filename for the cache is determined with
* plugin_cache_get_filename.
+ * The parameter SERVER_MD5SUM should be the string with the hex-encoded
+ * md5sum reported by the server while connecting. It can also be the
+ * empty string for situations where the checking it will not be needed
+ * such as when storing the plugins for a report.
*
* The return value is 0 on success and != 0 otherwise.
*
@@ -597,19 +601,22 @@
return result;
}

-/* Read the plugin cache if it's still current
+/* Read the plugin cache and optionally check the md5sum for the cache
*
* CONTEXT is the context into which the cache should be read.
* SERVER_MD5SUM should be the string with the hex-encoded md5sum
* reported by the server while connecting. This md5sum is compared to
- * the md5sum read from the plugin cache for the context. If they match
- * the plugins of the context are read from the cache. Otherwise the
- * context object is not changed at all.
+ * the md5sum read from the plugin cache for the context and the cache
+ * is considered to be current if they match. It's OK to pass an empty
+ * string as the md5sum if the caller is not interested in the check.
*
- * If the return value is 0 the cache was current and the plugin
- * information has been read from the cache successfully. If the return
- * value is <0 and error occurred. If it's >0 the cache was not current
- * and the plugins have not been read.
+ * As long as no error occurs the plugins are read, even when the cache
+ * is not current so that e.g. the caller can update individual plugins
+ * withoug having to refetch all of them.
+ *
+ * If an error occurs the function returns a value < 0. Otherwise if
+ * the cache was current it returns 0 and a value > 0 if the cache was
+ * outdated.
*/
int
plugin_cache_read(struct context * context, const char * server_md5sum)

_______________________________________________
Nessus-cvs mailing list
Nessus-cvs@list.nessus.org
http://mail.nessus.org/mailman/listinfo/nessus-cvs