Mercurial > dropbear
comparison cli-agentfwd.c @ 773:a9f2a6ae4eb5
merge
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 14 Apr 2013 22:49:19 +0800 |
parents | 0fd32a552ea5 |
children | f336d232fc63 |
comparison
equal
deleted
inserted
replaced
772:7fc0aeada79c | 773:a9f2a6ae4eb5 |
---|---|
154 if (readlen > MAX_AGENT_REPLY) { | 154 if (readlen > MAX_AGENT_REPLY) { |
155 TRACE(("agent reply is too big")); | 155 TRACE(("agent reply is too big")); |
156 goto out; | 156 goto out; |
157 } | 157 } |
158 | 158 |
159 TRACE(("agent_request readlen is %d", readlen)) | |
160 | |
161 buf_resize(inbuf, readlen); | 159 buf_resize(inbuf, readlen); |
162 buf_setpos(inbuf, 0); | 160 buf_setpos(inbuf, 0); |
163 ret = atomicio(read, fd, buf_getwriteptr(inbuf, readlen), readlen); | 161 ret = atomicio(read, fd, buf_getwriteptr(inbuf, readlen), readlen); |
164 if ((size_t)ret != readlen) { | 162 if ((size_t)ret != readlen) { |
165 TRACE(("read of data failed for agent_request")) | 163 TRACE(("read of data failed for agent_request")) |
166 goto out; | 164 goto out; |
167 } | 165 } |
168 buf_incrwritepos(inbuf, readlen); | 166 buf_incrwritepos(inbuf, readlen); |
169 buf_setpos(inbuf, 0); | 167 buf_setpos(inbuf, 0); |
170 TRACE(("agent_request success, length %d", readlen)) | |
171 | 168 |
172 out: | 169 out: |
173 if (payload) | 170 if (payload) |
174 buf_free(payload); | 171 buf_free(payload); |
175 | 172 |