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

Skip to content

Commit f08a6b9

Browse files
committed
extmod/modussl: address comments
1 parent a370f53 commit f08a6b9

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
@@ -178,7 +178,7 @@ STATIC mp_uint_t ussl_socket_read(mp_obj_t o_in, void *buf, mp_uint_t size, int
178178
}
179179

180180
STATIC mp_obj_t ussl_socket_recv(mp_obj_t self_in, mp_obj_t len_in) {
181-
size_t len = mp_obj_get_int(len_in);
181+
size_t len = mp_obj_int_get_uint_checked(len_in);
182182
vstr_t vstr;
183183
vstr_init_len(&vstr, len);
184184

@@ -204,8 +204,8 @@ STATIC mp_uint_t ussl_socket_write(mp_obj_t o_in, const void *buf, mp_uint_t siz
204204
mp_int_t r;
205205
eagain:
206206
r = ssl_write(o->ssl_sock, buf, size);
207-
if (r == SSL_OK) {
208-
// see comment in read method
207+
if (r == 0) {
208+
// see comment in ussl_socket_read above
209209
if (o->blocking) {
210210
goto eagain;
211211
} else {

ports/esp32/modsocket.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,12 +662,10 @@ STATIC mp_uint_t socket_stream_write(mp_obj_t self_in, const void *buf, mp_uint_
662662
int r = lwip_write(sock->fd, buf, size);
663663
MP_THREAD_GIL_ENTER();
664664
if (r > 0) {
665-
printf("socket_stream_write wrote %d\n", r);
666665
return r;
667666
}
668667
// lwip returns MP_EINPROGRESS when trying to write right after a non-blocking connect
669668
if (r < 0 && errno != MP_EWOULDBLOCK && errno != MP_EINPROGRESS) {
670-
printf("socket_stream_write error %d\n", errno);
671669
*errcode = errno;
672670
return MP_STREAM_ERROR;
673671
}

0 commit comments

Comments
 (0)
0