Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kehengzhong authored Dec 28, 2020
1 parent 6d2c504 commit 661ce21
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 25 deletions.
14 changes: 11 additions & 3 deletions include/ejet.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ typedef struct http_msg {
int64 req_stream_sent;
int64 req_stream_recv;

/* by adopting zero-copy for higher performance, frame buffers of HTTPCon, which stores
octets from sockets, will be moved to following list, for further parsing or handling,
when receiving octest from client connection and forwarding to origin server.
the overhead of memory copy will be lessened significantly. */
arr_t * req_rcvs_list;

/* if content type of POST request is multipart form, every part is stored in list */
arr_t * req_formlist;
void * req_form_json;
Expand Down Expand Up @@ -273,7 +279,8 @@ typedef struct http_msg {
int64 res_stream_recv;

/* by adopting zero-copy for higher performance, frame buffers of HTTPCon, which stores
octets from sockets, will be moved to following list, for further parsing or handling.
octets from sockets, will be moved to following list, for further parsing or handling,
when receiving octest from origin server connection and forwarding to client.
the overhead of memory copy will be lessened significantly. */
arr_t * res_rcvs_list;

Expand All @@ -290,6 +297,7 @@ typedef struct http_msg {
uint8 reshandle_called;
void * reshandle_para;
void * reshandle_cbval;

char * res_store_file;
int64 res_store_offset;

Expand All @@ -302,8 +310,8 @@ typedef struct http_msg {

int (*SetTearDownNotify)(void * vmsg, void * func, void * para);
int (*SetResponseHandle)(void * vmsg, void * func, void * para, void * cbval,
char * storefile, int64 offset,
void * procnotify, void * notifypara);
char * storefile, int64 offset,
void * procnotify, void * notifypara);

char * (*GetMIME) (void * vmsg, char * extname, uint32 * mimeid);
void * (*GetMIMEMgmt) (void * vmsg);
Expand Down
28 changes: 28 additions & 0 deletions include/http_cc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2003-2021 Ke Hengzhong <[email protected]>
* All rights reserved. See MIT LICENSE for redistribution.
*/

#ifndef _HTTP_CONGESTION_H_
#define _HTTP_CONGESTION_H_

#ifdef __cplusplus
extern "C" {
#endif

int http_cli_recv_cc (void * vcon);
int http_cli_send_cc (void * vcon);

int http_srv_recv_cc (void * vcon);
int http_srv_send_cc (void * vcon);

int http_fcgi_recv_cc (void * vcon);
int http_fcgi_send_cc (void * vcon);

#ifdef __cplusplus
}
#endif

#endif


12 changes: 0 additions & 12 deletions include/http_do.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ extern "C" {
/* auto-redirect to new Location when response status is 301/302 */
int http_redirect_request (void * vmsg);

/* determine if the network is connected to */
int http_net_active (void * vmgmt, int oldstate);

/* sending HTTP Request to HTTPServer and receiving the response */
int do_http_request (void * vmsg);

Expand All @@ -25,10 +22,6 @@ void * do_http_get_msg (void * vmgmt, char * url, int urllen,
void * do_http_get (void * vmgmt, char * url, int urllen, void * resfunc, void * para, void * cbval,
void * rcvprocfunc, void * funcpara, char * resfile, long resoff);

void * origin_http_get (void * vmgmt, char * url, int urllen, void * resfunc, void * para, void * cbval,
void * rcvprocfunc, void * funcpara, char * resfile,
long resoff, uint64 start, uint64 size, char * route, char * opaque);


void * do_http_post_msg (void * vmgmt, char * url, int urllen, char * mime,
char * body, int bodylen,
Expand All @@ -44,11 +37,6 @@ void * do_http_post (void * vmgmt, char * url, int urllen, char * mime,
void * rcvprocfunc, void * rcvpara,
void * sndprocfunc, void * sndpara, char * resfile, long resoff);

void * do_http_range_get_msg (void * vmgmt, char * url, int urllen,
void * resfunc, void * para, void * cbval,
void * rcvprocfunc, void * funcpara, void * funccbval,
char * resfile, long resoff, uint64 start, uint64 size, char *route, char * opaque);

#ifdef __cplusplus
}
#endif
Expand Down
1 change: 1 addition & 0 deletions include/http_fcgi_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ int http_fcgicon_crash_handle (void * vcon);

int http_fcgi_send_probe (void * vcon);
int http_fcgi_send (void * vcon);
int http_fcgi_send_final (void * vmsg);

int http_fcgi_recv (void * vcon);
int http_fcgi_recv_parse (void * vcon);
Expand Down
19 changes: 13 additions & 6 deletions include/http_fcgi_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,18 @@ typedef struct fastcgi_msg_s {

int req_body_flag; //BC_CONTENT_LENGTH or BC_TE
int64 req_body_length;
void * req_chunk;

int64 req_body_iolen;
int64 req_stream_sent; //total sent length including header and body
int64 req_header_sent; //body length that read or write already
int64 req_body_sent; //body length that read or write already
uint8 reqsent; //0-not sent or in sending 1-already sent


/* by adopting zero-copy for higher performance, frame buffers of HTTPCon, which stores
octets from sockets, will be moved to following list, for further parsing or handling.
the overhead of memory copy will be lessened significantly. */
arr_t * req_rcvs_list;

/* the fragmented data blocks to be sent to CGI-Server are stored in chunk_t */
chunk_t * req_body_chunk;

unsigned fcgi_role : 16;
unsigned fcgi_keep_alive : 1;
Expand Down Expand Up @@ -170,11 +175,13 @@ int http_fcgimsg_abort_encode (void * vmsg);

int http_fcgimsg_stdin_init (void * vmsg);
int http_fcgimsg_stdin_encode (void * vmsg, void * pbyte, int bytelen, int end);
int http_fcgimsg_stdin_encode_end (void * vmsg);
int http_fcgimsg_stdin_end_encode (void * vmsg);
int http_fcgimsg_stdin_body_sentnum (void * vmsg, int sentlen);

int http_fcgimsg_pre_crash (void * vmsg, int status);

int http_fcgimsg_stdin_encode_chunk (void * vmsg, void * pbyte, int bytelen, void * porig, int end);
int http_fcgimsg_stdin_end_encode_chunk (void * vmsg);

#ifdef __cplusplus
}
Expand Down
11 changes: 9 additions & 2 deletions include/http_msg.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003-2020 Ke Hengzhong <[email protected]>
* Copyright (c) 2003-2021 Ke Hengzhong <[email protected]>
* All rights reserved. See MIT LICENSE for redistribution.
*/

Expand Down Expand Up @@ -175,6 +175,12 @@ typedef struct http_msg {
int64 req_stream_sent;
int64 req_stream_recv;

/* by adopting zero-copy for higher performance, frame buffers of HTTPCon, which stores
octets from sockets, will be moved to following list, for further parsing or handling,
when receiving octest from client connection and forwarding to origin server.
the overhead of memory copy will be lessened significantly. */
arr_t * req_rcvs_list;

/* if content type of POST request is multipart form, every part is stored in list */
arr_t * req_formlist;
void * req_form_json;
Expand Down Expand Up @@ -270,7 +276,8 @@ typedef struct http_msg {
int64 res_stream_recv;

/* by adopting zero-copy for higher performance, frame buffers of HTTPCon, which stores
octets from sockets, will be moved to following list, for further parsing or handling.
octets from sockets, will be moved to following list, for further parsing or handling,
when receiving octest from origin server connection and forwarding to client.
the overhead of memory copy will be lessened significantly. */
arr_t * res_rcvs_list;

Expand Down
5 changes: 3 additions & 2 deletions include/http_srv_io.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003-2020 Ke Hengzhong <[email protected]>
* Copyright (c) 2003-2021 Ke Hengzhong <[email protected]>
* All rights reserved. See MIT LICENSE for redistribution.
*/

Expand All @@ -11,7 +11,8 @@ extern "C" {
#endif

int http_srv_send_probe (void * vcon);
int http_srv_send (void * vcon);
int http_srv_send (void * vcon);
int http_srv_send_final (void * vmsg);

int http_srv_recv (void * vcon);

Expand Down

0 comments on commit 661ce21

Please sign in to comment.