mirror of https://github.com/oxen-io/oxen-mq.git
ad04c53c0e
The existing code was overly complicated by trying to track indices in the `connections` vector, which complication happening because things get removed from `connections` requiring all the internal index values to be updated. So we ended up with a connection ID inside the ConnectionID object, plus a map of those connection IDs to the `connections` index, and need a map back from indices to ConnectionIDs. Though this seems to work usually, I recently noticed an oxen-storage-server sending oxend requests on the wrong connection and so I suspect there is some rare edge cases here where a failed connection index might not be updated properly. This PR simplifies the whole thing by making getting rid of connection ids entirely and keeping the connections in a map (with connection ids that never change). This might end up being a little less efficient than the vector, but it's unlikely to matter and the added complexity isn't worth it. |
||
---|---|---|
.. | ||
address.cpp | ||
address.h | ||
auth.cpp | ||
auth.h | ||
base32z.h | ||
base64.h | ||
batch.h | ||
bt_serialize.cpp | ||
bt_serialize.h | ||
bt_value.h | ||
byte_type.h | ||
connections.cpp | ||
connections.h | ||
hex.h | ||
jobs.cpp | ||
message.h | ||
oxenmq-internal.h | ||
oxenmq.cpp | ||
oxenmq.h | ||
proxy.cpp | ||
variant.h | ||
version.h.in | ||
worker.cpp |