Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4dec98c

Browse files
committed
libpq: Move pg_cancel to fe-cancel.c
No other files need to access this struct, so there is no need to haveits definition in a header file.Author: Jelte Fennema-Nio <postgres@jeltef.nl>Discussion:https://postgr.es/m/202403061822.spfzqbf7dsgg@alvherre.pgsql
1 parentd6e171f commit4dec98c

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

‎src/interfaces/libpq/fe-cancel.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,26 @@
2121
#include"libpq-int.h"
2222
#include"port/pg_bswap.h"
2323

24+
25+
/*
26+
* pg_cancel (backing struct for PGcancel) stores all data necessary to send a
27+
* cancel request.
28+
*/
29+
structpg_cancel
30+
{
31+
SockAddrraddr;/* Remote address */
32+
intbe_pid;/* PID of to-be-canceled backend */
33+
intbe_key;/* cancel key of to-be-canceled backend */
34+
intpgtcp_user_timeout;/* tcp user timeout */
35+
intkeepalives;/* use TCP keepalives? */
36+
intkeepalives_idle;/* time between TCP keepalives */
37+
intkeepalives_interval;/* time between TCP keepalive
38+
* retransmits */
39+
intkeepalives_count;/* maximum number of TCP keepalive
40+
* retransmits */
41+
};
42+
43+
2444
/*
2545
* PQgetCancel: get a PGcancel structure corresponding to a connection.
2646
*

‎src/interfaces/libpq/libpq-int.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -621,24 +621,6 @@ struct pg_conn
621621
PQExpBufferDataworkBuffer;/* expansible string */
622622
};
623623

624-
/* PGcancel stores all data necessary to cancel a connection. A copy of this
625-
* data is required to safely cancel a connection running on a different
626-
* thread.
627-
*/
628-
structpg_cancel
629-
{
630-
SockAddrraddr;/* Remote address */
631-
intbe_pid;/* PID of backend --- needed for cancels */
632-
intbe_key;/* key of backend --- needed for cancels */
633-
intpgtcp_user_timeout;/* tcp user timeout */
634-
intkeepalives;/* use TCP keepalives? */
635-
intkeepalives_idle;/* time between TCP keepalives */
636-
intkeepalives_interval;/* time between TCP keepalive
637-
* retransmits */
638-
intkeepalives_count;/* maximum number of TCP keepalive
639-
* retransmits */
640-
};
641-
642624

643625
/* String descriptions of the ExecStatusTypes.
644626
* direct use of this array is deprecated; call PQresStatus() instead.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp