• Show log

    Commit

  • Hash : 0c7f0405
    Author : Azat Khuzhin
    Date : 2013-10-01T19:12:13

    http: implement new evhttp_connection_get_addr() api.
    
    Basically tcp final handshake looks like this:
        (C - client, S - server)
        ACK[C] - FIN/ACK[S] - FIN/ACK[S] - ACK [C]
    
    However there are servers, that didn't close connection like this,
    while it is still _considered_ as valid, and using libevent http layer
    we can do requests to such servers.
    
    Modified handshake:
        (C - client, S - server)
        ACK[C] - RST/ACK[S] - RST/ACK[S]
    
    And in this case we can't extract IP address from socket, because it is
    already closed, and getpeername() will return: "transport endpoint is not connected".
    So we need to store address that we are connecting to, after we know it,
    and that is what this patch do.
    
    I have reproduced it, however it have some extra packages.
    (I will try to fix it)
    https://github.com/azat/nfq-examples/blob/master/nfqnl_rst_fin.c