RE: Timeout parameters

Поиск
Список
Период
Сортировка
От Tsunakawa, Takayuki
Тема RE: Timeout parameters
Дата
Msg-id 0A3221C70F24FB45833433255569204D1FBECD0B@G01JPEXMBYT05
обсуждение исходный текст
Ответ на RE: Timeout parameters  ("Nagaura, Ryohei" <nagaura.ryohei@jp.fujitsu.com>)
Ответы RE: Timeout parameters
Список pgsql-hackers
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





В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: Misleading errors with column references in default expressionsand partition bounds
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Syntax diagrams in user documentation