// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd_test.c
// Function: httpd_handler(httpChilent_t*)
void httpd_handler(struct httpChilent_t * httpChilent) 
{
    char path[512];
    do{
        if(strcasecmp(httpChilent->request.method, "GET") == 0)
        {
            if(strcmp(httpChilent->request.url,"/") == 0 || strcmp(httpChilent->request.url, "/null") == 0)
            {
                sprintf(path, "./wwwroot/index.html");
            }
            else
            {
                sprintf(path, "./wwwroot%s", httpChilent->request.url);
                if(httpChilent->request.url[strlen(httpChilent->request.url) - 1] == '/')
                {
                    strcat(path, "index.html");
                }

            }
            serve_file(httpChilent, path);
            /*
            httpChilent->resqonse.resqonseCode = HTTP_OK;
            int len  = httpChilent->resqonse.Resqonse_data_len= strlen(HTTP_MOVEPERM_CONTENT);
            sprintf(num,"%d",len);
            httpChilent->resqonse.HeadParameter->insert(HaedParameteMapPairi("Content-Type", "text/html"));
            httpChilent->resqonse.HeadParameter->insert(HaedParameteMapPairi("Content-Length",num));
            httpChilent->resqonse.resqonse_data = (char *)malloc(httpChilent->resqonse.Resqonse_data_len);
            strcpy(httpChilent->resqonse.resqonse_data, HTTP_MOVEPERM_CONTENT);
            */
        }
        else if(strcasecmp(httpChilent->request.method, "POST") == 0)
        {
             
        }
        if(httpChilent->request.HeadParameter != NULL)
        {
            HeadParameterMap::iterator v;
            v = httpChilent->request.HeadParameter->find("Connection");
            if(v != httpChilent->request.HeadParameter->end())
            {
                if(strcasecmp(v->second.c_str(), "keep-alive") == 0)
                {

                }
                else if(strcasecmp(v->second.c_str(), "close") == 0)
                {
                    break;
                }
            }
            else
            {
                break;
            }
        }
        resqonse(httpChilent);
        return;
    }while(0);
    resqonse(httpChilent);
    httpChilent_Close(httpChilent);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, %rbx
movq 0x40(%rdi), %rdi
leaq 0x23bf(%rip), %rsi      # 0xba9b
callq 0x34c0
testl %eax, %eax
jne 0x9792
movq 0x50(%rbx), %r14
cmpb $0x2f, (%r14)
jne 0x96fa
cmpb $0x0, 0x1(%r14)
je 0x9764
leaq 0x28ea(%rip), %rsi      # 0xbfeb
movq %r14, %rdi
callq 0x35f0
testl %eax, %eax
je 0x9764
leaq 0x28f2(%rip), %rsi      # 0xc006
leaq -0x240(%rbp), %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x30f0
movq 0x50(%rbx), %r14
movq %r14, %rdi
callq 0x31f0
cmpb $0x2f, -0x1(%r14,%rax)
jne 0x9783
leaq -0x240(%rbp), %rdi
callq 0x31f0
movabsq $0x74682e7865646e69, %rcx # imm = 0x74682E7865646E69
movq %rcx, -0x240(%rbp,%rax)
movl $0x6c6d74, -0x239(%rbp,%rax) # imm = 0x6C6D74
jmp 0x9783
movups 0x2886(%rip), %xmm0     # 0xbff1
movaps %xmm0, -0x240(%rbp)
movabsq $0x6c6d74682e7865, %rax # imm = 0x6C6D74682E7865
movq %rax, -0x233(%rbp)
leaq -0x240(%rbp), %rsi
movq %rbx, %rdi
callq 0x951a
movq 0x60(%rbx), %r14
testq %r14, %r14
je 0x9800
leaq 0x2870(%rip), %rsi      # 0xc012
leaq -0x40(%rbp), %r15
leaq -0x19(%rbp), %rdx
movq %r15, %rdi
callq 0x73f2
movq %r14, %rdi
movq %r15, %rsi
callq 0x7734
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x3200
movq 0x60(%rbx), %rax
addq $0x8, %rax
cmpq %rax, %r14
je 0x980a
movq 0x40(%r14), %r14
leaq 0x283c(%rip), %rsi      # 0xc01d
movq %r14, %rdi
callq 0x34c0
testl %eax, %eax
je 0x9800
leaq 0x2834(%rip), %rsi      # 0xc028
movq %r14, %rdi
callq 0x34c0
testl %eax, %eax
je 0x980a
movq %rbx, %rdi
callq 0x4deb
jmp 0x981a
movq %rbx, %rdi
callq 0x4deb
movq %rbx, %rdi
callq 0x64d2
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x3200
movq %rbx, %rdi
callq 0x3770