version 1.63, 2003/11/21 11:57:03 |
version 1.63.2.1, 2004/08/19 04:13:26 |
|
|
* Wait for response from the agent. First read the length of the |
* Wait for response from the agent. First read the length of the |
* response packet. |
* response packet. |
*/ |
*/ |
len = 4; |
if (atomicio(read, auth->fd, buf, 4) != 4) { |
while (len > 0) { |
error("Error reading response length from authentication socket."); |
l = read(auth->fd, buf + 4 - len, len); |
return 0; |
if (l == -1 && (errno == EAGAIN || errno == EINTR)) |
|
continue; |
|
if (l <= 0) { |
|
error("Error reading response length from authentication socket."); |
|
return 0; |
|
} |
|
len -= l; |
|
} |
} |
|
|
/* Extract the length, and check it for sanity. */ |
/* Extract the length, and check it for sanity. */ |
|
|
l = len; |
l = len; |
if (l > sizeof(buf)) |
if (l > sizeof(buf)) |
l = sizeof(buf); |
l = sizeof(buf); |
l = read(auth->fd, buf, l); |
l = atomicio(read, auth->fd, buf, l); |
if (l == -1 && (errno == EAGAIN || errno == EINTR)) |
|
continue; |
|
if (l <= 0) { |
if (l <= 0) { |
error("Error reading response from authentication socket."); |
error("Error reading response from authentication socket."); |
return 0; |
return 0; |