Mercurial > hg > orthanc-stone
comparison Platforms/Wasm/Defaults.cpp @ 309:14ef1227120f am-callable-and-promise
web services: better handling of failures
author | am@osimis.io |
---|---|
date | Fri, 28 Sep 2018 15:02:43 +0200 |
parents | be2660b6e40a |
children | 8716176ff7f0 |
comparison
equal
deleted
inserted
replaced
307:be2660b6e40a | 309:14ef1227120f |
---|---|
260 const char* EMSCRIPTEN_KEEPALIVE SendMessageToStoneApplication(const char* message) | 260 const char* EMSCRIPTEN_KEEPALIVE SendMessageToStoneApplication(const char* message) |
261 { | 261 { |
262 static std::string output; // we don't want the string to be deallocated when we return to JS code so we always use the same string (this is fine since JS is single-thread) | 262 static std::string output; // we don't want the string to be deallocated when we return to JS code so we always use the same string (this is fine since JS is single-thread) |
263 | 263 |
264 printf("SendMessageToStoneApplication\n"); | 264 printf("SendMessageToStoneApplication\n"); |
265 printf(message); | 265 printf("%s", message); |
266 | 266 |
267 if (applicationWasmAdapter.get() != NULL) { | 267 if (applicationWasmAdapter.get() != NULL) { |
268 printf("sending message to C++\n"); | 268 printf("sending message to C++\n"); |
269 applicationWasmAdapter->HandleMessageFromWeb(output, std::string(message)); | 269 applicationWasmAdapter->HandleMessageFromWeb(output, std::string(message)); |
270 return output.c_str(); | 270 return output.c_str(); |