Searched hist:765 (Results 1 – 4 of 4) sorted by path
/unit/auto/ |
H A D | threads | diff 765:7b63756a81a4 Mon Sep 17 13:37:00 UTC 2018 Igor Sysoev <igor@sysoev.ru> Removed deprecated MacOSX OSSpinLockLock().
|
/unit/src/ |
H A D | nxt_spinlock.c | diff 765:7b63756a81a4 Mon Sep 17 13:37:00 UTC 2018 Igor Sysoev <igor@sysoev.ru> Removed deprecated MacOSX OSSpinLockLock().
|
H A D | nxt_spinlock.h | diff 765:7b63756a81a4 Mon Sep 17 13:37:00 UTC 2018 Igor Sysoev <igor@sysoev.ru> Removed deprecated MacOSX OSSpinLockLock().
|
/unit/src/python/ |
H A D | nxt_python_asgi.c | diff 2468:e3ee46ddb766 Mon May 15 21:48:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Python: Fix ASGI applications accessed over IPv6.
There are a couple of reports on GitHub about issues accessing Python ASGI based applications over IPv6.
A request over IPv6 would result in an error like
2023/05/13 17:49:12 [alert] 47202#47202 [unit] #10: Python failed to create 'client' pair 2023/05/13 17:49:12 [alert] 47202#47202 [unit] Python failed to call 'loop.call_soon' ValueError: invalid literal for int() with base 10: 'db8:1:1:1ee7:dead:beef:cafe'
The above error was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/lib64/python3.11/asyncio/base_events.py", line 765, in call_soon handle = self._call_soon(callback, args, context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/asyncio/base_events.py", line 781, in _call_soon handle = events.Handle(callback, args, self, context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SystemError: <class 'asyncio.events.Handle'> returned a result with an exception set
This issue occurred in the nxt_py_asgi_create_ip_address() function where it tries to create an IP address / port number pair.
It does this by looking for the first ':' in the address and taking everything after it as the port number. Like in the above error message, if we tried to access the server @ 2001:db8:1:1:1ee7:dead:beef:cafe, then we'd end up with the port number as 'db8:1:1:1ee7:dead:beef:cafe'.
There are two issues with this
1) The IP address and port number are already flowed through separately. 2) Even if (1) wasn't true, it would still be broken for IPv6 as we'd expect to a get an address literal like [2001:db8:1:1:1ee7:dead:beef:cafe]:8080, however there was no code to handle the []'s.
The fix is to simply not try looking for a port number. We pass a port number into this function to use in the case where we don't find a port number, we never will...
A further cleanup would be to flow through the server port number when creating the 'server pair' PyTuple, rather than just using the hard coded 80.
Closes: <https://github.com/nginx/unit/issues/793> Closes: <https://github.com/nginx/unit/issues/874> Reviewed-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|