Skip to content

Commit 2dd21d9

Browse files
committed
extmod/modwebrepl: Use mp_stream_close() method.
1 parent 614deb8 commit 2dd21d9

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

extmod/modwebrepl.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ STATIC char denied_prompt[] = "\r\nAccess denied\r\n";
7777

7878
STATIC char webrepl_passwd[10];
7979

80-
static inline void close_meth(mp_obj_t stream) {
81-
mp_obj_t dest[2];
82-
mp_load_method(stream, MP_QSTR_close, dest);
83-
mp_call_method_n_kw(0, 0, dest);
84-
}
85-
8680
STATIC void write_webrepl(mp_obj_t websock, const void *buf, size_t len) {
8781
const mp_stream_p_t *sock_stream = mp_get_stream_raise(websock, MP_STREAM_OP_WRITE | MP_STREAM_OP_IOCTL);
8882
int err;
@@ -256,7 +250,7 @@ STATIC mp_uint_t _webrepl_read(mp_obj_t self_in, void *buf, mp_uint_t size, int
256250
}
257251

258252
if (self->data_to_recv == 0) {
259-
close_meth(self->cur_file);
253+
mp_stream_close(self->cur_file);
260254
self->hdr_to_recv = sizeof(struct webrepl_file);
261255
DEBUG_printf("webrepl: Finished writing file\n");
262256
write_webrepl_resp(self->sock, 0);

0 commit comments

Comments
 (0)