God-Xuebi
God-Xuebi
其实我关注到了你的Timer,If Timer is overtime, your code only uses the epoll_modify to stop continuing to listen the fd and unbind the relative RequestData, but i can not find the place where...
And i have another question, if the HTTP request data uses keep-alive, and if the client sends two HTTP request, how can separate the two HTTP. I have notified you...
` if (state == STATE_FINISH) { if (keep_alive) { //printf("ok\n"); this->reset(); } else { //delete this; return; } } ` By example, here for keep-alive, you uses the reset() which...
``` void TimerNode::clearReq() { request_data.reset(); this->setDeleted(); } ``` ``` void RequestData::reset() { againTimes = 0; content.clear(); file_name.clear(); path.clear(); now_read_pos = 0; state = STATE_PARSE_URI; h_state = h_start; headers.clear(); keep_alive =...
func (client *Client) terminateCalls(err error) { client.sending.Lock() defer client.sending.Unlock() client.mu.Lock() defer client.mu.Unlock() client.shutdown = true for _, call := range client.pending { call.Error = err call.done() } } 请问为什么这里要使用sending锁呢?对call.Done()这个环节应该不需要使用sending锁吧。 receive函数中的...
``` func (server *Server) handleRequest(cc codec.Codec, req *request, sending *sync.Mutex, wg *sync.WaitGroup, timeout time.Duration) { defer wg.Done() called := make(chan struct{}) sent := make(chan struct{}) go func() { err :=...
> @geektutu > @liron-li 因为主协程超时退出,没有 phase1 的接收方,子协程中 `case phase1
v, beforeClosed :=