On Thu, Jan 29, 2015 at 12:56 AM, Guido van Rossum <[email protected]> wrote:
> What would Twisted do? (WWTD)

A meme is born.

Reminds me of how I learned that Python existed:

I was a Perl programmer when that language grew support for classes.
At that time, the Perl community was constantly considering best
practices for OO in a dynamic scripting language, and the question
"How is it done in Python?" frequently came up.

That's why I decided to study Python and fell in love with it before I
finished the tutorial in 1998.

Cheers,

Luciano





>
> On Wed, Jan 28, 2015 at 6:20 PM, Victor Stinner <[email protected]>
> wrote:
>>
>> 2015-01-29 2:47 GMT+01:00 Guido van Rossum <[email protected]>:
>> > Doesn't the exception bubble up to the caller of create_connection()?
>>
>> Yes, it does.
>>
>> >  So what's the problem?
>>
>> The problem is in server which accepts incoming connections:
>> BaseSelectorEventLoop._accept_conncetion(). Extract of the code:
>> ---
>>     conn, addr = sock.accept()
>>     (...)
>>     protocol = protocol_factory()
>>     if sslcontext:
>>         self._make_ssl_transport(
>>             conn, protocol, sslcontext,
>>             server_side=True, extra={'peername': addr}, server=server)
>>     else:
>>         self._make_socket_transport(
>>             conn, protocol , extra={'peername': addr},
>>             server=server)
>>     # It's now up to the protocol to handle the connection.
>> ---
>>
>> If the transport fails before calling connection_made() (ex: SSL
>> handshake failure): the transport and the protocol are destroyed, no
>> message is logged, the server is not aware of the connection failure.
>>
>> I would like to notify the server through the protocol (call
>> connection_failed) that an incoming connection failed. Random use
>> case: blacklist temporary the client IP.
>>
>> Victor
>
>
>
>
> --
> --Guido van Rossum (python.org/~guido)



-- 
Luciano Ramalho
Twitter: @ramalhoorg

Professor em: http://python.pro.br
Twitter: @pythonprobr

Reply via email to