Mercurial > hg > orthanc
comparison Core/Lua/LuaContext.cpp @ 2724:c8d369400ae1 jobs
fix issue #77
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 12 Jul 2018 15:54:37 +0200 |
parents | 878b59270859 |
children | d924f9bb61cc |
comparison
equal
deleted
inserted
replaced
2723:c1e351b6abec | 2724:c8d369400ae1 |
---|---|
285 that.httpClient_.SetUrl(url); | 285 that.httpClient_.SetUrl(url); |
286 that.SetHttpHeaders(state, 3); | 286 that.SetHttpHeaders(state, 3); |
287 | 287 |
288 if (nArgs >= 2 && !lua_isnil(state, 2)) | 288 if (nArgs >= 2 && !lua_isnil(state, 2)) |
289 { | 289 { |
290 that.httpClient_.SetBody(lua_tostring(state, 2)); | 290 size_t bodySize = 0; |
291 const char* bodyData = lua_tolstring(state, 2, &bodySize); | |
292 | |
293 if (bodySize == 0) | |
294 { | |
295 that.httpClient_.GetBody().clear(); | |
296 } | |
297 else | |
298 { | |
299 that.httpClient_.GetBody().assign(bodyData, bodySize); | |
300 } | |
291 } | 301 } |
292 else | 302 else |
293 { | 303 { |
294 that.httpClient_.GetBody().clear(); | 304 that.httpClient_.GetBody().clear(); |
295 } | 305 } |