forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit724e30c
committed
Ensure we discard unread/unsent data when abandoning a connection attempt.
There are assorted situations wherein PQconnectPoll() will abandon aconnection attempt and try again with different parameters (eg, SSL versusnot SSL). However, the code forgot to discard any pending data in libpq'sI/O buffers when doing this. In at least one case (server returns Emessage during SSL negotiation), there is unread input data which bollixesthe next connection attempt. I have not checked to see whether this ispossible in the other cases where we close the socket and retry, but itseems like a matter of good defensive programming to add explicitbuffer-flushing code to all of them.This is one of several issues exposed by Daniel Farina's report ofmisbehavior after a server-side fork failure.This has been wrong since forever, so back-patch to all supported branches.1 parent4bd7333 commit724e30c
1 file changed
+18
-0
lines changedLines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2068 | 2068 |
| |
2069 | 2069 |
| |
2070 | 2070 |
| |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
2071 | 2074 |
| |
2072 | 2075 |
| |
2073 | 2076 |
| |
| |||
2105 | 2108 |
| |
2106 | 2109 |
| |
2107 | 2110 |
| |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
2108 | 2114 |
| |
2109 | 2115 |
| |
2110 | 2116 |
| |
| |||
2218 | 2224 |
| |
2219 | 2225 |
| |
2220 | 2226 |
| |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
2221 | 2230 |
| |
2222 | 2231 |
| |
2223 | 2232 |
| |
| |||
2285 | 2294 |
| |
2286 | 2295 |
| |
2287 | 2296 |
| |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
2288 | 2300 |
| |
2289 | 2301 |
| |
2290 | 2302 |
| |
| |||
2304 | 2316 |
| |
2305 | 2317 |
| |
2306 | 2318 |
| |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
2307 | 2322 |
| |
2308 | 2323 |
| |
2309 | 2324 |
| |
| |||
2467 | 2482 |
| |
2468 | 2483 |
| |
2469 | 2484 |
| |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
2470 | 2488 |
| |
2471 | 2489 |
| |
2472 | 2490 |
| |
|
0 commit comments
Comments
(0)