8000 extmod/modussl: address comments · micropython/micropython@40a4b51 · GitHub
[go: up one dir, main page]

Skip to content

Commit 40a4b51

Browse files
committed
extmod/modussl: address comments
1 parent ac29fd6 commit 40a4b51

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

extmod/modussl_axtls.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ STATIC mp_uint_t ussl_socket_read(mp_obj_t o_in, void *buf, mp_uint_t size, int
241241
}
242242

243243
STATIC mp_obj_t ussl_socket_recv(mp_obj_t self_in, mp_obj_t len_in) {
244-
size_t len = mp_obj_get_int(len_in);
244+
size_t len = mp_obj_int_get_uint_checked(len_in);
245245
vstr_t vstr;
246246
vstr_init_len(&vstr, len);
247247

@@ -267,8 +267,8 @@ STATIC mp_uint_t ussl_socket_write(mp_obj_t o_in, const void *buf, mp_uint_t siz
267267
mp_int_t r;
268268
eagain:
269269
r = ssl_write(o->ssl_sock, buf, size);
270-
if (r == SSL_OK) {
271-
// see comment in read method
270+
if (r == 0) {
271+
// see comment in ussl_socket_read above
272272
if (o->blocking) {
273273
goto eagain;
274274
} else {

ports/esp32/modsocket.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,12 +667,10 @@ STATIC mp_uint_t socket_stream_write(mp_obj_t self_in, const void *buf, mp_uint_
667667
int r = lwip_write(sock->fd, buf, size);
668668
MP_THREAD_GIL_ENTER();
669669
if (r > 0) {
670-
printf("socket_stream_write wrote %d\n", r);
671670
return r;
672671
}
673672
// lwip returns MP_EINPROGRESS when trying to write right after a non-blocking connect
674673
if (r < 0 && errno != MP_EWOULDBLOCK && errno != MP_EINPROGRESS) {
675-
printf("socket_stream_write error %d\n", errno);
676674
*errcode = errno;
677675
return MP_STREAM_ERROR;
678676
}

0 commit comments

Comments
 (0)
0