Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
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
The Tor Project
Core
Tor
Commits
29da03cb
Commit
29da03cb
authored
22 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Be loud when decompressing
svn:r213
parent
fceb4572
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/or/buffers.c
+3
-0
3 additions, 0 deletions
src/or/buffers.c
src/or/connection.c
+1
-1
1 addition, 1 deletion
src/or/connection.c
src/or/connection_exit.c
+8
-4
8 additions, 4 deletions
src/or/connection_exit.c
with
12 additions
and
5 deletions
src/or/buffers.c
+
3
−
0
View file @
29da03cb
...
...
@@ -192,6 +192,9 @@ int decompress_buf_to_buf(char **buf_in, int *buflen_in, int *buf_datalen_in,
{
case
Z_OK
:
case
Z_STREAM_END
:
log
(
LOG_DEBUG
,
"Uncompressed (%d/%d); filled (%d/%d)"
,
*
buf_datalen_in
-
zstream
->
avail_in
,
*
buf_datalen_in
,
*
buf_datalen_out
-
zstream
->
avail_out
,
*
buf_datalen_out
);
memmove
(
*
buf_in
,
zstream
->
next_in
,
zstream
->
avail_in
);
*
buf_datalen_in
=
zstream
->
avail_in
;
*
buf_datalen_out
=
*
buflen_out
-
zstream
->
avail_out
;
...
...
This diff is collapsed.
Click to expand it.
src/or/connection.c
+
1
−
1
View file @
29da03cb
...
...
@@ -744,7 +744,7 @@ repeat_connection_package_raw_inbuf:
return
-
1
;
}
log
(
LOG_DEBUG
,
"connection_package_raw_inbuf(): (%d) Packaging %d bytes (%d waiting)."
,
conn
->
s
,
cell
.
length
,
amount_to_process
);
log
(
LOG_DEBUG
,
"connection_package_raw_inbuf(): (%d) Packaging %d bytes (%d waiting)."
,
conn
->
s
,
cell
.
length
,
conn
->
inbuf_datalen
);
*
(
uint16_t
*
)(
cell
.
payload
+
2
)
=
htons
(
conn
->
topic_id
);
*
cell
.
payload
=
TOPIC_COMMAND_DATA
;
...
...
This diff is collapsed.
Click to expand it.
src/or/connection_exit.c
+
8
−
4
View file @
29da03cb
...
...
@@ -196,6 +196,7 @@ int connection_exit_process_data_cell(cell_t *cell, circuit_t *circ) {
connection_t
*
conn
;
int
topic_command
;
int
topic_id
;
int
len
;
static
int
num_seen
=
0
;
/* an outgoing data cell has arrived */
...
...
@@ -248,16 +249,19 @@ int connection_exit_process_data_cell(cell_t *cell, circuit_t *circ) {
if
(
conn
->
state
!=
EXIT_CONN_STATE_OPEN
)
{
log
(
LOG_DEBUG
,
"connection_exit_process_data_cell(): data received while resolving/connecting. Queueing."
);
}
log
(
LOG_DEBUG
,
"connection_exit_process_data_cell(): put %d bytes on outbuf."
,
cell
->
length
-
TOPIC_HEADER_SIZE
);
#ifdef USE_ZLIB
if
(
connection_decompress_to_buf
(
cell
->
payload
+
TOPIC_HEADER_SIZE
,
cell
->
length
-
TOPIC_HEADER_SIZE
,
conn
,
Z_SYNC_FLUSH
)
<
0
)
{
log
(
LOG_DEBUG
,
"connection_exit_process_data_cell(): uncompressing %d bytes onto outbuf..."
,
cell
->
length
-
TOPIC_HEADER_SIZE
);
len
=
connection_decompress_to_buf
(
cell
->
payload
+
TOPIC_HEADER_SIZE
,
cell
->
length
-
TOPIC_HEADER_SIZE
,
conn
,
Z_SYNC_FLUSH
);
log
(
LOG_DEBUG
,
"%d bytes written"
,
len
);
if
(
len
<
0
)
{
log
(
LOG_INFO
,
"connection_exit_process_data_cell(): write to buf failed. Marking for close."
);
conn
->
marked_for_close
=
1
;
return
0
;
}
#else
log
(
LOG_DEBUG
,
"connection_exit_process_data_cell(): put %d bytes on outbuf."
,
cell
->
length
-
TOPIC_HEADER_SIZE
);
if
(
connection_write_to_buf
(
cell
->
payload
+
TOPIC_HEADER_SIZE
,
cell
->
length
-
TOPIC_HEADER_SIZE
,
conn
)
<
0
)
{
log
(
LOG_INFO
,
"connection_exit_process_data_cell(): write to buf failed. Marking for close."
);
...
...
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