Skip to content

Commit

Permalink
Cleaned up the HTTPC lib
Browse files Browse the repository at this point in the history
  • Loading branch information
firew0lf committed Aug 24, 2015
1 parent d3ca4d0 commit 800dd6f
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions source/httpc.c
Expand Up @@ -8,22 +8,6 @@
#include <lapi.h>
#include <lauxlib.h>

/*static int httpc_init(lua_State *L) {
Result ret = httpcInit();
if (ret != 0) {
lua_pushnil(L);
lua_pushinteger(L, ret);
return 2;
}
lua_pushboolean(L, true);
return 1;
}*/

/*static int httpc_shutdown(lua_State *L) {
httpcExit();
return 0;
}*/

static int httpc_context(lua_State *L) {
httpcContext context;
Result ret = httpcOpenContext(&context, "http://google.com/", 0); // Initialization only.
Expand Down Expand Up @@ -105,15 +89,13 @@ static int httpc_downloadData(lua_State *L) {
u32 size = 0;
httpcGetDownloadSizeState(context, NULL, &size);
u8 *buff = (u8*)malloc(size);
//memset(buff, 0, size);

ret = httpcDownloadData(context, buff, size, NULL);
if (ret != 0) {
lua_pushnil(L);
lua_pushinteger(L, ret);
return 2;
}
//strcpy(buff, "loltest");

lua_pushstring(L, (char*)buff);
free(buff);
Expand Down Expand Up @@ -142,8 +124,6 @@ static const struct luaL_Reg httpc_methods[] = {

// module
static const struct luaL_Reg httpc_functions[] = {
// {"init", httpc_init },
// {"shutdown", httpc_shutdown},
{"context", httpc_context },
{NULL, NULL}
};
Expand Down

0 comments on commit 800dd6f

Please sign in to comment.