// File: /workspace/github_c_makefile_star2_O0/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
subq $0x280, %rsp            # imm = 0x280
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
leaq 0x3189(%rip), %rsi      # 0x15a67
callq 0x4580
cmpl $0x0, %eax
jne 0x129ac
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
leaq 0x376b(%rip), %rsi      # 0x16066
callq 0x46c0
cmpl $0x0, %eax
je 0x1291e
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
leaq 0x3754(%rip), %rsi      # 0x16068
callq 0x46c0
cmpl $0x0, %eax
jne 0x12935
leaq -0x210(%rbp), %rdi
leaq 0x3742(%rip), %rsi      # 0x1606e
movb $0x0, %al
callq 0x4110
jmp 0x1299a
leaq -0x210(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdx
leaq 0x3738(%rip), %rsi      # 0x16083
movb $0x0, %al
callq 0x4110
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x268(%rbp)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x4220
movq %rax, %rcx
movq -0x268(%rbp), %rax
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
jne 0x12998
leaq -0x210(%rbp), %rdi
leaq 0x36e5(%rip), %rsi      # 0x16078
callq 0x4860
jmp 0x1299a
movq -0x8(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x12600
jmp 0x129c9
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
leaq 0x30b0(%rip), %rsi      # 0x15a6b
callq 0x4580
cmpl $0x0, %eax
jne 0x129c7
jmp 0x129c7
jmp 0x129c9
movq -0x8(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x12b46
leaq -0x218(%rbp), %rdi
callq 0xad30
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x278(%rbp)
leaq -0x241(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x4850
movq -0x270(%rbp), %rdx
leaq 0x367b(%rip), %rsi      # 0x1608f
leaq -0x240(%rbp), %rdi
callq 0xad80
jmp 0x12a22
movq -0x278(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0xad50
movq %rax, -0x280(%rbp)
jmp 0x12a3e
movq -0x280(%rbp), %rax
movq %rax, -0x220(%rbp)
movq -0x220(%rbp), %rax
movq %rax, -0x218(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x42f0
leaq -0x241(%rbp), %rdi
callq 0x4560
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0xae60
movq %rax, -0x260(%rbp)
leaq -0x218(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0xaef0
testb $0x1, %al
jne 0x12aa2
jmp 0x12b42
leaq -0x218(%rbp), %rdi
callq 0xae90
movq %rax, %rdi
addq $0x20, %rdi
callq 0x4200
movq %rax, %rdi
leaq 0x35d6(%rip), %rsi      # 0x1609a
callq 0x4580
cmpl $0x0, %eax
jne 0x12b10
jmp 0x12b40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
jmp 0x12b02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x42f0
leaq -0x241(%rbp), %rdi
callq 0x4560
jmp 0x12b6c
leaq -0x218(%rbp), %rdi
callq 0xae90
movq %rax, %rdi
addq $0x20, %rdi
callq 0x4200
movq %rax, %rdi
leaq 0x3573(%rip), %rsi      # 0x160a5
callq 0x4580
cmpl $0x0, %eax
jne 0x12b3e
jmp 0x12b51
jmp 0x12b40
jmp 0x12b44
jmp 0x12b51
jmp 0x12b46
movq -0x8(%rbp), %rdi
callq 0x6c70
jmp 0x12b63
movq -0x8(%rbp), %rdi
callq 0x6c70
movq -0x8(%rbp), %rdi
callq 0x93a0
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
movq -0x250(%rbp), %rdi
callq 0x4830
nopl (%rax,%rax)