mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-08-06 03:23:02 +00:00
Add flow control to saRecvQueue function.
(Logical change 1.55) git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@175 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
parent
ca88544979
commit
a697171df7
14
lib/util.c
14
lib/util.c
@ -96,7 +96,6 @@ saServiceConnect (
|
||||
return (SA_ERR_TRY_AGAIN);
|
||||
}
|
||||
|
||||
req_lib_init.header.magic = MESSAGE_MAGIC;
|
||||
req_lib_init.header.size = sizeof (req_lib_init);
|
||||
req_lib_init.header.id = initType;
|
||||
|
||||
@ -114,8 +113,8 @@ saServiceConnect (
|
||||
/*
|
||||
* Check for security errors
|
||||
*/
|
||||
if (res_lib_init.error != SA_OK) {
|
||||
error = res_lib_init.error;
|
||||
if (res_lib_init.header.error != SA_OK) {
|
||||
error = res_lib_init.header.error;
|
||||
goto error_exit;
|
||||
}
|
||||
|
||||
@ -161,7 +160,7 @@ retry_recv:
|
||||
}
|
||||
|
||||
struct message_overlay {
|
||||
struct message_header header;
|
||||
struct res_header header;
|
||||
char payload[4096];
|
||||
};
|
||||
|
||||
@ -178,14 +177,14 @@ saRecvQueue (
|
||||
SaErrorT error;
|
||||
|
||||
do {
|
||||
error = saRecvRetry (s, &message.header, sizeof (struct message_header),
|
||||
error = saRecvRetry (s, &message.header, sizeof (struct res_header),
|
||||
MSG_WAITALL | MSG_NOSIGNAL);
|
||||
if (error != SA_OK) {
|
||||
goto error_exit;
|
||||
}
|
||||
if (message.header.size > sizeof (struct message_header)) {
|
||||
if (message.header.size > sizeof (struct req_header)) {
|
||||
error = saRecvRetry (s, &message.payload,
|
||||
message.header.size - sizeof (struct message_header),
|
||||
message.header.size - sizeof (struct res_header),
|
||||
MSG_WAITALL | MSG_NOSIGNAL);
|
||||
if (error != SA_OK) {
|
||||
goto error_exit;
|
||||
@ -228,7 +227,6 @@ saActivatePoll (int s) {
|
||||
* Send activate poll to tell nodeexec to activate poll
|
||||
* on this file descriptor
|
||||
*/
|
||||
req_lib_activatepoll.header.magic = MESSAGE_MAGIC;
|
||||
req_lib_activatepoll.header.size = sizeof (req_lib_activatepoll);
|
||||
req_lib_activatepoll.header.id = MESSAGE_REQ_LIB_ACTIVATEPOLL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user