]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Docs: READ_HANDLER and WRITE_HANDLER error handling requirements
authorAlex Dowad <alexinbeijing@gmail.com>
Wed, 29 Apr 2015 11:06:52 +0000 (04:06 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 29 Apr 2015 11:06:52 +0000 (04:06 -0700)
All existing READ_HANDLER functions return < 0 on error, so we can test that.
None of them overwrite errno before returning.

src/typedefs.h

index 3856eb7da0cecb3e80300950fd32a4099dc14f98..ff61bc6c4378b4690aecd3906ed310b90a4e595b 100644 (file)
@@ -56,7 +56,17 @@ typedef void IRCB(CachePeer *, peer_t, AnyP::ProtocolType, void *, void *data);
 
 class wordlist;
 typedef void UH(void *data, wordlist *);
+
+/**
+ * READ_HANDLER functions return < 0 if, and only if, they fail with an error.
+ * On error, they must pass back an error code in 'errno'.
+ */
 typedef int READ_HANDLER(int, char *, int);
+
+/**
+ * WRITE_HANDLER functions return < 0 if, and only if, they fail with an error.
+ * On error, they must pass back an error code in 'errno'.
+ */
 typedef int WRITE_HANDLER(int, const char *, int);
 
 typedef int QS(const void *, const void *); /* qsort */