// File: trisolaris233[P]httpc/src/connection.hpp
// Function: httpc::Connection::HandleRead_(boost::system::error_code const&, unsigned long)
void HandleRead_(
            boost::system::error_code const& ec, std::size_t bytes_transferred
        ) {
            auto parse_res = 
                this->parser_.Parse(
                    this->request_, this->buffer_.data(),
                    this->buffer_.data() + bytes_transferred
                );
            auto res_enum = std::get<0>(parse_res);
            // if a request if parsed completely
            if (res_enum == RequestParser::kGood) {
                // all the headers is read
                // then check the alive state
                this->CheckKeepAlive_();
                // update the uri required
                this->request_.uri.Update();
                auto itr = this->request_.FindHeader("Content-Length");
                if (itr == this->request_.HeaderCEnd()) {
                    // if not found
                    // find the route
                    this->http_router_.Route(
                        this->request_.method,
                        this->request_.uri.GetUri(), 
                        this->request_, 
                        this->response_
                    );
                    this->handler_.Respond(
                        this->request_,
                        this->response_
                    );
                    this->DoWrite();
                } else {
                    // call once the user bussiness
                    // pass the judgement of whether receive the next file
                    // to user.
                    this->http_router_.Route(
                        this->request_.method,
                        this->request_.uri.GetUri(), 
                        this->request_, 
                        this->response_
                    );

                    auto itr2 = this->request_.FindHeader("Content-Type");
                    if (itr2 != this->request_.HeaderCEnd()
                        && itr2->value.find_first_of("multipart/formdata") != std::string::npos) {

                        if (this->request_.RecvNextFileOrNot()) {
                            debug().dg("here try to read post body").lf();
                            // debug().dg(this->socket_.available()).lf();
                            this->ReadBody();
                            return;
                        }
                    }
                    this->handler_.Respond(
                        this->request_,
                        this->response_
                    );
                    this->DoWrite();
                    
                    
                }
                // debug().dg("invoke this->readbody()").lf();
                //this->ResetKeepAliveTimer();
            } else if (res_enum == RequestParser::kIndeterminate) {
                //this->ResetKeepAliveTimer();
                this->DoRead();
            } else {   // make a bad request.
                this->response_.SetDefault(HTTPStatusCodeEnum::kBadRequest);
                this->DoWrite();
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x78(%rbp)
movq %rdi, %rax
addq $0x268, %rax            # imm = 0x268
movq %rax, -0x70(%rbp)
movq %rdi, %rax
addq $0x2a8, %rax            # imm = 0x2A8
movq %rax, -0x68(%rbp)
addq $0x68, %rdi
callq 0x30800
movq -0x78(%rbp), %rdi
movq %rax, -0x60(%rbp)
addq $0x68, %rdi
callq 0x30800
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq %rax, %r8
addq -0x18(%rbp), %r8
leaq -0x28(%rbp), %rdi
callq 0x30690
leaq -0x28(%rbp), %rdi
callq 0x30820
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x30569
movq -0x78(%rbp), %rdi
callq 0x30840
movq -0x78(%rbp), %rdi
addq $0x2a8, %rdi            # imm = 0x2A8
addq $0x20, %rdi
callq 0x30c60
movq -0x78(%rbp), %rdi
addq $0x2a8, %rdi            # imm = 0x2A8
leaq 0x2945e(%rip), %rsi     # 0x597c4
callq 0x30c80
movq -0x78(%rbp), %rdi
movq %rax, -0x38(%rbp)
addq $0x2a8, %rdi            # imm = 0x2A8
callq 0x30d50
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x30d10
testb $0x1, %al
jne 0x30399
jmp 0x3041f
movq -0x78(%rbp), %rdi
movq 0x10(%rdi), %rax
movq %rax, -0x88(%rbp)
movq %rdi, %rax
addq $0x2a8, %rax            # imm = 0x2A8
movq %rax, -0x80(%rbp)
addq $0x2a8, %rdi            # imm = 0x2A8
addq $0x20, %rdi
callq 0x312f0
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %r8
movq %rax, %rdx
movq %r8, %rcx
addq $0x2a8, %rcx            # imm = 0x2A8
addq $0x3d0, %r8             # imm = 0x3D0
callq 0x30d80
movq -0x78(%rbp), %rdx
movq %rdx, %rdi
addq $0x490, %rdi            # imm = 0x490
movq %rdx, %rsi
addq $0x2a8, %rsi            # imm = 0x2A8
addq $0x3d0, %rdx            # imm = 0x3D0
callq 0x56d00
movq -0x78(%rbp), %rdi
callq 0x31310
jmp 0x30567
movq -0x78(%rbp), %rdi
movq 0x10(%rdi), %rax
movq %rax, -0xa0(%rbp)
movq %rdi, %rax
addq $0x2a8, %rax            # imm = 0x2A8
movq %rax, -0x98(%rbp)
addq $0x2a8, %rdi            # imm = 0x2A8
addq $0x20, %rdi
callq 0x312f0
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x78(%rbp), %r8
movq %rax, %rdx
movq %r8, %rcx
addq $0x2a8, %rcx            # imm = 0x2A8
addq $0x3d0, %r8             # imm = 0x3D0
callq 0x30d80
movq -0x78(%rbp), %rdi
addq $0x2a8, %rdi            # imm = 0x2A8
leaq 0x292c6(%rip), %rsi     # 0x59751
callq 0x313c0
movq -0x78(%rbp), %rdi
movq %rax, -0x48(%rbp)
addq $0x2a8, %rdi            # imm = 0x2A8
callq 0x30d50
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x14d60
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x89(%rbp)
jne 0x304c6
jmp 0x304f3
leaq -0x48(%rbp), %rdi
callq 0x31450
movq %rax, %rdi
addq $0x20, %rdi
leaq 0x29742(%rip), %rsi     # 0x59c1f
xorl %eax, %eax
movl %eax, %edx
callq 0xa380
cmpq $-0x1, %rax
setne %al
movb %al, -0x89(%rbp)
movb -0x89(%rbp), %al
testb $0x1, %al
jne 0x304ff
jmp 0x3053a
movq -0x78(%rbp), %rdi
addq $0x2a8, %rdi            # imm = 0x2A8
callq 0x31470
testb $0x1, %al
jne 0x30515
jmp 0x30538
leaq -0x51(%rbp), %rdi
leaq 0x29712(%rip), %rsi     # 0x59c32
callq 0x31490
movq %rax, %rdi
callq 0x2cc60
movq -0x78(%rbp), %rdi
callq 0x314b0
jmp 0x3059a
jmp 0x3053a
movq -0x78(%rbp), %rdx
movq %rdx, %rdi
addq $0x490, %rdi            # imm = 0x490
movq %rdx, %rsi
addq $0x2a8, %rsi            # imm = 0x2A8
addq $0x3d0, %rdx            # imm = 0x3D0
callq 0x56d00
movq -0x78(%rbp), %rdi
callq 0x31310
jmp 0x3059a
cmpl $0x2, -0x2c(%rbp)
jne 0x3057a
movq -0x78(%rbp), %rdi
callq 0x2ce90
jmp 0x30598
movq -0x78(%rbp), %rdi
addq $0x3d0, %rdi            # imm = 0x3D0
movl $0x190, %esi            # imm = 0x190
callq 0xf680
movq -0x78(%rbp), %rdi
callq 0x31310
jmp 0x3059a
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)