summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorBo Yang <boyang@samba.org>2009-05-19 01:13:36 +0800
committerBo Yang <boyang@samba.org>2009-05-19 01:13:36 +0800
commitaa70e44cd0576e5280e24cf35000369a47dd958f (patch)
tree00a54b9f6be481d8f9815172ba53c33a0efa0bbc /source3/libsmb
parent2722dd357cedcd3fad1e3739a4a64f924d53eccb (diff)
downloadsamba-aa70e44cd0576e5280e24cf35000369a47dd958f.tar.gz
samba-aa70e44cd0576e5280e24cf35000369a47dd958f.tar.bz2
samba-aa70e44cd0576e5280e24cf35000369a47dd958f.zip
s3: tevent_req_poll() loops forever when pipe is broken
Signed-off-by: Bo Yang <boyang@samba.org>
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/async_smb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 7afba0dae9..96b7054b87 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -742,6 +742,10 @@ static void cli_smb_sent(struct tevent_req *subreq)
nwritten = writev_recv(subreq, &err);
TALLOC_FREE(subreq);
if (nwritten == -1) {
+ if (err == EPIPE) {
+ close(state->cli->fd);
+ state->cli->fd = -1;
+ }
tevent_req_nterror(req, map_nt_error_from_unix(err));
return;
}
@@ -787,6 +791,10 @@ static void cli_smb_received(struct tevent_req *subreq)
received = read_smb_recv(subreq, talloc_tos(), &inbuf, &err);
TALLOC_FREE(subreq);
if (received == -1) {
+ if (err == EPIPE) {
+ close(cli->fd);
+ cli->fd = -1;
+ }
status = map_nt_error_from_unix(err);
goto fail;
}