| 9 | } |
| 10 | |
| 11 | bool TOperationWrite::Execute(int errorCode) { |
| 12 | if (errorCode) { |
| 13 | H_(errorCode, Written_, *this); |
| 14 | |
| 15 | return true; //op. completed |
| 16 | } |
| 17 | |
| 18 | TErrorCode ec; |
| 19 | TContIOVector& iov = *Buffs_->GetIOvec(); |
| 20 | |
| 21 | size_t n = S_.WriteSome(iov, ec); |
| 22 | |
| 23 | if (ec && ec.Value() != EAGAIN && ec.Value() != EWOULDBLOCK) { |
| 24 | H_(ec, Written_ + n, *this); |
| 25 | |
| 26 | return true; |
| 27 | } |
| 28 | |
| 29 | if (n) { |
| 30 | Written_ += n; |
| 31 | iov.Proceed(n); |
| 32 | if (!iov.Bytes()) { |
| 33 | H_(ec, Written_, *this); |
| 34 | |
| 35 | return true; //op. completed |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | return false; //operation not compleled |
| 40 | } |
| 41 | |
| 42 | bool TOperationWriteVector::Execute(int errorCode) { |
| 43 | if (errorCode) { |