summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-06-01 17:31:13 +0000
committerRoger Dingledine <arma@torproject.org>2004-06-01 17:31:13 +0000
commit4181d18b3ddb8eafe64a339392b6c42a7fdc9f5d (patch)
tree1a81c8a514e9669ec7f3673973039cda25deb02b
parent1ef411fefdde460a03d0c37d1893fee20d450602 (diff)
downloadtor-4181d18b3ddb8eafe64a339392b6c42a7fdc9f5d.tar.gz
tor-4181d18b3ddb8eafe64a339392b6c42a7fdc9f5d.zip
declare the epipe bug a non-bug.
now we catch and ignore epipe signals, and when write returns epipe, we simply return -1 and close the socket/connection. svn:r1928
-rw-r--r--src/or/buffers.c2
-rw-r--r--src/or/main.c4
2 files changed, 1 insertions, 5 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index a67f47bee5..13824a20a7 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -250,8 +250,6 @@ int flush_buf(int s, buf_t *buf, int *buf_flushlen)
write_result = send(s, buf->mem, *buf_flushlen, 0);
if (write_result < 0) {
if(!ERRNO_IS_EAGAIN(tor_socket_errno(s))) { /* it's a real error */
- /* get a stack trace to find epipe bugs */
- tor_assert(tor_socket_errno(s) != EPIPE);
return -1;
}
log_fn(LOG_DEBUG,"write() would block, returning.");
diff --git a/src/or/main.c b/src/or/main.c
index 1a75158bf4..f6709cd2f3 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -347,8 +347,6 @@ static void run_connection_housekeeping(int i, time_t now) {
!conn->marked_for_close &&
conn->timestamp_lastwritten + 5*60 < now) {
log_fn(LOG_WARN,"Expiring wedged directory conn (fd %d, purpose %d)", conn->s, conn->purpose);
- /* XXXX This next check may help isolate where the pesky EPIPE bug
- * really occurs. */
if (connection_wants_to_flush(conn)) {
if(flush_buf(conn->s, conn->outbuf, &conn->outbuf_flushlen) < 0) {
log_fn(LOG_WARN,"flushing expired directory conn failed.");
@@ -752,7 +750,7 @@ static void catch(int the_signal) {
unlink(options.PidFile);
exit(0);
case SIGPIPE:
- log(LOG_WARN,"Bug: caught sigpipe. Ignoring.");
+ log(LOG_INFO,"Caught sigpipe. Ignoring.");
break;
case SIGHUP:
please_reset = 1;