Nagaura-san,
The socket_timeout patch needs the following fixes. Now that others have already tested these patches successfully,
theyappear committable to me.
(1)
+ else
+ goto iiv_error;
...
+
+iiv_error:
+ conn->status = CONNECTION_BAD;
+ printfPQExpBuffer(&conn->errorMessage,
+ libpq_gettext("invalid integer value for socket_timeout\n"));
+ return false;
This goto and its corresponding iiv_error label are redundant. You can just set the error message and return at the
callsite of parse_int_param(). i.e.:
if (!parse_int_param(...))
{
error processing
return false;
}
if(conn->socket_timeout > 0 && conn->socket_timeout < 2)
conn->socket_timeout = 2;
The reason why oom_error label is present is that it is used at multiple places to avoid repeating the same error
processingcode.
(2)
+ conn->sock = -1;
Use PGINVALID_SOCKET instead of -1.
Regards
Takayuki Tsunakawa