src/server/proxy/httpclient.h

changeset 666
c99e0b352e36
parent 665
b8d5b797d090
equal deleted inserted replaced
665:b8d5b797d090 666:c99e0b352e36
47 char *uri; 47 char *uri;
48 48
49 struct sockaddr *addr; 49 struct sockaddr *addr;
50 size_t addrlen; 50 size_t addrlen;
51 51
52 int socketfd;
53
52 HeaderArray *request_headers; 54 HeaderArray *request_headers;
53 HeaderArray *response_headers; 55 HeaderArray *response_headers;
54 56
55 /* 57 /*
56 * Request body callback function 58 * Request body callback function
86 void *response_finished_userdata; 88 void *response_finished_userdata;
87 89
88 90
89 // internals 91 // internals
90 92
91 Event out_event; 93 char *req_buffer;
92 Event in_event; 94 size_t req_buffer_len;
95
96 Event readev;
97 Event writeev;
93 }; 98 };
94 99
95 HttpClient* http_client_new(EventHandler *ev); 100 HttpClient* http_client_new(EventHandler *ev);
96 101
97 int http_client_set_addr(HttpClient *client, const struct sockaddr *addr, socklen_t addrlen); 102 int http_client_set_addr(HttpClient *client, const struct sockaddr *addr, socklen_t addrlen);
110 * This functions creates a copy of name/value and the original pointers can be 115 * This functions creates a copy of name/value and the original pointers can be
111 * discarded after the function returns. 116 * discarded after the function returns.
112 */ 117 */
113 int http_client_add_request_header_copy(HttpClient *client, cxstring name, cxstring value); 118 int http_client_add_request_header_copy(HttpClient *client, cxstring name, cxstring value);
114 119
120 int http_client_start(HttpClient *client);
115 121
116 #ifdef __cplusplus 122 #ifdef __cplusplus
117 } 123 }
118 #endif 124 #endif
119 125

mercurial