Commit a9dba509 authored by Ken Coar's avatar Ken Coar
Browse files

	This sets an example for this type of module, so let's make sure
	it uses our own guidelines.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87636 13f79535-47bb-0310-9956-ffa450edef68
parent ad31b304
Loading
Loading
Loading
Loading
+28 −26
Original line number Diff line number Diff line
@@ -64,8 +64,7 @@

AP_DECLARE_DATA module echo_module;

typedef struct
    {
typedef struct {
    int bEnabled;
} EchoConfig;

@@ -93,21 +92,23 @@ static int process_echo_connection(conn_rec *c)
    EchoConfig *pConfig = ap_get_module_config(c->base_server->module_config,
                                               &echo_module);

    if(!pConfig->bEnabled)
    if (!pConfig->bEnabled) {
        return DECLINED;
    }

    for( ; ; )
	{
    for ( ; ; ) {
	apr_ssize_t r, w;
        r = sizeof(buf);
        apr_recv(c->client_socket, buf, &r);
	if(r <= 0)
	if (r <= 0) {
            break;
        }
        w = r;
	apr_send(c->client_socket, buf, &w);
	if(w != r)
	if (w != r) {
	    break;
        }
    }
    return OK;
}

@@ -120,7 +121,8 @@ static const command_rec echo_cmds[] =

static void register_hooks(void)
{
    ap_hook_process_connection(process_echo_connection,NULL,NULL,AP_HOOK_MIDDLE);
    ap_hook_process_connection(process_echo_connection, NULL, NULL,
                               AP_HOOK_MIDDLE);
}

AP_DECLARE_DATA module echo_module = {