[Pgpool-hackers] Return value from SimpleForwardToBackend()

Fujii Masao fujii.masao at oss.ntt.co.jp
Tue May 22 03:30:40 UTC 2007


Hi,

Why does SimpleForwardToBackend() return POOL_CONTINUE when the message length
from the client is less than 4?

> 	if (pool_read(frontend, &sendlen, sizeof(sendlen)))
> 	{
> 		return POOL_END;
> 	}
> 
<snip>
> 
> 	len = ntohl(sendlen) - 4;
> 
> 	if (len <= 0)
> 		return POOL_CONTINUE;

In PostgreSQL, pq_getmessage() returns EOF with the error message at the same condition.
I think that SimpleForwardToBackend() should return POOL_END as follows.

> 	len = ntohl(sendlen) - 4;
>
> 	if (len == 0)
> 		return POOL_CONTINUE;
> 	else if (len < 0)
> 		return POOL_END;

Regards,


More information about the Pgpool-hackers mailing list