Browse Source

net: fix emscripten build.

legacy
Sam Hocevar 4 years ago
parent
commit
cc7d34400d
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/net/http.cpp

+ 3
- 3
src/net/http.cpp View File

@@ -50,7 +50,7 @@ public:
#if __EMSCRIPTEN__
~client_impl()
{
emscripten_fetch_close(impl->m_fetch);
emscripten_fetch_close(m_fetch);
}

void get(std::string const &url)
@@ -58,11 +58,11 @@ public:
emscripten_fetch_attr_t attr;
emscripten_fetch_attr_init(&attr);
strcpy(attr.requestMethod, "GET");
attr.userData = impl.get();
attr.userData = this;
attr.attributes = EMSCRIPTEN_FETCH_LOAD_TO_MEMORY;
attr.onsuccess = client_impl::on_success;
attr.onerror = client_impl::on_failure;
impl->m_fetch = emscripten_fetch(&attr, url.c_str());
m_fetch = emscripten_fetch(&attr, url.c_str());
}

static void on_success(emscripten_fetch_t *fetch)


Loading…
Cancel
Save