mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
server side now works
git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@106 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
parent
0d15b8be5b
commit
9efcfbaf81
@ -300,10 +300,6 @@ JNIEXPORT jint JNICALL Java_axTLSj_axtlsjJNI_getFd(JNIEnv *env, jclass jcls, job
|
||||
}
|
||||
}
|
||||
|
||||
%typemap(freearg) unsigned char *in_data {
|
||||
free(buf\$argnum);
|
||||
}
|
||||
|
||||
/* for ssl_client_new() */
|
||||
%typemap(in) const unsigned char session_id[] {
|
||||
/* check for a reference */
|
||||
@ -321,6 +317,32 @@ JNIEXPORT jint JNICALL Java_axTLSj_axtlsjJNI_getFd(JNIEnv *env, jclass jcls, job
|
||||
|
||||
/* Some SWIG magic to make the API a bit more Lua friendly */
|
||||
#ifdef SWIGLUA
|
||||
/* for ssl_session_id() */
|
||||
%typemap(out) const unsigned char * {
|
||||
int i;
|
||||
lua_newtable(L);
|
||||
for (i = 0; i < SSL_SESSION_ID_SIZE; i++){
|
||||
lua_pushnumber(L,(lua_Number)result[i]);
|
||||
lua_rawseti(L,-2,i+1); /* -1 is the number, -2 is the table */
|
||||
}
|
||||
SWIG_arg++;
|
||||
}
|
||||
|
||||
%typemap(in) unsigned char **in_data (unsigned char *buf) {
|
||||
\$1 = &buf;
|
||||
}
|
||||
|
||||
%typemap(argout) unsigned char **in_data {
|
||||
if (result > SSL_OK) {
|
||||
int i;
|
||||
lua_newtable(L);
|
||||
for (i = 0; i < result; i++){
|
||||
lua_pushnumber(L,(lua_Number)buf2[i]);
|
||||
lua_rawseti(L,-2,i+1); /* -1 is the number, -2 is the table */
|
||||
}
|
||||
SWIG_arg++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
END
|
||||
|
@ -24,7 +24,7 @@ all: lib
|
||||
ifdef CONFIG_PLATFORM_WIN32
|
||||
TARGET=../../$(STAGE)/axtlsl.dll
|
||||
else
|
||||
TARGET=../../$(STAGE)/libaxtlsl.so
|
||||
TARGET=../../$(STAGE)/axtlsl.so
|
||||
endif
|
||||
|
||||
ifneq ($(MAKECMDGOALS), clean)
|
||||
@ -36,11 +36,9 @@ CONFIG_HOME=$(AXTLS_HOME)/config
|
||||
OBJ:=axTLSl_wrap.o
|
||||
include ../../config/makefile.post
|
||||
|
||||
# libaxtls has to be linked in as a single object for this (TODO: see if this is completely necessary)
|
||||
$(TARGET) : $(OBJ)
|
||||
$(LD) $(LDFLAGS) -L ../../$(STAGE) -L $(CONFIG_LUA_CORE)/lib $(LDSHARED) -o $@ $(OBJ) -laxtls -llua
|
||||
ifdef CONFIG_PLATFORM_CYGWIN
|
||||
cd ../../$(STAGE); ln -sf $(notdir $@) axtlsl.dll
|
||||
endif
|
||||
$(LD) $(LDFLAGS) -L$(CONFIG_LUA_CORE)/lib $(LDSHARED) -o $@ $(OBJ) ../../$(STAGE)/libaxtls.a -llua
|
||||
|
||||
CFLAGS += -I$(CONFIG_HOME) -I$(SSL_HOME) -I $(CONFIG_LUA_CORE)/include
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user