Thanks to visit codestin.com
Credit goes to github.com

Skip to content

libcur not read the socket when EPOLLIN event,caused epoll event deadloop (multi interface + epoll) #1545

@jlspyaozhongkai

Description

@jlspyaozhongkai

I did this

if (events & EPOLLIN) {
            //noblock peek read the socket m_handle_fd, "HTTP/1.1 200 OK ....." in it
	m_master->multi_socket_action(CURL_CSELECT_IN, m_handle_fd);
            //"HTTP/1.1 200 OK ....." still in it ,libcurl not read not read the message
} else if (events & EPOLLOUT) {
	m_master->multi_socket_action(CURL_CSELECT_OUT, m_handle_fd);
}
    ............................
   void Master::multi_socket_action(curl_socket_t socket, int ev_bitmask)
    {
int running_handles = 0;
curl_multi_socket_action(m_curl_multi, socket, ev_bitmask, &running_handles);
    .............................

1,EPOLL event alive
2,libcurl CURL_CSELECT_IN with socket handl,but not read the socketbuffer
3,EPOLL again,and event deadloop
4,a 15000 ms timer timeout,libcurl turn to ok,socketbuffer be received
5,bug in centos 7.2 libcurl.x86_64 7.29.0-35.el7.centos
build curl-7.54.0 and static link is ok

I expected the following

libcurl read the socket,no event deadloop。

curl/libcurl version

curl -V output
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.21 Basic ECC zlib/1.2.7 libidn/1.28 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets

operating system

more /proc/version
CentOS 7.2
Linux version 3.10.0-514.16.1.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Wed Apr 12 15:04:24 UTC 2017

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions