Commit 920d519
committed
Parse libpq's "keepalives" option more like other integer options.
Use pqParseIntParam (nee parse_int_param) instead of using strtol
directly. This allows trailing whitespace, which the previous coding
didn't, and makes the spelling of the error message consistent with
other similar cases.
This seems to be an oversight in commit e7a2217, which introduced
parse_int_param. That fixed places that were using atoi(), but missed
this place which was randomly using strtol() instead.
Ordinarily I'd consider this minor cleanup not worth back-patching.
However, it seems that ecpg assumes it can add trailing whitespace
to URL parameters, so that use of the keepalives option fails in
that context. Perhaps that's worth improving as a separate matter.
In the meantime, back-patch this to all supported branches.
Yuto Sasaki (some further cleanup by me)
Discussion: https://postgr.es/m/TY2PR01MB36286A7B97B9A15793335D18C1772@TY2PR01MB3628.jpnprd01.prod.outlook.com1 parent d94cf5c commit 920d519
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2169 | 2169 | | |
2170 | 2170 | | |
2171 | 2171 | | |
2172 | | - | |
2173 | 2172 | | |
2174 | 2173 | | |
2175 | 2174 | | |
2176 | 2175 | | |
2177 | | - | |
2178 | | - | |
| 2176 | + | |
| 2177 | + | |
2179 | 2178 | | |
| 2179 | + | |
2180 | 2180 | | |
2181 | 2181 | | |
2182 | 2182 | | |
| |||
3084 | 3084 | | |
3085 | 3085 | | |
3086 | 3086 | | |
3087 | | - | |
| 3087 | + | |
3088 | 3088 | | |
3089 | 3089 | | |
3090 | 3090 | | |
| |||
0 commit comments