# HG changeset patch # User Sebastien Jodogne # Date 1693913552 -7200 # Node ID cc0765aae484ae85752fb3c7dd59d7c4b344437c # Parent 286368f6f019136080160fa7b3c649995eaec193 fix signature of orthanc.RestOutput.SendHttpStatus() diff -r 286368f6f019 -r cc0765aae484 NEWS --- a/NEWS Wed Aug 30 14:53:01 2023 +0200 +++ b/NEWS Tue Sep 05 13:32:32 2023 +0200 @@ -1,6 +1,8 @@ Pending changes in the mainline =============================== +* Fix signature of "orthanc.RestOutput.SendHttpStatus()" + Version 4.1 (2023-08-30) ======================== diff -r 286368f6f019 -r cc0765aae484 Resources/Orthanc/Sdk-1.10.0/orthanc/OrthancCPlugin.h --- a/Resources/Orthanc/Sdk-1.10.0/orthanc/OrthancCPlugin.h Wed Aug 30 14:53:01 2023 +0200 +++ b/Resources/Orthanc/Sdk-1.10.0/orthanc/OrthancCPlugin.h Tue Sep 05 13:32:32 2023 +0200 @@ -3856,13 +3856,13 @@ OrthancPluginContext* context, OrthancPluginRestOutput* output, uint16_t status, - const char* body, + const void* body, uint32_t bodySize) { _OrthancPluginSendHttpStatus params; params.output = output; params.status = status; - params.body = body; + params.body = reinterpret_cast(body); params.bodySize = bodySize; context->InvokeService(context, _OrthancPluginService_SendHttpStatus, ¶ms); } diff -r 286368f6f019 -r cc0765aae484 Resources/SyncOrthancFolder.py --- a/Resources/SyncOrthancFolder.py Wed Aug 30 14:53:01 2023 +0200 +++ b/Resources/SyncOrthancFolder.py Tue Sep 05 13:32:32 2023 +0200 @@ -79,11 +79,11 @@ pool.map(Download, commands) -if False: - # Patch the SDK - subprocess.check_call([ 'patch', '-p0', '-i', os.path.join - (os.path.abspath(os.path.dirname(__file__)), - 'OrthancCPlugin-%s.patch' % PLUGIN_SDK_VERSION) ], +# Patch the SDK, if need be +patch = os.path.join(os.path.abspath(os.path.dirname(__file__)), + 'OrthancCPlugin-%s.patch' % PLUGIN_SDK_VERSION) +if os.path.exists(patch): + subprocess.check_call([ 'patch', '-p0', '-i', patch ], cwd = os.path.join(os.path.dirname(__file__), 'Orthanc', 'Sdk-%s' % PLUGIN_SDK_VERSION, 'orthanc')) diff -r 286368f6f019 -r cc0765aae484 Sources/Autogenerated/sdk_OrthancPluginRestOutput.methods.h --- a/Sources/Autogenerated/sdk_OrthancPluginRestOutput.methods.h Wed Aug 30 14:53:01 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginRestOutput.methods.h Tue Sep 05 13:32:32 2023 +0200 @@ -285,16 +285,15 @@ } unsigned short arg0 = 0; - const char* arg1 = NULL; - unsigned long arg2 = 0; + Py_buffer arg1; - if (!PyArg_ParseTuple(args, "Hsk", &arg0, &arg1, &arg2)) + if (!PyArg_ParseTuple(args, "Hs*", &arg0, &arg1)) { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); return NULL; } - OrthancPluginSendHttpStatus(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1, arg2); - + OrthancPluginSendHttpStatus(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1.buf, arg1.len); + PyBuffer_Release(&arg1); Py_INCREF(Py_None); return Py_None;