summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2e2f91c)
The write_nonblock() variant is safer here as it allows to let the
callers deal with short writes.
Despite the name, write_nonblock() can be used for both blocking and
non-blocking fds. It will be renamed in a subsequent patch.
memcpy(remainder, buf + l1, len - l1);
RC4(&scc->send->key, len - l1, remainder, tmp + l1);
}
memcpy(remainder, buf + l1, len - l1);
RC4(&scc->send->key, len - l1, remainder, tmp + l1);
}
- ret = write_all(scc->fd, (char *)tmp, len);
+ ret = write_nonblock(scc->fd, (char *)tmp, len);
gret = gcry_cipher_encrypt(scc->send->handle, tmp, size,
(unsigned char *)buf, size);
assert(gret == 0);
gret = gcry_cipher_encrypt(scc->send->handle, tmp, size,
(unsigned char *)buf, size);
assert(gret == 0);
- ret = write_all(scc->fd, (char *)tmp, size);
+ ret = write_nonblock(scc->fd, (char *)tmp, size);