Coder Social home page Coder Social logo

jamol / kuma Goto Github PK

View Code? Open in Web Editor NEW
190.0 14.0 69.0 81.17 MB

A network library implemented in C++, supports TCP/UDP/HTTP/HTTP2/WebSocket/SSL on platform Linux/Windows/OSX/iOS/Android.

License: MIT License

C 0.55% C++ 91.99% Makefile 0.92% Java 0.18% HTML 0.16% JavaScript 0.56% CMake 1.47% Python 1.55% Kotlin 2.62%
networking http2 websocket event-loop c-plus-plus http sslsocket

kuma's People

Contributors

jamol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kuma's Issues

wss can't receive data

hello Jamol,
I run the test demo as a wss server:
./server wss://0.0.0.0:6086

 and use a webpage to send a wss request:

wss://192.168.31.232:6086
after handshake ,I send a message(binary data),it returned: (Opcode -1).The server log shows:

INFO: [140191080888384] AcceptorBase_2:: onAccept, fd=16, peer_ip=192.168.31.147, peer_port=50079
TcpServer::onAccept, fd=16, ip=192.168.31.147, port=50079, proto=5
INFO: [140190551111424] TcpSocket_15:: attachFd, fd=16, flags=1
INFO: [140190551111424] SocketBase_16:: attachFd, fd=16, state=0
INFO: [140190551111424] EPoll::registerFd, fd=16, ev=2147483677
INFO: [140190551111424] TcpSocket_15:: startSslHandshake, ssl_role=1, fd=16
INFO: [140190551111424] SioHandler_16:: handshake, success, fd=16
INFO: [140190551111424] TcpSocket_15:: checkSslHandshake, completed, err=0
INFO: [140190551111424] WebSocket_14:: onStateOpen
ERROR: [140190551111424] SioHandler_16:: receive, SSL_read failed, fd=16, ssl_status=0, ssl_err=5, os_err=0, err_msg=
INFO: [140190551111424] SocketBase_16:: close, state=3
INFO: [140190551111424] EPoll::unregisterFd, fd=16, max_fd=1023
INFO: [140190551111424] TcpSocket_15:: close
INFO: [140190551111424] WebSocket_14:: onError, err=-9

it can't receive msg from SSL_read function, I anlysysed the ssl_err,it just say,SSL_ERROR_SYSCALL,it's a bottom error. I can't find the answer, hope to get help from you.

you can contact me with email:[email protected]

Linux make err:

Linux:
cd src
make

Errors:
g++: error: ../third_party/libkev/lib/linux/Release/libkev.a: No such file or directory
g++: error: ../third_party/libkev/lib/linux/Release/libkev.a: No such file or directory

how to dump backtrace?

Hi
this is a good project but it is too hard for me, so I want to debug it with backtrace step
by step .
in kmtrace.h I add below:
#define KUMA_DUMPTRACE(x)
do{
std::cout<<getObjKey()<<":: "<<x<<"...\n";
Backtrace();
}while(0)

void DumpBacktrace();

in kmtrace.cpp add:

#if defined(GLIBCXX) && !defined(UCLIBC)
#include <cxxabi.h>
#include <execinfo.h>
#endif

void DumpBacktrace() {
#if defined(GLIBCXX) && !defined(UCLIBC)
void* trace[100];
int size = backtrace(trace, sizeof(trace) / sizeof(trace));
char
* symbols = backtrace_symbols(trace, size);
printf("\n==== C stack trace ===============================\n\n");
if (size == 0) {
printf("(empty)\n");
} else if (symbols == NULL) {
printf("(no symbols)\n");
} else {
for (int i = 1; i < size; ++i) {
char mangled[201];
if (sscanf(symbols[i], "%[^(]%[(]%200[^)+]", mangled) == 1) { // NOLINT
printf("%2d: ", i);
int status;
size_t length;
char* demangled = abi::__cxa_demangle(mangled, NULL, &length, &status);
printf("%s\n", demangled != NULL ? demangled : mangled);
free(demangled);
} else {
// If parsing failed, at least print the unparsed symbol.
printf("%s\n", symbols[i]);
}
}
}
free(symbols);
#endif
}

so if I want dump backtrace, i use it , for : KUMA_DUMPTRACE("sendPreface");
I get this result:
==== C stack trace ===============================

1: kuma::H2Connection::Impl::sendPreface()
2: kuma::H2Connection::Impl::attachSocket(kuma::TcpSocket::Impl&&, kuma::HttpParser::Impl&&, void const*, unsigned long)
3: kuma::H2Connection::attachSocket(kuma::TcpSocket&&, kuma::HttpParser&&, void const*, unsigned long)
./server() [0x413836]
./server() [0x409bf5]
./server() [0x415a1b]
./server() [0x415c6d]
./server() [0x415639]
./server() [0x41679d]
10: std::function<void (kuma::KMError)>::operator()(kuma::KMError) const
11: kuma::TcpSocket::Impl::onReceive(kuma::KMError)
../../bin/linux/libkuma.so(+0x1112ab) [0x7f14752e52ab]
../../bin/linux/libkuma.so(+0x112c33) [0x7f14752e6c33]
14: std::function<void (kuma::KMError)>::operator()(kuma::KMError) const
15: kuma::SocketBase::onReceive(kuma::KMError)
16: kuma::SocketBase::ioReady(unsigned int, void*, unsigned long)
../../bin/linux/libkuma.so(+0x106cd2) [0x7f14752dacd2]
../../bin/linux/libkuma.so(+0x1094cc) [0x7f14752dd4cc]
19: std::function<void (unsigned int, void*, unsigned long)>::operator()(unsigned int, void*, unsigned long) const
20: kuma::EPoll::wait(unsigned int)
21: kuma::EventLoop::Impl::loopOnce(unsigned int)
22: kuma::EventLoop::Impl::loop(unsigned int)
23: kuma::EventLoop::loop(unsigned int)
./server() [0x4095e6]
./server() [0x4093e7]
./server() [0x40b442]
./server() [0x40b3ab]
./server() [0x40b34a]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x90c30) [0x7f1474b30c30]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8182) [0x7f1474fbe182]
31: clone

why ./server() can not show the function ? even I add -rdynamic g++ param in test/server/MakeFile?
can you tell me?
thanks !

make android lib error

-- Build files have been written to: /root/code/kuma/bld/android/out/armeabi-v7a
[ 1%] Building CXX object CMakeFiles/kuma.dir/src/AcceptorBase.cpp.o
[ 2%] Building CXX object CMakeFiles/kuma.dir/src/DnsResolver.cpp.o
[ 4%] Building CXX object CMakeFiles/kuma.dir/src/SocketBase.cpp.o
[ 5%] Building CXX object CMakeFiles/kuma.dir/src/TcpConnection.cpp.o
[ 7%] Building CXX object CMakeFiles/kuma.dir/src/TcpListenerImpl.cpp.o
[ 8%] Building CXX object CMakeFiles/kuma.dir/src/TcpSocketImpl.cpp.o
[ 10%] Building CXX object CMakeFiles/kuma.dir/src/UdpSocketBase.cpp.o
[ 11%] Building CXX object CMakeFiles/kuma.dir/src/UdpSocketImpl.cpp.o
[ 13%] Building CXX object CMakeFiles/kuma.dir/src/compr/compr.cpp.o
[ 14%] Building CXX object CMakeFiles/kuma.dir/src/compr/compr_zlib.cpp.o
[ 16%] Building CXX object CMakeFiles/kuma.dir/src/http/H1xStream.cpp.o
[ 17%] Building CXX object CMakeFiles/kuma.dir/src/http/Http1xRequest.cpp.o
[ 19%] Building CXX object CMakeFiles/kuma.dir/src/http/Http1xResponse.cpp.o
[ 20%] Building CXX object CMakeFiles/kuma.dir/src/http/HttpCache.cpp.o
[ 22%] Building CXX object CMakeFiles/kuma.dir/src/http/HttpHeader.cpp.o
[ 23%] Building CXX object CMakeFiles/kuma.dir/src/http/HttpMessage.cpp.o
[ 25%] Building CXX object CMakeFiles/kuma.dir/src/http/HttpParserImpl.cpp.o
[ 26%] Building CXX object CMakeFiles/kuma.dir/src/http/HttpRequestImpl.cpp.o
[ 28%] Building CXX object CMakeFiles/kuma.dir/src/http/HttpResponseImpl.cpp.o
[ 29%] Building CXX object CMakeFiles/kuma.dir/src/http/Uri.cpp.o
[ 31%] Building CXX object CMakeFiles/kuma.dir/src/http/httputils.cpp.o
[ 32%] Building CXX object CMakeFiles/kuma.dir/src/http/v2/FlowControl.cpp.o
[ 34%] Building CXX object CMakeFiles/kuma.dir/src/http/v2/FrameParser.cpp.o
[ 35%] Building CXX object CMakeFiles/kuma.dir/src/http/v2/H2ConnectionImpl.cpp.o
[ 37%] Building CXX object CMakeFiles/kuma.dir/src/http/v2/H2ConnectionMgr.cpp.o
[ 38%] Building CXX object CMakeFiles/kuma.dir/src/http/v2/H2Frame.cpp.o
[ 40%] Building CXX object CMakeFiles/kuma.dir/src/http/v2/H2Handshake.cpp.o
[ 41%] Building CXX object CMakeFiles/kuma.dir/src/http/v2/H2Stream.cpp.o
[ 43%] Building CXX object CMakeFiles/kuma.dir/src/http/v2/H2StreamProxy.cpp.o
[ 44%] Building CXX object CMakeFiles/kuma.dir/src/http/v2/Http2Request.cpp.o
[ 46%] Building CXX object CMakeFiles/kuma.dir/src/http/v2/Http2Response.cpp.o
[ 47%] Building CXX object CMakeFiles/kuma.dir/src/http/v2/PushClient.cpp.o
[ 49%] Building CXX object CMakeFiles/kuma.dir/src/http/v2/h2utils.cpp.o
[ 50%] Building CXX object CMakeFiles/kuma.dir/src/kmapi.cpp.o
[ 52%] Building CXX object CMakeFiles/kuma.dir/src/proxy/BasicAuthenticator.cpp.o
[ 53%] Building CXX object CMakeFiles/kuma.dir/src/proxy/ProxyAuthenticator.cpp.o
[ 55%] Building CXX object CMakeFiles/kuma.dir/src/proxy/ProxyConnectionImpl.cpp.o
[ 56%] Building CXX object CMakeFiles/kuma.dir/src/utils/base64.cpp.o
[ 58%] Building CXX object CMakeFiles/kuma.dir/src/utils/utils.cpp.o
[ 59%] Building CXX object CMakeFiles/kuma.dir/src/ws/WSConnection.cpp.o
[ 61%] Building CXX object CMakeFiles/kuma.dir/src/ws/WSConnection_v1.cpp.o
[ 62%] Building CXX object CMakeFiles/kuma.dir/src/ws/WSConnection_v2.cpp.o
[ 64%] Building CXX object CMakeFiles/kuma.dir/src/ws/WSHandler.cpp.o
[ 65%] Building CXX object CMakeFiles/kuma.dir/src/ws/WebSocketImpl.cpp.o
[ 67%] Building CXX object CMakeFiles/kuma.dir/src/ws/exts/ExtensionHandler.cpp.o
[ 68%] Building CXX object CMakeFiles/kuma.dir/src/ws/exts/PMCE_Base.cpp.o
[ 70%] Building CXX object CMakeFiles/kuma.dir/src/ws/exts/PMCE_Deflate.cpp.o
[ 71%] Building CXX object CMakeFiles/kuma.dir/src/ws/exts/WSExtension.cpp.o
[ 73%] Building C object CMakeFiles/kuma.dir/third_party/zlib/adler32.c.o
[ 74%] Building C object CMakeFiles/kuma.dir/third_party/zlib/compress.c.o
[ 76%] Building C object CMakeFiles/kuma.dir/third_party/zlib/crc32.c.o
[ 77%] Building C object CMakeFiles/kuma.dir/third_party/zlib/deflate.c.o
[ 79%] Building C object CMakeFiles/kuma.dir/third_party/zlib/infback.c.o
[ 80%] Building C object CMakeFiles/kuma.dir/third_party/zlib/inffast.c.o
[ 82%] Building C object CMakeFiles/kuma.dir/third_party/zlib/inflate.c.o
[ 83%] Building C object CMakeFiles/kuma.dir/third_party/zlib/inftrees.c.o
[ 85%] Building C object CMakeFiles/kuma.dir/third_party/zlib/trees.c.o
[ 86%] Building C object CMakeFiles/kuma.dir/third_party/zlib/uncompr.c.o
[ 88%] Building C object CMakeFiles/kuma.dir/third_party/zlib/zutil.c.o
[ 89%] Building CXX object CMakeFiles/kuma.dir/third_party/HPacker/src/HPackTable.cpp.o
[ 91%] Building CXX object CMakeFiles/kuma.dir/third_party/HPacker/src/HPacker.cpp.o
[ 92%] Building CXX object CMakeFiles/kuma.dir/src/ssl/BioHandler.cpp.o
[ 94%] Building CXX object CMakeFiles/kuma.dir/src/ssl/OpenSslLib.cpp.o
[ 95%] Building CXX object CMakeFiles/kuma.dir/src/ssl/SioHandler.cpp.o
[ 97%] Building CXX object CMakeFiles/kuma.dir/src/ssl/SslHandler.cpp.o
[ 98%] Building CXX object CMakeFiles/kuma.dir/src/ssl/ssl_utils_linux.cpp.o
[100%] Linking CXX shared library ../../../../bin/android/armeabi-v7a/libkuma.so
ld: error: relocation R_ARM_REL32 cannot be used against symbol 'kev::KMObject::KMObject()::s_objIdSeed'; recompile with -fPIC

defined in CMakeFiles/kuma.dir/src/AcceptorBase.cpp.o
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::Impl(kev::PollType)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'construction vtable for std::__ndk1::basic_istream<char, std::__ndk1::char_traits >-in-std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits, std::__ndk1::allocator >'; recompile with -fPIC

defined in CMakeFiles/kuma.dir/src/AcceptorBase.cpp.o
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::Impl(kev::PollType)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'vtable for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits, std::__ndk1::allocator >'; recompile with -fPIC

defined in CMakeFiles/kuma.dir/src/AcceptorBase.cpp.o
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::Impl(kev::PollType)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<kev::TimerManager*, std::__ndk1::default_deletekev::TimerManager, std::__ndk1::allocatorkev::TimerManager >'; recompile with -fPIC

defined in /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a(EventLoopImpl.cpp.o)
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::Impl(kev::PollType)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'vtable for std::__ndk1::basic_stringbuf<char, std::__ndk1::char_traits, std::__ndk1::allocator >'; recompile with -fPIC

defined in CMakeFiles/kuma.dir/src/AcceptorBase.cpp.o
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::Impl(kev::PollType)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'VTT for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits, std::__ndk1::allocator >'; recompile with -fPIC

defined in CMakeFiles/kuma.dir/src/AcceptorBase.cpp.o
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::Impl(kev::PollType)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'VTT for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits, std::__ndk1::allocator >'; recompile with -fPIC

defined in CMakeFiles/kuma.dir/src/AcceptorBase.cpp.o
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::Impl(kev::PollType)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_emplace<kev::DLQueue<std::__ndk1::function<void (kev::LoopActivity)> >::DLNode, std::__ndk1::allocator<kev::DLQueue<std::__ndk1::function<void (kev::LoopActivity)> >::DLNode> >'; recompile with -fPIC

defined in /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a(EventLoopImpl.cpp.o)
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(std::__ndk1::shared_ptr<kev::DLQueue<std::__ndk1::function<void (kev::LoopActivity)> >::DLNode> kev::DLQueue<std::__ndk1::function<void (kev::LoopActivity)> >::enqueue<std::__ndk1::function<void (kev::LoopActivity)> >(std::__ndk1::function<void (kev::LoopActivity)>&&)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'construction vtable for std::__ndk1::basic_ostream<char, std::__ndk1::char_traits >-in-std::__ndk1::basic_ostringstream<char, std::__ndk1::char_traits, std::__ndk1::allocator >'; recompile with -fPIC

defined in CMakeFiles/kuma.dir/src/AcceptorBase.cpp.o
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::loop(unsigned int)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'vtable for std::__ndk1::basic_ostringstream<char, std::__ndk1::char_traits, std::__ndk1::allocator >'; recompile with -fPIC

defined in CMakeFiles/kuma.dir/src/AcceptorBase.cpp.o
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::loop(unsigned int)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'vtable for std::__ndk1::basic_stringbuf<char, std::__ndk1::char_traits, std::__ndk1::allocator >'; recompile with -fPIC

defined in CMakeFiles/kuma.dir/src/AcceptorBase.cpp.o
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::loop(unsigned int)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'VTT for std::__ndk1::basic_ostringstream<char, std::__ndk1::char_traits, std::__ndk1::allocator >'; recompile with -fPIC

defined in CMakeFiles/kuma.dir/src/AcceptorBase.cpp.o
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::loop(unsigned int)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'VTT for std::__ndk1::basic_ostringstream<char, std::__ndk1::char_traits, std::__ndk1::allocator >'; recompile with -fPIC

defined in CMakeFiles/kuma.dir/src/AcceptorBase.cpp.o
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::loop(unsigned int)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_emplace<kev::TokenTaskSlot, std::__ndk1::allocatorkev::TokenTaskSlot >'; recompile with -fPIC

defined in /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a(EventLoopImpl.cpp.o)
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::appendTask(std::__ndk1::function<void ()>, kev::EventLoop::Token::Impl*, char const*)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'vtable for kev::TaskSlot'; recompile with -fPIC

defined in /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a(EventLoopImpl.cpp.o)
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::appendTask(std::__ndk1::function<void ()>, kev::EventLoop::Token::Impl*, char const*)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'vtable for kev::TokenTaskSlot'; recompile with -fPIC

defined in /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a(EventLoopImpl.cpp.o)
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::appendTask(std::__ndk1::function<void ()>, kev::EventLoop::Token::Impl*, char const*)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_emplace<kev::TaskSlot, std::__ndk1::allocatorkev::TaskSlot >'; recompile with -fPIC

defined in /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a(EventLoopImpl.cpp.o)
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::appendTask(std::__ndk1::function<void ()>, kev::EventLoop::Token::Impl*, char const*)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'vtable for kev::TaskSlot'; recompile with -fPIC

defined in /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a(EventLoopImpl.cpp.o)
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::appendTask(std::__ndk1::function<void ()>, kev::EventLoop::Token::Impl*, char const*)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_emplace<kev::DelayedTaskSlot, std::__ndk1::allocatorkev::DelayedTaskSlot >'; recompile with -fPIC

defined in /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a(EventLoopImpl.cpp.o)
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::EventLoop::Impl::appendDelayedTask(unsigned int, std::__ndk1::function<void ()>, kev::EventLoop::Token::Impl*, char const*)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: relocation R_ARM_REL32 cannot be used against symbol 'vtable for kev::TaskSlot'; recompile with -fPIC

defined in /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a(EventLoopImpl.cpp.o)
referenced by EventLoopImpl.cpp
EventLoopImpl.cpp.o:(kev::DelayedTaskSlot::DelayedTaskSlot(kev::EventLoop::Impl*, std::__ndk1::function<void ()>&&, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >)) in archive /root/code/kuma/third_party/libkev/lib/android/armeabi-v7a/libkev.a

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../../../../bin/android/armeabi-v7a/libkuma.so] 错误 1
make[1]: *** [CMakeFiles/kuma.dir/all] 错误 2

it seems that no way to set Http2 connection with timeout

while TcpSocket::Impl::connect has timeout_ms arg,
but TcpConnection didn't pass this arg.

close() outside seems useless when connecting.

    // http is kuma::HttpRequest
    std::function<void()> fReconnect = [&] {
        puts("Reconnect");
        http.close();
        http.sendRequest("GET", "https://xxxxxxxxxxxx/");
        timerReconnect.schedule(1000, Timer::Mode::ONE_SHOT, fReconnect);
    };
    timerReconnect.schedule(1000, Timer::Mode::ONE_SHOT, fReconnect);

I had to insert this code into SocketBase::connect

    if (timeout_ms == 0)
        timeout_ms = 100;

and then it seems better to quick reconnect.

websocket client can't connect to the server on window

log:
INFO [19904] IocpSocket_6:: connect, host=192.168.124.6, port=8183
INFO [19904] IocpPoll::registerFd, fd=748, events=7
INFO [19904] IocpSocket_6:: connect_i, fd=748, local_ip=0.0.0.0, local_port=12431, state=2
INFO [6760] DNS resolving thread exited
INFO [21288] IocpSocket_6:: onConnect, err=0, state=2
INFO [21288] TcpSocket_5:: onConnect, err=0
INFO [21288] H1xStream_4:: onHttpEvent, ev=0
WARN [21288] IocpSocket_6:: onReceive, io_size=0, state=3, pending=0
INFO [21288] IocpSocket_6:: onClose, err=-12, state=3

Support Quic?

Hi,
I love kuma very much.

When do you suppose to support Quic?

Thanks

buildRequestHeaders didn't make path well.

H2StreamProxy.cpp : buildRequestHeaders()
The git old version discard the path part, so that I get 400 bad request.
------from----------
std::string path = uri_.getPath();
if(!uri_.getQuery().empty()) {
path = "?" + uri_.getQuery();
}
if(!uri_.getFragment().empty()) {
path = "#" + uri_.getFragment();
}
--------to--------
std::string path = uri_.getPath();
if(!uri_.getQuery().empty()) {
path += "?";
path += uri_.getQuery();
}
if(!uri_.getFragment().empty()) {
path += "#";
path += uri_.getFragment();
}

A bug in src/ws/WSHandler.cpp

src/ws/WSHandler.cpp,line 174、199, if len == pos,data[pos++] will be out of bounds , and the variate ctx_.hdr.xpl.xpl16 will be set wrong value.

x86 support

How can i compile this project to support android x86 or any other abi for that matter.
I tried generating openssl libs for x86 and put it in vendor folder however it did not work.
It keeps on giving errors like undefined references to few BIO_* and X503_*

Android Bug No implementation found for int com.jamol.kuma.WebSocket.connect

No implementation found for int com.jamol.kuma.WebSocket.connect(java.lang.String) (tried Java_com_jamol_kuma_WebSocket_connect and Java_com_jamol_kuma_WebSocket_connect__Ljava_lang_String_2)
2023-11-07 15:00:43.644 8361-8580 AndroidRuntime com.feihong.tx100test E FATAL EXCEPTION: Thread-5
Process: com.feihong.tx100test, PID: 8361
java.lang.UnsatisfiedLinkError: No implementation found for int com.jamol.kuma.WebSocket.connect(java.lang.String) (tried Java_com_jamol_kuma_WebSocket_connect and Java_com_jamol_kuma_WebSocket_connect__Ljava_lang_String_2)
at com.jamol.kuma.WebSocket.connect(Native Method)
at com.jamol.kuma.WebSocket.open(WebSocket.java:11)

MBEDTLS support

Have any plan to support mbedtls?
Openssl is too big for embended systems.

Stable status

Hi,
My question is how stable this library?
With regards

http/2.0 testing connection reuse ...request failed..

hi,
i tryed test http/2.0 request in connection reuse case...

first request has success..
but second request has failed..

HttpRequest::Impl::sendRequest() return -2 ( INVALID_STATE )
code is IDLE or WAIT_FOR_REUSE case success ... current state::COMPLETE ...

what' wrong??

No Luck compiling with OpenSSL

I use:

  • GCC 6.3.0
  • OpenSSL 1.1.0k

When the Option KUMA_HAS_OPENSSL is turned on I run into error:
In file included from ssl/SslHandler.cpp:27:0: ./../vendor/openssl/include/openssl/x509v3.h:155:1: error: expected constructor, destructor, or type conversion before ‘typedef’ typedef BIT_STRING_BITNAME ENUMERATED_NAMES; ^~~~~~~ ./../vendor/openssl/include/openssl/x509v3.h:221:1: error: expected constructor, destructor, or type conversion before ‘DECLARE_ASN1_SET_OF’ DECLARE_ASN1_SET_OF(GENERAL_NAME) ^~~~~~~~~~~~~~~~~~~ ssl/SslHandler.cpp:124:1: error: expected ‘}’ at end of input } ^ Makefile:93: recipe for target '../objs/linux/ssl/SslHandler.o' failed make: *** [../objs/linux/ssl/SslHandler.o] Error 1

Help needed pls:

  • compiler used
  • OpenSSL version etc

A bug in kuma/src/http/Uri.cpp ?

line 42, Uri::parse function,I used it to parse url such as "ws://192.168.20.105:9326?token=android" , the variable query_ is empty string.

linux compile error - http2 reuse bug patch version

hi...

i just download & compile souce..
but compile failed..

kmapi.cpp: In constructor ‘kuma::EventLoop::EventLoop(kuma::PollType)’:
kmapi.cpp:79:43: error: call of overloaded ‘ImplHelper(kuma::PollType&)’ is ambiguous
auto h = new EventLoopHelper(poll_type);
^
kmapi.cpp:79:43: note: candidates are:
kmapi.cpp:60:5: note: kuma::ImplHelper::ImplHelper(Args&& ...) [with Args = {kuma::PollType&}; Impl = kuma::EventLoop::Impl]
ImplHelper(Args&&... args)
^
kmapi.cpp:53:5: note: kuma::ImplHelper::ImplHelper(Args& ...) [with Args = {kuma::PollType}; Impl = kuma::EventLoop::Impl]
ImplHelper(Args&... args)
^
kmapi.cpp:47:8: note: kuma::ImplHelperkuma::EventLoop::Impl::ImplHelper(const kuma::ImplHelperkuma::EventLoop::Impl&)
struct ImplHelper {
^
kmapi.cpp:47:8: note: kuma::ImplHelperkuma::EventLoop::Impl::ImplHelper(kuma::ImplHelperkuma::EventLoop::Impl&&)
make: *** [../objs/linux/kmapi.o] error 1
[pgfe@pgfe1:/UDC/INFRA/OpenLib/KUMA/kuma-master/src]

SSL_ERROR

I have obtained the certificate of www.baidu.com (mv baidu.com.cer ca.pem)
but the error in the figure still appears
image

Can support Reliable UDP and Reliable MultiCast?

Reliable udp transmission is widely used in real business,There are now many reliable UDP unicast and multicast protocols. as:QUIC,KCP,NORM(Negative-ACKnowledgment Oriented Reliable Multicast),PGM 。thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.