make && sudo make install
Hi.
In documents written response->getJsonObject() will return an empty shared_ptr of response is not json object but for me it's cause crash
20220725 08:28:44.788119 UTC 45246 ERROR * Line 1, Column 1
Syntax error: value, object or array expected.
- HttpResponseImpl.cc:832
20220725 08:28:44.788201 UTC 45246 ERROR body: <html>
<head><title>404 Not Found</title></head>
<body bgcolor="white" text="black">
<center><h1>404 Not Found</h1></center>
<hr><center>drogon/1.7.5</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
- HttpResponseImpl.cc:833
Press <RETURN> to close this window...
Am I mistaken?
Hi, I have a question regarding the AOP of drogon (https://drogon.docsforge.com/master/aop-aspect-oriented-programming/#aop-schematic)
Is it possible to graft somewhere between the pre-handling join-point and the Hander to do some kind of task during the processing of the data of an http request? The default handler is called only at the end of the upload.
For example: on a file upload, insert a callback that creates on start a database entry, so that the file is immediately available for clients, then updates the databse entry during the upload.
Intended usage: record audio and send it chunked to the server until the end of the recording, AND make the partial audio file immediately available for re-serving for other clients (play during record).
trantor::InetAddress inetInfo("127.0.0.1", 1102);
auto socketClient =
trantor::TcpClient(trantor::EventLoop::getEventLoopOfCurrentThread(), inetInfo, "kick-ass-gamer");
try {
socketClient.setConnectionCallback([](const trantor::TcpConnectionPtr &conn) {
if (conn->connected()) {
LOG_INFO << "connected to db";
} else {
LOG_ERROR << "connect to db failed";
}
});
socketClient.setConnectionErrorCallback([]() { LOG_DEBUG << "connect to db error"; });
socketClient.connect();
const auto connPtr = socketClient.connection();
if (!connPtr) {
throw std::runtime_error("Connect to db failed #" + std::to_string(server.getValueOfId()));
}
// connPtr->send(reinterpret_cast<const char *>(&packets[0]), packets.size());
socketClient.disconnect();
} catch (const std::exception &e) {
LOG_ERROR << e.what();
}
socketClient.stop();
Hello, all !
I'm trying to send a request to a Keycloak thanks to an HttpRequest, created with newHttpFormPostRequest() (as Keycloak only accept content type: application/x-www-form-urlencoded).
I'm getting an error /home/user/drogon/lib/src/HttpRequestImpl.cc:313: void drogon::HttpRequestImpl::appendToBuffer(trantor::MsgBuffer*) const: Assertion !(!content.empty() && !content_.empty()) failed.
What should I do ?
Also, for this type of request, should I fill my form entries thanks to the setParameter() method or thanks to the setBody() ? It seems that x-www-form-urlencoded requests puts everything in the Body.
Thanks a lot for your answers !
lib/inc/drogon/plugins
MoviesPlugin
and I would use this plugin as a service that would interact with ORM.Movie
, MoviesPlugin
and MoviesController
Hi, i have a problem with dbClient creation. When i try to use different host than 127.0. 0.1 on run time says "Socket fd < 0, Usually this is because the number of files opened by the program exceeds the system limit. Please use the ulimit command to check. - PgConnection.cc:71"
"db_clients": [
{
//name:Name of the client,'default' by default
//"name":"",
//rdbms:server type, "postgreSQL" by default
"rdbms": "postgresql",
//host:server address,localhost by default
"host": "drogondb.do",
//port:server port, 5432 by default
"port": 5432,
//dbname:Database name
"dbname": "hello_world",
//user:'postgres' by default
"user": "benchmarkdbuser",
//passwd:'' by default
"passwd": "benchmarkdbpass",
//is_fast: false by default, if it is true, the client is faster but user can't call
//any synchronous interface of it.
"is_fast": true,
//connection_number:1 by default
"connection_number": 1,
"auto_batch": false
}
i'am using this config, what i'm missing?