[BitBucket user: Alain Mazy]
[BitBucket date: 2017-07-05.21:39:41]
well, I have tried to reproduce the issue with both version 0.9.4 (the default version on my ubuntu system) and with the mainline, with no success.
Here is what I get:
```
I0705 23:37:54.858038 MongooseServer.cpp:721] POST /modalities/orthanc/query
I0705 23:37:54.859574 DicomUserConnection.cpp:803] Opening a DICOM SCU connection from AET "ORTHANC1" to AET "ORTHANC" on host localhost:4242 (manufacturer: Generic)
I0705 23:37:55.942633 MongooseServer.cpp:721] GET /queries/3979b1be-3859-40fb-881c-c4be11133987/answers
I0705 23:37:56.980384 MongooseServer.cpp:721] GET /queries/3979b1be-3859-40fb-881c-c4be11133987/answers/0/content
I0705 23:37:58.004985 MongooseServer.cpp:721] GET /queries/3979b1be-3859-40fb-881c-c4be11133987/answers/1/content
I0705 23:37:59.056584 MongooseServer.cpp:721] POST /queries/3979b1be-3859-40fb-881c-c4be11133987/answers/1/retrieve
W0705 23:37:59.057496 OrthancRestModalities.cpp:480] Driving C-Move SCU on modality: ORTHANC1
I0705 23:37:59.057804 ReusableDicomUserConnection.cpp:57] Reusing the previous SCU connection
I0705 23:37:59.058299 MongooseServer.cpp:721] POST /queries/3979b1be-3859-40fb-881c-c4be11133987/answers/0/retrieve
W0705 23:37:59.058419 OrthancRestModalities.cpp:480] Driving C-Move SCU on modality: ORTHANC1
I0705 23:37:59.076218 CommandDispatcher.cpp:491] Association Received from AET ORTHANC on IP 127.0.0.1
I0705 23:37:59.125741 CommandDispatcher.cpp:684] Association Acknowledged (Max Send PDV: 16372)
I0705 23:38:00.158715 ServerContext.cpp:263] Already stored
I0705 23:38:00.161873 ReusableDicomUserConnection.cpp:57] Reusing the previous SCU connection
I0705 23:38:01.254555 ServerContext.cpp:263] Already stored
I0705 23:38:06.334616 ReusableDicomUserConnection.cpp:94] Closing the global SCU connection after timeout
I0705 23:38:06.335064 CommandDispatcher.cpp:835] DUL Peer Requested Release
I0705 23:38:06.335115 CommandDispatcher.cpp:842] Association Release
```
This output has been produced with this python code:
```
from requests_futures.sessions import FuturesSession
from requests import Session
import time
orthancBaseUrl = "http://localhost:8743"
#perform the C-Find with synchronous requests
syncSession = Session()
queryResponse = syncSession.post(orthancBaseUrl + '/modalities/orthanc/query', json = {"Level": "Study", "Query": {"AccessionNumber": "*", "PatientBirthDate": "*", "PatientID": "*", "PatientName": "0573*", "PatientSex": "*", "StudyDate": "*", "StudyDescription": "*"}})
queryId = queryResponse.json()['ID']
results = []
queryResultsIdResponse = syncSession.get(orthancBaseUrl + '/queries/{queryId}/answers'.format(queryId = queryId))
for queryResultId in queryResultsIdResponse.json():
resultResponse = syncSession.get(orthancBaseUrl + '/queries/{queryId}/answers/{queryResultId}/content?simplify'.format(queryId = queryId, queryResultId = queryResultId)).json()
resultResponse['retrieveUrl'] = '/queries/{queryId}/answers/{queryResultId}/retrieve'.format(queryId = queryId, queryResultId = queryResultId)
results.append(resultResponse)
# perform the retrieve with asynchronous requests
asyncSession = FuturesSession()
# first request is started in background
future_one = asyncSession.post(orthancBaseUrl + results[0]['retrieveUrl'], data = 'ORTHANC1')
# second requests is started immediately
future_two = asyncSession.post(orthancBaseUrl + results[1]['retrieveUrl'], data = 'ORTHANC1')
# wait for the first request to complete, if it hasn't already
response_one = future_one.result()
print('response one status: {0}'.format(response_one.status_code))
print(response_one.content)
# wait for the second request to complete, if it hasn't already
response_two = future_two.result()
print('response two status: {0}'.format(response_two.status_code))
print(response_two.content)
``` |