mirror of
https://github.com/lxsang/ant-http
synced 2025-07-15 05:19:55 +02:00
request body can be decode directly or delegated to plugin
This commit is contained in:
@ -24,7 +24,8 @@
|
||||
#define R_FLOAT(d,k) ((double)atof(dvalue(d,k)))
|
||||
#define R_PTR(d,k) (dvalue(d,k))
|
||||
#define __RESULT__ "{\"result\":%d,\"msg\":\"%s\"}"
|
||||
|
||||
#define FORM_URL_ENCODE "application/x-www-form-urlencoded"
|
||||
#define FORM_MULTI_PART "multipart/form-data"
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
int __attribute__((weak)) usessl();
|
||||
@ -64,6 +65,19 @@ typedef struct {
|
||||
char* sslkey;
|
||||
#endif
|
||||
}config_t;
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
char *dbpath;
|
||||
char * htdocs;
|
||||
char*pdir;
|
||||
int sport;
|
||||
int raw_body;
|
||||
#ifdef USE_OPENSSL
|
||||
int usessl;
|
||||
#endif
|
||||
} plugin_header_t;
|
||||
|
||||
void set_nonblock(int socket);
|
||||
//void set_block(int socket);
|
||||
int response(void*, const char*);
|
||||
|
@ -11,9 +11,13 @@ void __init_plugin__(const char* pl,config_t* conf){
|
||||
#ifdef USE_OPENSSL
|
||||
__plugin__.usessl = conf->usessl;
|
||||
#endif
|
||||
__plugin__.raw_body = 0;
|
||||
init();
|
||||
};
|
||||
|
||||
void use_raw_body()
|
||||
{
|
||||
__plugin__.raw_body = 1;
|
||||
}
|
||||
#ifdef USE_DB
|
||||
sqldb __getdb(char *name)
|
||||
{
|
||||
|
@ -7,17 +7,6 @@
|
||||
#include "ws.h"
|
||||
#include "scheduler.h"
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
char *dbpath;
|
||||
char * htdocs;
|
||||
char*pdir;
|
||||
int sport;
|
||||
#ifdef USE_OPENSSL
|
||||
int usessl;
|
||||
#endif
|
||||
} plugin_header_t;
|
||||
|
||||
|
||||
|
||||
//typedef void(*call)();
|
||||
@ -40,4 +29,5 @@ void init();
|
||||
void destroy();
|
||||
void* handle(void*);
|
||||
plugin_header_t* meta();
|
||||
void use_raw_body();
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user