diff --git a/internal/native/message_server.go b/internal/native/message_server.go index ddb416a7f..108e7e7bf 100644 --- a/internal/native/message_server.go +++ b/internal/native/message_server.go @@ -85,10 +85,10 @@ void pactffi_sync_message_set_response_contents(InteractionHandle *message, size void pactffi_sync_message_set_response_contents_bin(InteractionHandle *message, size_t index, const unsigned char *contents, size_t len, const char *content_type); // Can be used instead of the above as a general abstraction for non-binary bodies -bool pactffi_with_body(InteractionHandle interaction, int interaction_part, const char *content_type, const char *body); +int pactffi_with_body(InteractionHandle interaction, int interaction_part, const char *content_type, const char *body); // Can be used instead of the above as a general abstraction for binary bodies -bool pactffi_with_binary_file(InteractionHandle interaction, int interaction_part, const char *content_type, const uint8_t *body, size_t size); +int pactffi_with_binary_file(InteractionHandle interaction, int interaction_part, const char *content_type, const uint8_t *body, size_t size); */ import "C" @@ -259,7 +259,7 @@ func (m *Message) WithRequestBinaryContents(body []byte) *Message { // TODO: handle response res := C.pactffi_with_binary_file(m.handle, C.int(INTERACTION_PART_REQUEST), cHeader, (*C.char)(unsafe.Pointer(&body[0])), C.int(len(body))) - log.Println("[DEBUG] WithRequestBinaryContents - pactffi_with_binary_file returned", res) + log.Println("[DEBUG] WithRequestBinaryContents - pactffi_with_binary_file returned", int(res)) return m } @@ -270,7 +270,7 @@ func (m *Message) WithRequestBinaryContentType(contentType string, body []byte) // TODO: handle response res := C.pactffi_with_binary_file(m.handle, C.int(INTERACTION_PART_REQUEST), cHeader, (*C.char)(unsafe.Pointer(&body[0])), C.int(len(body))) - log.Println("[DEBUG] WithRequestBinaryContents - pactffi_with_binary_file returned", res) + log.Println("[DEBUG] WithRequestBinaryContents - pactffi_with_binary_file returned", int(res)) return m } diff --git a/internal/native/mock_server.go b/internal/native/mock_server.go index 55ded1cc1..bfcebf31c 100644 --- a/internal/native/mock_server.go +++ b/internal/native/mock_server.go @@ -118,7 +118,7 @@ void pactffi_with_query_parameter_v2(InteractionHandle interaction, const char * // https://docs.rs/pact_mock_server_ffi/0.0.7/pact_mock_server_ffi/fn.with_body.html void pactffi_with_body(InteractionHandle interaction, int interaction_part, const char *content_type, const char *body); -void pactffi_with_binary_file(InteractionHandle interaction, int interaction_part, const char *content_type, const char *body, int size); +int pactffi_with_binary_file(InteractionHandle interaction, int interaction_part, const char *content_type, const char *body, int size); int pactffi_with_multipart_file(InteractionHandle interaction, int interaction_part, const char *content_type, const char *body, const char *part_name);