summaryrefslogtreecommitdiff
path: root/src/or/cpuworker.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-03-11 06:35:03 +0000
committerNick Mathewson <nickm@torproject.org>2004-03-11 06:35:03 +0000
commit976bacae944cde32da6dedb7910538929f933452 (patch)
treea29eee029da1af0164425ac497fc0922a932777e /src/or/cpuworker.c
parent060d721554695cd689d5873cdd366d59721ada46 (diff)
downloadtor-976bacae944cde32da6dedb7910538929f933452.tar.gz
tor-976bacae944cde32da6dedb7910538929f933452.zip
Make all the other read/writes into recv/sends, except when they shouldn't be.
svn:r1260
Diffstat (limited to 'src/or/cpuworker.c')
-rw-r--r--src/or/cpuworker.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index 77e185fdf2..9fcf64bb09 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -132,19 +132,19 @@ int cpuworker_main(void *data) {
for(;;) {
- if(read(fd, &question_type, 1) != 1) {
+ if(recv(fd, &question_type, 1, 0) != 1) {
// log_fn(LOG_ERR,"read type failed. Exiting.");
log_fn(LOG_INFO,"cpuworker exiting because tor process died.");
spawn_exit();
}
assert(question_type == CPUWORKER_TASK_ONION);
- if(read_all(fd, tag, TAG_LEN) != TAG_LEN) {
+ if(read_all(fd, tag, TAG_LEN, 1) != TAG_LEN) {
log_fn(LOG_ERR,"read tag failed. Exiting.");
spawn_exit();
}
- if(read_all(fd, question, ONIONSKIN_CHALLENGE_LEN) != ONIONSKIN_CHALLENGE_LEN) {
+ if(read_all(fd, question, ONIONSKIN_CHALLENGE_LEN, 1) != ONIONSKIN_CHALLENGE_LEN) {
log_fn(LOG_ERR,"read question failed. Exiting.");
spawn_exit();
}
@@ -163,7 +163,7 @@ int cpuworker_main(void *data) {
memcpy(buf+1+TAG_LEN,reply_to_proxy,ONIONSKIN_REPLY_LEN);
memcpy(buf+1+TAG_LEN+ONIONSKIN_REPLY_LEN,keys,40+32);
}
- if(write_all(fd, buf, LEN_ONION_RESPONSE) != LEN_ONION_RESPONSE) {
+ if(write_all(fd, buf, LEN_ONION_RESPONSE, 1) != LEN_ONION_RESPONSE) {
log_fn(LOG_ERR,"writing response buf failed. Exiting.");
spawn_exit();
}