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

Commitc2dc194

Browse files
committed
Adjust signature of walrcv_receive hook.
Commit314cbfc redefined the signature of this hook astypedef int (*walrcv_receive_type) (char **buffer, int *wait_fd);But in fact the type of the "wait_fd" variable ought to be pgsocket,which is what WaitLatchOrSocket expects, and which is necessary ifwe want to be able to assign PGINVALID_SOCKET to it on Windows.So fix that.
1 parent994f112 commitc2dc194

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

‎src/backend/replication/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ bool walrcv_connect(char *conninfo, XLogRecPtr startpoint)
1616
Establish connection to the primary, and starts streaming from 'startpoint'.
1717
Returns true on success.
1818

19-
int walrcv_receive(char **buffer,int *wait_fd)
19+
int walrcv_receive(char **buffer,pgsocket *wait_fd)
2020

2121
Retrieve any message available without blocking through the
2222
connection. If a message was successfully read, returns its
2323
length. If the connection is closed, returns -1. Otherwise returns 0
24-
to indicate that no data is available, and sets *wait_fd to afile
24+
to indicate that no data is available, and sets *wait_fd to asocket
2525
descriptor which can be waited on before trying again. On success, a
2626
pointer to the message payload is stored in *buffer. The returned
2727
buffer is valid until the next call to walrcv_* functions, and the

‎src/backend/replication/libpqwalreceiver/libpqwalreceiver.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static void libpqrcv_readtimelinehistoryfile(TimeLineID tli, char **filename, ch
5252
staticboollibpqrcv_startstreaming(TimeLineIDtli,XLogRecPtrstartpoint,
5353
char*slotname);
5454
staticvoidlibpqrcv_endstreaming(TimeLineID*next_tli);
55-
staticintlibpqrcv_receive(char**buffer,int*wait_fd);
55+
staticintlibpqrcv_receive(char**buffer,pgsocket*wait_fd);
5656
staticvoidlibpqrcv_send(constchar*buffer,intnbytes);
5757
staticvoidlibpqrcv_disconnect(void);
5858

@@ -472,14 +472,14 @@ libpqrcv_disconnect(void)
472472
* until the next libpqrcv_* call.
473473
*
474474
* If no data was available immediately, returns 0, and *wait_fd is set to a
475-
*file descriptor which can be waited on before trying again.
475+
*socket descriptor which can be waited on before trying again.
476476
*
477477
* -1 if the server ended the COPY.
478478
*
479479
* ereports on error.
480480
*/
481481
staticint
482-
libpqrcv_receive(char**buffer,int*wait_fd)
482+
libpqrcv_receive(char**buffer,pgsocket*wait_fd)
483483
{
484484
intrawlen;
485485

‎src/backend/replication/walreceiver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ WalReceiverMain(void)
379379
char*buf;
380380
intlen;
381381
boolendofwal= false;
382-
intwait_fd=PGINVALID_SOCKET;
382+
pgsocketwait_fd=PGINVALID_SOCKET;
383383
intrc;
384384

385385
/*

‎src/include/replication/walreceiver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ extern PGDLLIMPORT walrcv_startstreaming_type walrcv_startstreaming;
145145
typedefvoid (*walrcv_endstreaming_type) (TimeLineID*next_tli);
146146
externPGDLLIMPORTwalrcv_endstreaming_typewalrcv_endstreaming;
147147

148-
typedefint (*walrcv_receive_type) (char**buffer,int*wait_fd);
148+
typedefint (*walrcv_receive_type) (char**buffer,pgsocket*wait_fd);
149149
externPGDLLIMPORTwalrcv_receive_typewalrcv_receive;
150150

151151
typedefvoid (*walrcv_send_type) (constchar*buffer,intnbytes);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp