mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-29 15:26:38 +02:00
Rename some more:
* WEB() now has handle_request() and handle_body(), makes more sense. * webserver_handle_body_data() -> webserver_handle_body() * and similar cases
This commit is contained in:
@@ -147,7 +147,7 @@ int rpc_config_run_ex(ConfigFile *cf, ConfigEntry *ce, int type, void *ptr)
|
||||
l->start_handshake = rpc_client_handshake;
|
||||
l->webserver = safe_alloc(sizeof(WebServer));
|
||||
l->webserver->handle_request = rpc_handle_webrequest;
|
||||
l->webserver->handle_data = rpc_handle_webrequest_data;
|
||||
l->webserver->handle_body = rpc_handle_webrequest_data;
|
||||
l->rpc_options = 1;
|
||||
|
||||
return 1;
|
||||
@@ -207,7 +207,7 @@ int rpc_handle_webrequest_data(Client *client, WebRequest *web, const char *buf,
|
||||
|
||||
// NB: content_length
|
||||
// NB: chunked transfers?
|
||||
if (!webserver_handle_request_body(client, web, buf, len))
|
||||
if (!webserver_handle_body(client, web, buf, len))
|
||||
{
|
||||
webserver_send_response(client, 400, "Error handling POST body data\n");
|
||||
return 0;
|
||||
|
||||
@@ -40,7 +40,7 @@ int webserver_handle_handshake(Client *client, const char *readbuf, int *length)
|
||||
int webserver_handle_request_header(Client *client, const char *readbuf, int *length);
|
||||
void _webserver_send_response(Client *client, int status, char *msg);
|
||||
void _webserver_close_client(Client *client);
|
||||
int _webserver_handle_request_body(Client *client, WebRequest *web, const char *readbuf, int length);
|
||||
int _webserver_handle_body(Client *client, WebRequest *web, const char *readbuf, int length);
|
||||
|
||||
/* Global variables */
|
||||
ModDataInfo *webserver_md;
|
||||
@@ -50,7 +50,7 @@ MOD_TEST()
|
||||
MARK_AS_OFFICIAL_MODULE(modinfo);
|
||||
EfunctionAddVoid(modinfo->handle, EFUNC_WEBSERVER_SEND_RESPONSE, _webserver_send_response);
|
||||
EfunctionAddVoid(modinfo->handle, EFUNC_WEBSERVER_CLOSE_CLIENT, _webserver_close_client);
|
||||
EfunctionAdd(modinfo->handle, EFUNC_WEBSERVER_HANDLE_BODY_DATA, _webserver_handle_request_body);
|
||||
EfunctionAdd(modinfo->handle, EFUNC_WEBSERVER_HANDLE_BODY, _webserver_handle_body);
|
||||
return MOD_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ int webserver_packet_in(Client *client, const char *readbuf, int *length)
|
||||
return 1; /* "normal" IRC client */
|
||||
|
||||
if (WEB(client)->request_header_parsed)
|
||||
return WEBSERVER(client)->handle_data(client, WEB(client), readbuf, *length);
|
||||
return WEBSERVER(client)->handle_body(client, WEB(client), readbuf, *length);
|
||||
|
||||
/* else.. */
|
||||
return webserver_handle_request_header(client, readbuf, length);
|
||||
@@ -408,7 +408,7 @@ int webserver_handle_request_header(Client *client, const char *readbuf, int *le
|
||||
*/
|
||||
nextframe = find_end_of_request(netbuf2, totalsize, &remaining_bytes);
|
||||
if (nextframe)
|
||||
return WEBSERVER(client)->handle_data(client, WEB(client), nextframe, remaining_bytes);
|
||||
return WEBSERVER(client)->handle_body(client, WEB(client), nextframe, remaining_bytes);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -474,7 +474,7 @@ void _webserver_close_client(Client *client)
|
||||
}
|
||||
}
|
||||
|
||||
int webserver_handle_request_body_append_buffer(Client *client, const char *buf, int len)
|
||||
int webserver_handle_body_append_buffer(Client *client, const char *buf, int len)
|
||||
{
|
||||
/* Guard.. */
|
||||
if (len <= 0)
|
||||
@@ -490,7 +490,7 @@ int webserver_handle_request_body_append_buffer(Client *client, const char *buf,
|
||||
return 1;
|
||||
}
|
||||
|
||||
int _webserver_handle_request_body(Client *client, WebRequest *web, const char *readbuf, int length)
|
||||
int _webserver_handle_body(Client *client, WebRequest *web, const char *readbuf, int length)
|
||||
{
|
||||
char *buf;
|
||||
long long n;
|
||||
@@ -499,7 +499,7 @@ int _webserver_handle_request_body(Client *client, WebRequest *web, const char *
|
||||
if (1) // (WEB(client)->transfer_encoding == TRANSFER_ENCODING_NONE)
|
||||
{
|
||||
/* Ohh.. so easy! */
|
||||
webserver_handle_request_body_append_buffer(client, readbuf, length);
|
||||
webserver_handle_body_append_buffer(client, readbuf, length);
|
||||
WEB(client)->request_body_complete = 1; // FIXME: WRONG! But for testing ;)
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ int websocket_config_run_ex(ConfigFile *cf, ConfigEntry *ce, int type, void *ptr
|
||||
l = (ConfigItem_listen *)ptr;
|
||||
l->webserver = safe_alloc(sizeof(WebServer));
|
||||
l->webserver->handle_request = websocket_handle_request;
|
||||
l->webserver->handle_data = websocket_handle_websocket;
|
||||
l->webserver->handle_body = websocket_handle_websocket;
|
||||
|
||||
for (cep = ce->items; cep; cep = cep->next)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user