-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathprocess.h
More file actions
31 lines (29 loc) · 931 Bytes
/
process.h
File metadata and controls
31 lines (29 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef __PROCESS_H
#define __PROCESS_H
#include "libhttp/mempool.h"
#include "libhttp/http.h"
/*
* request_read: 处理http连接请求。
* 参数:
* client: client实例的指针,
* sockfd: socket 文件描述符。
* 返回:
* -1: 表示出错,
* 1(HTTP_SOCKFD_IN): 表示I/O层监听sockfd读事件。
* 2(HTTP_SOCKFD_OUT): 表示I/O层监听sockfd写事件。
* 4(HTTP_SOCKFD_DEL): 表示I/O层删除sockfd事件监听。
*/
int request_read(struct http_client *client, int sockfd);
/*
* response_write: 回写http响应。
* 参数:
* client: client实例的指针,
* sockfd: socket 文件描述符。
* 返回:
* -1: 表示出错,
* 1(HTTP_SOCKFD_IN): 表示I/O层监听sockfd读事件。
* 2(HTTP_SOCKFD_OUT): 表示I/O层监听sockfd写事件。
* 4(HTTP_SOCKFD_DEL): 表示I/O层删除sockfd事件监听。
*/
int response_write(struct http_client *client, int sockfd);
#endif