- May 28, 2019
-
-
Damien George authored
-
- May 17, 2019
-
-
Damien George authored
-
Paul Sokolovsky authored
For modules I initially created or made substantial contributions to.
-
- May 08, 2019
-
-
Elad Namdar authored
The original code called setsockopt(SO_RCVTIMEO/SO_SNDTIMEO) with NULL timeout structure argument, which is an illegal usage of that function. The old code also didn't validate the return value of setsockopt, missing the bug completely.
-
- Feb 12, 2019
-
-
Damien George authored
-
- Oct 17, 2018
-
-
Paul Sokolovsky authored
1. Return correct error code for non-blocking vs timed out socket (POSIX returns EAGAIN for both, we want ETIMEDOUT in case of timed out socket). To achieve this, blocking/non-blocking flag is added to the mp_obj_socket_t, to avoid issuing fcntl() syscall each time EAGAIN occurs. (mp_obj_socket_t used to be 8 bytes, having some room in a standard 16-byte alloc block.) 2. Handle socket.settimeout(0) properly - in Python, that means non-blocking mode, but SO_RCVTIMEO/SO_SNDTIMEO of 0 is infinite timeout. 3. Overall, make sure that socket.settimeout() call switches blocking state as expected.
-
Danielle Madeley authored
-
- Jul 20, 2018
-
-
Damien George authored
This mechanism will scale to to an arbitrary number of pollable objects, so long as they implement the MP_STREAM_GET_FILENO ioctl. Since ussl objects pass through ioctl requests transparently to the underlying socket object, it will allow ussl sockets to be polled. And a user object with uio.IOBase as a base could support polling.
-
- Apr 10, 2018
-
-
Damien George authored
This patch moves the implementation of stream closure from a dedicated method to the ioctl of the stream protocol, for each type that implements closing. The benefits of this are: 1. Rounds out the stream ioctl function, which already includes flush, seek and poll (among other things). 2. Makes calling mp_stream_close() on an object slightly more efficient because it now no longer needs to lookup the close method and call it, rather it just delegates straight to the ioctl function (if it exists). 3. Reduces code size and allows future types that implement the stream protocol to be smaller because they don't need a dedicated close method. Code size reduction is around 200 bytes smaller for x86 archs and around 30 bytes smaller for the bare-metal archs.
-
- Oct 24, 2017
-
-
Paul Sokolovsky authored
These defined couple of functions added during initial experimentation, which aren't part of MicroPython API and no longer used or needed.
-
- Oct 23, 2017
-
-
Paul Sokolovsky authored
Unix naming is historical, before current conventions were established. All other ports however have it as "modusocket.c", so rename for consistency and to avoid confusion.
-
- Oct 04, 2017
-
-
Damien George authored
Header files that are considered internal to the py core and should not normally be included directly are: py/nlr.h - internal nlr configuration and declarations py/bc0.h - contains bytecode macro definitions py/runtime0.h - contains basic runtime enums Instead, the top-level header files to include are one of: py/obj.h - includes runtime0.h and defines everything to use the mp_obj_t type py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h, and defines everything to use the general runtime support functions Additional, specific headers (eg py/objlist.h) can be included if needed.
-
- Sep 06, 2017
-
-
Damien George authored
This is to keep the top-level directory clean, to make it clear what is core and what is a port, and to allow the repository to grow with new ports in a sustainable way.
-
- Jul 31, 2017
-
-
Alexander Steffen authored
There were several different spellings of MicroPython present in comments, when there should be only one.
-
- Jul 12, 2017
-
-
Damien George authored
These checks are already made, and errors reported, by the uPy runtime.
-
- May 29, 2017
-
-
Ville Skyttä authored
-
- Nov 13, 2016
-
-
Paul Sokolovsky authored
Its addition was due to an early exploration on how to add CPython-like stream interface. It's clear that it's not needed and just takes up bytes in all ports.
-
- Oct 07, 2016
-
-
Damien George authored
-
Damien George authored
-
- Sep 21, 2016
-
-
Damien George authored
One can instead lookup __name__ in the modules dict to get the value.
-
- Aug 06, 2016
-
-
Paul Sokolovsky authored
This includes file and socket objects, backed by Unix file descriptor. This improves compatibility with stmhal's uselect (and convenience of use), though not completely: return value from poll.poll() is still raw file descriptor.
-
- Jun 18, 2016
-
-
Paul Sokolovsky authored
It's now used for more than just stream protocol (e.g. pin protocol), so don't use false names.
-
- Apr 04, 2016
-
-
Paul Sokolovsky authored
-
- Mar 01, 2016
-
-
Paul Sokolovsky authored
-
- Jan 27, 2016
-
-
Paul Sokolovsky authored
-
- Jan 21, 2016
-
-
Paul Sokolovsky authored
By reserving enough space for peer address.
-
- Jan 11, 2016
-
-
Dave Hylands authored
-
Damien George authored
The first argument to the type.make_new method is naturally a uPy type, and all uses of this argument cast it directly to a pointer to a type structure. So it makes sense to just have it a pointer to a type from the very beginning (and a const pointer at that). This patch makes such a change, and removes all unnecessary casting to/from mp_obj_t.
-
Damien George authored
With this patch the n_args parameter is changed type from mp_uint_t to size_t.
-
Damien George authored
This patch changes the type signature of .make_new and .call object method slots to use size_t for n_args and n_kw (was mp_uint_t. Makes code more efficient when mp_uint_t is larger than a machine word. Doesn't affect ports when size_t and mp_uint_t have the same size.
-
- Nov 29, 2015
-
-
Damien George authored
This allows the mp_obj_t type to be configured to something other than a pointer-sized primitive type. This patch also includes additional changes to allow the code to compile when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of mp_uint_t, and various casts.
-
Damien George authored
-
- Nov 21, 2015
-
-
Paul Sokolovsky authored
-
- Nov 20, 2015
-
-
Paul Sokolovsky authored
Return tuple of (address_family, net_addr, [port, [extra_data]]). net_addr is still raw network address as bytes object, but suitable for passing to inet_ntop() function. At the very least, sockaddr() will separate address family value from binary socket address (and currently, only AF_INET family is decoded).
-
Paul Sokolovsky authored
-
- Oct 10, 2015
-
-
Anmol Sarma authored
-
- Jul 14, 2015
-
-
Paul Sokolovsky authored
inet_pton supports both ipv4 and ipv6 addresses. Interface is also extensible for other address families, but underlying libc inet_pton() function isn't really extensible (e.g., it doesn't return length of binary address, i.e. it's really hardcoded to AF_INET and AF_INET6). But anyway, on Python side, we could extend it to support other addresses.
-
- Jul 13, 2015
-
-
Paul Sokolovsky authored
Required to implement UDP servers.
-
- Jul 12, 2015
-
-
Paul Sokolovsky authored
sendto() turns out to be mandatory function to work with UDP. It may seem that connect(addr) + send() would achieve the same effect, but what connect() appears to do is to set source address filter on a socket to its argument. Then everything falls apart: socket sends to a broad-/multi-cast address, but reply is sent from real peer address, which doesn't match filter set by connect(), so local socket never sees a reply.
-
- Jul 10, 2015
-
-
Paul Sokolovsky authored
Treating it as signed lead to buffer overflow for ports >= 32768.
-