Search squid archive

Re: TCP_RESET non http requests on port 80

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/07/2016 01:56 AM, Matus UHLAR - fantomas wrote:

> and how is this done? Which system or library call does drop connection to
> send a RST immediately?

This is not a squid-users question, but Squid calls comm_reset_close()
(quoted below) to reset the connection. That function uses zero
SO_LINGER option value to trigger a TCP reset when the connection is
closed. AFAICT, this is a "standard" approach.

I do not know whether that approach results in an actual TCP reset
packet immediately sent (as opposed to responding to any incoming
packets on the same connection with TCP reset packets).


HTH,

Alex.

> /**
>  * enable linger with time of 0 so that when the socket is
>  * closed, TCP generates a RESET
>  */
> void
> comm_reset_close(const Comm::ConnectionPointer &conn)
> {
>     struct linger L;
>     L.l_onoff = 1;
>     L.l_linger = 0;
> 
>     if (setsockopt(conn->fd, SOL_SOCKET, SO_LINGER, (char *) &L, sizeof(L)) < 0) {
>         int xerrno = errno;
>         debugs(50, DBG_CRITICAL, "ERROR: Closing " << conn << " with TCP RST: " << xstrerr(xerrno));
>     }
>     conn->close();
> }

_______________________________________________
squid-users mailing list
squid-users@xxxxxxxxxxxxxxxxxxxxx
http://lists.squid-cache.org/listinfo/squid-users




[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux