Conversation
|
Hm, maybe CI can be disabled until it's ready for review? |
5172412 to
3e8bf37
Compare
|
Rebased, applied some minor changes (mostly comments) and completed the async versions of I've also been taking a look at match msg {
Pdu::PData { data } => {
// ... (process it)
}
_ => {
return Err(std::io::Error::new(
std::io::ErrorKind::UnexpectedEof,
"Unexpected PDU type",
));
}
}Same goes for the async version. That's pretty worrying as there's no way to process incoming association control messages at that point, making it impossible to implement the state machine behaviour, and in particular to handle association release or abort, in applications that use PDataWriter, on the other hand, doesn't seem to be a concern, since it's only able to send P-DATA-TF PDUs. |
91f425f to
13db21b
Compare
According to the comments, this was a kludge related to the now removed `Drop` traits.
The association_promiscuous tests were failing because they were set up so that the server association stopped responding after establishing the association.
This change allows to actually "close the transport connection" as required by the DICOM standard even for async connections, despite Tokio not implementing a `shutdown` method that allows shutting down both directions.
85ef974 to
3cb35e0
Compare
|
Rebased and some cleanups applied. This can't go further without discussing the issues. I've added to the OP some checkboxes with the points left to discuss. |
This PR implements the behaviour of the DIMSE Association State Machine as defined in PS3.8 (2025d) section 9.2.3. Due to the complexity of the task, it's divided into multiple stages:
abort()release()establish_*())send()andreceive()Optionfor consistency with the async version (see below)Optionso that it can be dropped to close the connection, as tokio doesn't provide means to shut down both sides of the stream.abort()release()establish_*())send()andreceive()send()parameter type andreceive()Ok return valuesend()andreceive()error return values; decide what to do aboutsend()when it returnsSendTooLongPduPDataReaderwhen the incoming PDU is not a P-DATA onefinalization_timeoutoption to tools, along the lines of [tools] Add connection timeout options via CLI flags to DIMSE Tools #792This is intended to address #714; along the way it fixes ERR_7 from #768. It already addresses a minor concern I expressed in #728 (comment).
This is not yet ready for review. In particular the API (the type of the payload) for
send()andreceive()needs to be discussed, and some of the changes may be controversial, like the new possibility of a panic insend_pdata()andreceive_pdata().So, as discussed in #714 (comment) (point 3), the idea is to make
send()andreceive()deal with P-DATA-TF PDUs only. There are several ways to accomplish this:send()accept a generic Pdu as now, but return an error if the variant passed is notPdu::PData, and makereceive()only able to returnPdu::PData. This would be the most backwards-compatible change, but given the big changes in the API, it seems like a more type-restricted approach would be in order.PDataTf, and makePdu::PDatabePdu::PData(PDataTf)instead ofPdu::PData { data: Vec<PDataValue> }as it is now.send()andreceive()would accept/returnPDataTf. HowPDataTfis defined may be subject to discussion; I'd sayVec<PDataValue>, but due to the presence of adatafield inPdu::PData, someone may argue thatstruct PDataTf { data: Vec<PDataValue> }is preferable.Vec<PDataValue>.Opinions on the overall approach taken in this PR, as well as on the decision for
send()andreceive(), would be appreciated.AI disclosure: This PR contains no AI-generated code.