Improved HTTP response length handling #1204

Merged
itamarst merged 17 commits from 3907-http-response-lengths into master 2022-07-22 16:37:17 +00:00
itamarst commented 2022-07-20 16:12:23 +00:00 (Migrated from github.com)

Fixes https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3907

There's a few error handling codepaths that aren't handled, like "mutable changed out from under you" or "there's a bug!". Can try to figure something out if reviewer feels it's useful.

Fixes https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3907 There's a few error handling codepaths that aren't handled, like "mutable changed out from under you" or "there's a bug!". Can try to figure something out if reviewer feels it's useful.
itamarst commented 2022-07-20 18:47:44 +00:00 (Migrated from github.com)

BOOOOOO

2022-07-20T18:45:16.4509660Z coveralls.exception.CoverallsException: Could not submit coverage: 504 Server Error: Gateway Time-out for url: https://coveralls.io/api/v1/jobs
BOOOOOO ``` 2022-07-20T18:45:16.4509660Z coveralls.exception.CoverallsException: Could not submit coverage: 504 Server Error: Gateway Time-out for url: https://coveralls.io/api/v1/jobs ```
coveralls commented 2022-07-20 20:31:35 +00:00 (Migrated from github.com)

Coverage Status

Coverage decreased (-0.04%) to 94.701% when pulling 94e0568653 on 3907-http-response-lengths into 69f90e6336 on master.

[![Coverage Status](https://coveralls.io/builds/51090897/badge)](https://coveralls.io/builds/51090897) Coverage decreased (-0.04%) to 94.701% when pulling **94e0568653a2fc49e33ba4be8c1f86b82aa48737 on 3907-http-response-lengths** into **69f90e6336c58a22143c5928099597c85a73c252 on master**.
exarkun (Migrated from github.com) approved these changes 2022-07-21 20:52:52 +00:00
exarkun (Migrated from github.com) left a comment

Thanks. Looks good. Some minor comments inline. Please address those and then merge.

Thanks. Looks good. Some minor comments inline. Please address those and then merge.
exarkun (Migrated from github.com) commented 2022-07-21 12:29:30 +00:00
If the response reads beyond the end of the data, the response may be shorter than the requested range.
```suggestion If the response reads beyond the end of the data, the response may be shorter than the requested range. ```
exarkun (Migrated from github.com) commented 2022-07-21 12:30:09 +00:00
 If the response reads beyond the end of the data, the response may be shorter than the requested range.
```suggestion If the response reads beyond the end of the data, the response may be shorter than the requested range. ```
exarkun (Migrated from github.com) commented 2022-07-21 12:47:47 +00:00

Content-Range could be missing from the response header here, I think?

`Content-Range` could be missing from the response header here, I think?
exarkun (Migrated from github.com) commented 2022-07-21 20:18:36 +00:00
        # that possibility for now...
```suggestion # that possibility for now... ```
exarkun (Migrated from github.com) commented 2022-07-21 20:19:30 +00:00
            # conceivably could be a bug...
```suggestion # conceivably could be a bug... ```
@ -204,0 +207,4 @@
"""
Return the length of the data in the share, if we're reading.
"""
return self._length
exarkun (Migrated from github.com) commented 2022-07-21 20:49:14 +00:00

a docstring here would be nice

a docstring here would be nice
exarkun (Migrated from github.com) commented 2022-07-21 20:49:22 +00:00

and here

and here
@ -420,2 +421,4 @@
f.close()
return data_length
def check_write_enabler(self, write_enabler, si_s):
exarkun (Migrated from github.com) commented 2022-07-21 20:50:27 +00:00

and here

and here
exarkun (Migrated from github.com) commented 2022-07-21 20:51:39 +00:00

This could go directly to ShareFile I think?

This could go directly to `ShareFile` I think?
itamarst (Migrated from github.com) reviewed 2022-07-22 15:55:22 +00:00
itamarst (Migrated from github.com) commented 2022-07-22 15:55:21 +00:00

Ended up deleting this method, per later comment.

Ended up deleting this method, per later comment.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/tahoe-lafs#1204
No description provided.