Trac issueshttps://gitlab.torproject.org/legacy/trac/-/issues2020-06-13T15:39:50Zhttps://gitlab.torproject.org/legacy/trac/-/issues/29897Refactor handle_get_next_bandwidth() to use connection_dir_buf_add()2020-06-13T15:39:50ZteorRefactor handle_get_next_bandwidth() to use connection_dir_buf_add()After #21377 merges, we want to refactor handle_get_next_bandwidth() to use connection_dir_buf_add().
If we backport this refactor to 0.4.0 or earlier, we'll also need #29896 for the connection_dir_buf_add() backport.After #21377 merges, we want to refactor handle_get_next_bandwidth() to use connection_dir_buf_add().
If we backport this refactor to 0.4.0 or earlier, we'll also need #29896 for the connection_dir_buf_add() backport.Tor: 0.4.0.x-finalteorteorhttps://gitlab.torproject.org/legacy/trac/-/issues/29896Backport connection_dir_buf_add() to 0.3.4 and later2020-06-13T15:39:49ZteorBackport connection_dir_buf_add() to 0.3.4 and laterWe need connection_dir_buf_add() in 0.3.4 for #21377.
But I don't want to backport all the refactoring, just the new function.We need connection_dir_buf_add() in 0.3.4 for #21377.
But I don't want to backport all the refactoring, just the new function.Tor: 0.4.1.x-finalteorteorhttps://gitlab.torproject.org/legacy/trac/-/issues/28816Call a correct connection_buf_add* function based on compress_state of dir_co...2020-06-13T15:35:32ZteorCall a correct connection_buf_add* function based on compress_state of dir_connection_tIn #21377, we discovered that it is easy to set the compression state on a connection, but add uncompressed data to that connection.
We should log a bug warning when:
* conn->compress_state is not NULL, and connection_buf_add() is calle...In #21377, we discovered that it is easy to set the compression state on a connection, but add uncompressed data to that connection.
We should log a bug warning when:
* conn->compress_state is not NULL, and connection_buf_add() is called
* conn->compress_state is NULL, and connection_buf_add_compress() is calledTor: 0.4.1.x-finalrl1987rl1987https://gitlab.torproject.org/legacy/trac/-/issues/28815Refactor similar compression buffer code in dircache.c2020-06-13T15:35:31ZteorRefactor similar compression buffer code in dircache.cAfter #21377, we will have 3 copies of similar compression buffer code in dircache.c.
Copying code is a bad idea, because:
* people make mistakes when they copy, and
* when people make changes, they sometimes miss the copies.
Instead, ...After #21377, we will have 3 copies of similar compression buffer code in dircache.c.
Copying code is a bad idea, because:
* people make mistakes when they copy, and
* when people make changes, they sometimes miss the copies.
Instead, we should write a function that correctly adds compressed or uncompressed data to the connection, based on conn, compress_method, uncompressed_body_len, lifetime, estimated_len, and the data that needs to be added to the buffer.
Perhaps the dirserv_spool_* functions could help here.
Then we can call the new function from handle_get_next_bandwidth():
https://github.com/torproject/tor/blob/b03091842bc4590e11e3ac026daae8ed6d8f7554/src/feature/dircache/dircache.c#L1463-L1468
handle_get_status_vote():
https://github.com/torproject/tor/blob/8020d6fb05d9477e77c6ca554dc1288873f6115c/src/feature/dircache/dircache.c#L1034-L1048
and handle_get_keys():
https://github.com/torproject/tor/blob/8020d6fb05d9477e77c6ca554dc1288873f6115c/src/feature/dircache/dircache.c#L1292-L1310Tor: unspecifiedhttps://gitlab.torproject.org/legacy/trac/-/issues/26694dir-spec: DirAuths should expose bwauth bandwidth files2020-06-13T15:27:43Zjugadir-spec: DirAuths should expose bwauth bandwidth filesThis ticket is for changing dir-spec to implement #21377This ticket is for changing dir-spec to implement #21377Tor: 0.4.1.x-finaljugajuga