From: Alex Dowad Date: Wed, 29 Apr 2015 11:06:52 +0000 (-0700) Subject: Docs: READ_HANDLER and WRITE_HANDLER error handling requirements X-Git-Tag: merge-candidate-3-v1~147 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ee9758944012513888128cb1179c3de1b9439ee;p=thirdparty%2Fsquid.git Docs: READ_HANDLER and WRITE_HANDLER error handling requirements All existing READ_HANDLER functions return < 0 on error, so we can test that. None of them overwrite errno before returning. --- diff --git a/src/typedefs.h b/src/typedefs.h index 3856eb7da0..ff61bc6c43 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -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 */