Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mike Perry
Tor
Commits
d8e5f3a3
Commit
d8e5f3a3
authored
21 years ago
by
Roger Dingledine
Browse files
Options
Downloads
Patches
Plain Diff
close immediately when write() fails too, else things will turn bad
svn:r1212
parent
dbdd2eaa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/or/connection.c
+8
-1
8 additions, 1 deletion
src/or/connection.c
with
8 additions
and
1 deletion
src/or/connection.c
+
8
−
1
View file @
d8e5f3a3
...
...
@@ -568,7 +568,12 @@ int connection_handle_write(connection_t *conn) {
conn
->
state
!=
OR_CONN_STATE_CONNECTING
)
{
if
(
conn
->
state
==
OR_CONN_STATE_HANDSHAKING
)
{
connection_stop_writing
(
conn
);
return
connection_tls_continue_handshake
(
conn
);
if
(
connection_tls_continue_handshake
(
conn
)
<
0
)
{
connection_close_immediate
(
conn
);
/* Don't flush; connection is dead. */
connection_mark_for_close
(
conn
,
0
);
return
-
1
;
}
return
0
;
}
/* else open, or closing */
...
...
@@ -576,6 +581,7 @@ int connection_handle_write(connection_t *conn) {
case
TOR_TLS_ERROR
:
case
TOR_TLS_CLOSE
:
log_fn
(
LOG_INFO
,
"tls error. breaking."
);
connection_close_immediate
(
conn
);
/* Don't flush; connection is dead. */
connection_mark_for_close
(
conn
,
0
);
return
-
1
;
/* XXX deal with close better */
case
TOR_TLS_WANTWRITE
:
...
...
@@ -601,6 +607,7 @@ int connection_handle_write(connection_t *conn) {
}
}
else
{
if
(
flush_buf
(
conn
->
s
,
conn
->
outbuf
,
&
conn
->
outbuf_flushlen
)
<
0
)
{
connection_close_immediate
(
conn
);
/* Don't flush; connection is dead. */
connection_mark_for_close
(
conn
,
END_STREAM_REASON_MISC
);
return
-
1
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment