changeset 137:cc0765aae484

fix signature of orthanc.RestOutput.SendHttpStatus()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 05 Sep 2023 13:32:32 +0200
parents 286368f6f019
children 3e89d1c4f721
files NEWS Resources/Orthanc/Sdk-1.10.0/orthanc/OrthancCPlugin.h Resources/SyncOrthancFolder.py Sources/Autogenerated/sdk_OrthancPluginRestOutput.methods.h
diffstat 4 files changed, 14 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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)
 ========================
--- 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<const char*>(body);
     params.bodySize = bodySize;
     context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
   }
--- 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'))
--- 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;