From: Alex Rousskov Date: Fri, 19 Sep 2008 19:59:29 +0000 (-0600) Subject: Documented nasty side effects of ipcache_nbgethostbyname. X-Git-Tag: SQUID_3_1_0_1~49^2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79300bcbf81b7367e8f8415225a5c817d447bf93;p=thirdparty%2Fsquid.git Documented nasty side effects of ipcache_nbgethostbyname. --- diff --git a/src/ipcache.cc b/src/ipcache.cc index 4a653029a7..74be02a7eb 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -681,6 +681,14 @@ ipcacheHandleReply(void *data, rfc1035_rr * answers, int na, const char *error_m \param handler Pointer to the function to be called when the reply * from the IP cache (or the DNS if the IP cache misses) \param handlerData Information that is passed to the handler and does not affect the IP cache. + * + * XXX: on hits and some errors, the handler is called immediately instead + * of scheduling an async call. This reentrant behavior means that the + * user job must be extra careful after calling ipcache_nbgethostbyname, + * especially if the handler destroys the job. Moreover, the job has + * no way of knowing whether the reentrant call happened. commConnectStart + * protects the job by scheduling an async call, but some user code calls + * ipcache_nbgethostbyname directly. */ void ipcache_nbgethostbyname(const char *name, IPH * handler, void *handlerData)