Skip to content

Commit

Permalink
默认设置
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang Peng committed Aug 21, 2021
1 parent d43b348 commit c22e624
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Plugins/businessRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "rapidjson/stringbuffer.h"
#include "cJSON.h"
#include "datapacket.h"
#include <mysql/mysql.h>
//#include <mysql/mysql.h>
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
Expand All @@ -15,7 +15,7 @@

using namespace std;

extern MYSQL *mysql;
//extern MYSQL *mysql;


#ifdef __cplusplus
Expand Down Expand Up @@ -74,7 +74,7 @@ int get_test_handler(ngx_http_request_t *r)
{
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "%s\n", "get_test_handler");

#if 1
#if 0
/* 插入数据 */
char buf[] = "INSERT INTO `weixx`.`test` (`ID`, `name`, `age`) VALUES (14, 'aaaaa', '213');";

Expand Down
6 changes: 4 additions & 2 deletions Plugins/pluginsHttp.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
#include "businessRequest.h"
#include "pluginsHttp.h"

#include <mysql/mysql.h>
//#include <mysql/mysql.h>
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
#include <string>

MYSQL *mysql;
//MYSQL *mysql;

#ifdef __cplusplus
extern "C" {
#endif

void init_handler()
{
#if 0
// 初始化mysql
mysql = mysql_init(NULL);

Expand All @@ -27,6 +28,7 @@ void init_handler()
} else {
printf("Connect sucessfully!\n");
}
#endif
}

void get_body_hander(ngx_http_request_t *r, std::string &bodyData)
Expand Down
27 changes: 27 additions & 0 deletions esdata/logs/access.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
127.0.0.1 - - [21/Aug/2021:23:24:31 +0800] "GET / HTTP/1.1" 200 3812 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:24:31 +0800] "GET /index.css HTTP/1.1" 200 6357 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:24:31 +0800] "GET /index.js HTTP/1.1" 404 184 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:24:31 +0800] "GET /png/demo1.jpg HTTP/1.1" 200 256915 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:24:31 +0800] "GET /png/demo2.jpg HTTP/1.1" 200 289024 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:24:31 +0800] "GET /png/demo3.jpg HTTP/1.1" 200 522334 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:24:31 +0800] "GET /png/demo4.jpg HTTP/1.1" 200 382251 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:24:31 +0800] "GET /favicon.ico HTTP/1.1" 404 184 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:24:33 +0800] "GET /tp/api/get_test_tp HTTP/1.1" 200 27 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:24:34 +0800] "POST /tp/api/post_test_tp HTTP/1.1" 200 27 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:24:51 +0800] "GET /tp/api/get_test_tp HTTP/1.1" 200 27 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:24:52 +0800] "POST /tp/api/post_test_tp HTTP/1.1" 200 27 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:26:11 +0800] "GET /tp/api/get_test_tp HTTP/1.1" 200 27 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:26:12 +0800] "POST /tp/api/post_test_tp HTTP/1.1" 200 27 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:26:13 +0800] "GET /tp/api/get_test_tp HTTP/1.1" 200 27 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:26:13 +0800] "POST /tp/api/post_test_tp HTTP/1.1" 200 27 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:26:14 +0800] "GET /tp/api/get_test_tp HTTP/1.1" 200 27 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:26:14 +0800] "POST /tp/api/post_test_tp HTTP/1.1" 200 27 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:26:52 +0800] "GET /?firstname=&lastname=&country=usa HTTP/1.1" 200 3812 "http://127.0.0.1:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:26:52 +0800] "GET /index.js HTTP/1.1" 404 184 "http://127.0.0.1:8080/?firstname=&lastname=&country=usa" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:26:52 +0800] "GET /index.css HTTP/1.1" 304 0 "http://127.0.0.1:8080/?firstname=&lastname=&country=usa" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:26:52 +0800] "GET /png/demo1.jpg HTTP/1.1" 304 0 "http://127.0.0.1:8080/?firstname=&lastname=&country=usa" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:26:52 +0800] "GET /png/demo2.jpg HTTP/1.1" 304 0 "http://127.0.0.1:8080/?firstname=&lastname=&country=usa" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:26:52 +0800] "GET /png/demo3.jpg HTTP/1.1" 304 0 "http://127.0.0.1:8080/?firstname=&lastname=&country=usa" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:26:52 +0800] "GET /png/demo4.jpg HTTP/1.1" 304 0 "http://127.0.0.1:8080/?firstname=&lastname=&country=usa" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:27:12 +0800] "GET /tp/api/get_test_tp HTTP/1.1" 200 27 "http://127.0.0.1:8080/?firstname=&lastname=&country=usa" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
127.0.0.1 - - [21/Aug/2021:23:27:13 +0800] "POST /tp/api/post_test_tp HTTP/1.1" 200 27 "http://127.0.0.1:8080/?firstname=&lastname=&country=usa" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
39 changes: 39 additions & 0 deletions esdata/logs/error.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
2021/08/21 23:24:31 [error] 7149#0: *1 open() "../esdata/../esdata/html/index.js" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /index.js HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:24:31 [error] 7149#0: *1 open() "../esdata/../esdata/html/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:24:33 [error] 7149#0: *1 get_test_handler
, client: 127.0.0.1, server: localhost, request: "GET /tp/api/get_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:24:34 [error] 7149#0: *1 post_test_handler
, client: 127.0.0.1, server: localhost, request: "POST /tp/api/post_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:24:34 [error] 7149#0: *1 id=335261&name=sccuu
, client: 127.0.0.1, server: localhost, request: "POST /tp/api/post_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:24:51 [error] 7149#0: *1 get_test_handler
, client: 127.0.0.1, server: localhost, request: "GET /tp/api/get_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:24:52 [error] 7149#0: *1 post_test_handler
, client: 127.0.0.1, server: localhost, request: "POST /tp/api/post_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:24:52 [error] 7149#0: *1 id=335261&name=sccuu
, client: 127.0.0.1, server: localhost, request: "POST /tp/api/post_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:26:11 [error] 7149#0: *3 get_test_handler
, client: 127.0.0.1, server: localhost, request: "GET /tp/api/get_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:26:12 [error] 7149#0: *3 post_test_handler
, client: 127.0.0.1, server: localhost, request: "POST /tp/api/post_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:26:12 [error] 7149#0: *3 id=335261&name=sccuu
, client: 127.0.0.1, server: localhost, request: "POST /tp/api/post_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:26:13 [error] 7149#0: *3 get_test_handler
, client: 127.0.0.1, server: localhost, request: "GET /tp/api/get_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:26:13 [error] 7149#0: *3 post_test_handler
, client: 127.0.0.1, server: localhost, request: "POST /tp/api/post_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:26:13 [error] 7149#0: *3 id=335261&name=sccuu
, client: 127.0.0.1, server: localhost, request: "POST /tp/api/post_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:26:14 [error] 7149#0: *3 get_test_handler
, client: 127.0.0.1, server: localhost, request: "GET /tp/api/get_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:26:14 [error] 7149#0: *3 post_test_handler
, client: 127.0.0.1, server: localhost, request: "POST /tp/api/post_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:26:14 [error] 7149#0: *3 id=335261&name=sccuu
, client: 127.0.0.1, server: localhost, request: "POST /tp/api/post_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/"
2021/08/21 23:26:52 [error] 7149#0: *3 open() "../esdata/../esdata/html/index.js" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /index.js HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/?firstname=&lastname=&country=usa"
2021/08/21 23:27:12 [error] 7149#0: *3 get_test_handler
, client: 127.0.0.1, server: localhost, request: "GET /tp/api/get_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/?firstname=&lastname=&country=usa"
2021/08/21 23:27:13 [error] 7149#0: *3 post_test_handler
, client: 127.0.0.1, server: localhost, request: "POST /tp/api/post_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/?firstname=&lastname=&country=usa"
2021/08/21 23:27:13 [error] 7149#0: *3 id=335261&name=sccuu
, client: 127.0.0.1, server: localhost, request: "POST /tp/api/post_test_tp HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/?firstname=&lastname=&country=usa"
2 changes: 1 addition & 1 deletion include/allocation.prf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ INCLUDEPATH += $$PWD/http/modules
#-----------user lib--------------------------
INCLUDEPATH += $$PWD/rapidjson

unix:!macx: LIBS += -lmysqlclient
#unix:!macx: LIBS += -lmysqlclient



Expand Down
Binary file modified lib/libPlugins.so.1.0.0
Binary file not shown.

0 comments on commit c22e624

Please sign in to comment.