YAMAMOTO Takashi
44e80ac972
webclient: Implement chunked transfer (receiving side)
...
This is a requirement for HTTP 1.1.
Tested against:
* http://httpbin.org/stream/10
* Docker API
2022-03-08 09:39:55 +08:00
YAMAMOTO Takashi
092ce81444
webclient: Always use "connection: close" for HTTP 1.1 for now
...
* This matches the HTTP 1.0 behavior.
* Persistent connection doesn't make much sense with the current API.
2022-03-08 09:39:55 +08:00
YAMAMOTO Takashi
7949059ec2
webclient: Send HTTP 1.1 request if enabled
2022-03-08 09:39:55 +08:00
YAMAMOTO Takashi
3759da3d00
webclient: Add a parameter to specifiy protocol version
2022-03-08 09:39:55 +08:00
Alin Jerpelea
cd79a79d00
Makefile: update licenses to Apache
...
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-03-08 01:44:49 +08:00
Xiang Xiao
18bb3331f3
netutils/webserver: Fix the compiler warning
...
httpd_dirlist.c: In function 'httpd_dirlist':
Error: httpd_dirlist.c:199:40: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 128 [-Werror=format-truncation=]
199 | snprintf(path, CONFIG_NAME_MAX, "%s/%s",
| ^~
httpd_dirlist.c:199:7: note: 'snprintf' output between 2 and 385 bytes into a destination of size 128
199 | snprintf(path, CONFIG_NAME_MAX, "%s/%s",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
200 | file->path, dent->d_name);
| ~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-07 00:58:19 +08:00
Xiang Xiao
3afd1234e0
netutils/netlib: Fix error: 'strncpy' specified bound 16 equals destination size
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-04 22:05:14 +02:00
Xiang Xiao
f31cc67da8
netutils/usrsock_rpmsg: Switch the nonblocking mode by psock_ioctl instead
...
since it's more simpler than psock_ioctl
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-04 14:00:29 +02:00
Xiang Xiao
997379d14e
netutils/webserver: Fix the compiler error when -no-builtin is removed
...
Error: httpd.c:671:7: error: 'strncpy' output truncated before terminating nul copying 12 bytes from a string of the same length [-Werror=stringop-truncation]
671 | strncpy(pstate->ht_filename, "/" CONFIG_NETUTILS_HTTPD_INDEX,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
672 | strlen("/" CONFIG_NETUTILS_HTTPD_INDEX));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-03 12:49:35 +02:00
Xiang Xiao
4cc0c755bf
Remove CONFIG_CLOCK_MONOTONIC special code
...
since this opion doesn't exist anymore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-23 01:21:44 +08:00
Xiang Xiao
0426c8c09f
Fix error: 'strncpy' specified bound 16 equals destination size
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-15 12:38:03 +01:00
Huang Qi
5451214d0b
ftpd: Remove usage of deprecated macro __NUTTX__
...
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-02-14 13:57:10 +08:00
Alexander Lunev
e317d32fe1
netutils/netcat: fixed crash on accept() invocation.
...
Sometimes netcat in server mode crashed with "psock_accept: ERROR: si_accept failed: -9".
And sometimes it crashed with "up_assert: Assertion failed at file:inet/inet_sockif.c line: 841 task: netcat".
2022-02-10 12:20:27 +08:00
Xiang Xiao
8361990261
netutils: Check lo by CONFIG_NET_LOOPBACK not CONFIG_NET_LOCAL
...
CONFIG_NET_LOCAL is used to enable Unix Domain Socket
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-09 12:13:31 +08:00
Xiang Xiao
60989b196c
neutils/thttpd: Remove CONFIG_SDCLONE_DISABLE
...
since this option doesn't exist anymore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-31 19:03:55 +01:00
Alexander Lunev
d595ba2b25
netutils/netcat: implemented NETUTILS_NETCAT_BUFSIZE option.
...
This option can be used for the performance optimization if sendfile() is not applicable.
2022-01-25 00:47:34 +08:00
Alexander Lunev
5a697c18ba
netutils/netcat: fixed ISO C89/C90 related warnings:
...
warning: ISO C90 forbids variable length array ‘buf’ [-Wvla]
warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
2022-01-21 12:30:40 +08:00
Alexander Lunev
b8c060260c
netutils/ftpc: implemented FTPC_OVER_SENDFILE option.
...
This option enables using sendfile() in ftpc binary transfer mode of PUT operation.
If the option is enabled but ASCII transfer mode is activated,
ftpc falls back to the combination of read() and write().
Using sendfile() provides a higher performance compared to
the combination of read() and write().
Also this option is useful for testing / debugging tcp_sendfile()
functionality of NuttX TCP/IP stack.
2022-01-20 14:16:01 +08:00
Alexander Lunev
371beb2a0f
netutils/netcat: sendfile related code refactoring + small fixes
2022-01-18 10:38:55 +08:00
Xiang Xiao
c7e96dbe32
Fix the nxstyle warning
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-17 07:57:22 +01:00
Petro Karashchenko
9480c0ec12
include: fix double include pre-processor guards
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-16 17:36:21 +08:00
Fotis Panagiotopoulos
bc5d8034f1
Typo fixes.
2022-01-06 10:30:41 +08:00
songlinzhang
04dd2d70fd
netutils/dhcpc: Fix dhcpc lease bug
...
Signed-off-by: songlinzhang <songlinzhang@xiaomi.com>
2022-01-05 18:27:59 +08:00
Jiuzhu Dong
64ffdb46bb
ntpc: optimize stack used
...
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-01-05 18:36:12 +09:00
Alexander Lunev
b9a6dc2a85
netutils/netcat: implemented NETUTILS_NETCAT_SENDFILE option.
...
This option enables using sendfile() in netcat client mode
if a normal file (not stdin) is sent. If the option is enabled
but stdin is sent rather than a normal file, netcat falls back
to the combination of read() and write().
Using sendfile() provides a higher performance compared to
the combination of read() and write().
Also this option is useful for testing / debugging tcp_sendfile()
functionality of NuttX TCP/IP stack.
2022-01-05 13:29:04 +08:00
chao.an
df53de1d68
net/usrsock: replace usrsock xid type to uint64_t
...
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-05 13:25:21 +08:00
Petro Karashchenko
5ac15130db
apps: remove space befone newline in logs
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-27 20:52:08 -06:00
Xiang Xiao
66dbaa4539
Replace self defined macros with NET_SOCK_[FAMILY|TYPE|PROTOCOL]
...
NET_SOCK_* is defined by nuttx/net/netconfig.h and then can be shared
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-20 16:04:29 -03:00
songlinzhang
e0fc53b23c
netutils/dhcpc: add non-blocking interface
...
Signed-off-by: songlinzhang <songlinzhang@xiaomi.com>
2021-11-29 02:04:49 -06:00
Jiuzhu Dong
b480d00323
rexec: support send command with arguments
...
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-10-23 03:58:49 -05:00
songlinzhang
98dfaa3eff
dhcpc abnormal block
...
The logic changes are as follows:
1、Loop sending the DISCOVER up to CONFIG_NETUTILS_DHCPC_RETRIES times
and exit if failure
2、Loop sending the REQUEST up to CONFIG_NETUTILS_DHCPC_RETRIES times
and exit if failure
Signed-off-by: songlinzhang <songlinzhang@xiaomi.com>
2021-10-22 09:20:25 -03:00
Alan C. Assis
cb1b8e10db
chat: Replace _info with ninfo to avoid polluting the nsh
2021-09-27 10:31:43 +02:00
YAMAMOTO Takashi
78fb3bc240
webclient: handle EINTR in a few places
2021-09-14 14:39:29 +08:00
Jiuzhu Dong
2add33e6a3
rexecd/rexec: support AF_RPMSG to communicate
...
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-13 09:00:20 +08:00
Jiuzhu Dong
00e7be92dc
netutils: support rexec and rexecd
...
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-13 09:00:20 +08:00
Juha Niskanen
b283289986
apps: fix miscellaneous typos
...
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2021-08-26 11:39:28 -07:00
YAMAMOTO Takashi
23e0325698
webclient: check content-length
...
While it's better to use a reliable transport like
TLS with working close notify, it isn't always possible.
2021-08-16 09:47:44 -07:00
YAMAMOTO Takashi
bdae564c22
webclient: Add _s suffix to internal structures
...
To follow our coding standard.
I left the structures which is a part of the API for now.
(E.g. struct webclient_context)
2021-08-11 03:11:14 -07:00
YAMAMOTO Takashi
b8fd862965
webclient: Add some assertions on webclient_context state
2021-08-08 22:34:26 -07:00
YAMAMOTO Takashi
0bae950b63
webclient: Implement non-blocking I/O
...
* webclient_perform
* Add a new flag to use non-blocking mode (WEBCLIENT_FLAG_NON_BLOCKING)
* Implement restarting
* Add a few associated API functions
* webclient_get_poll_info: get the descriptor info for poll/select
* webclient_abort: abort the operation (instead of restarting)
2021-08-08 22:34:26 -07:00
Xiang Xiao
ad3f44bc77
Change match to fnmatch
...
follow the kernel side change
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-02 16:15:57 -03:00
Gustavo Henrique Nihei
a1026c9f23
netutils/webclient: Notify HTTP header data via dedicated callback
...
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-07-23 11:28:26 -07:00
chao.an
496aa3ef4f
netutils/dhcpd: bind socket to the interface
...
Change-Id: Icf7cf8147ceca5e27b7b923d520e2189741d9882
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-07-23 08:25:36 -03:00
Atsunori Saito
7b074bcf66
netutils/ftpc: ftpc_connect: Fixed invalid socket close.
2021-07-03 03:07:45 -05:00
YAMAMOTO Takashi
55f921841d
netutils/telnetd: use a larger buffer for a 64-bit pointer
2021-07-02 04:18:23 -05:00
Atsunori Saito
5b1a4a3832
netutils/ftpc: ftpc_getfile: Fixed permission check and resume offset.
2021-07-01 09:22:37 -05:00
Beat Küng
7fdd751b7a
dhcpc: fix potential invalid memory reads
...
- check for minimum packet length (44 bytes, which includes the fields we
read next)
- pass the correct remaining buffer length to dhcpc_parseoptions()
- dhcpc_parseoptions(): ensure we never read past the end of the buffer
2021-06-30 03:00:42 -05:00
chao.an
c7f28f5f9e
usrsock/rpmsg/server: select eventfd by default
...
Change-Id: I8e3bb4f035781e045ccf85c515b6480c7f9317bc
Signed-off-by: chao.an <anchao@xiaomi.com>
(cherry picked from commit abbad446b77b5703e582f529271918fcee0e920e)
2021-06-22 10:31:35 -03:00
YAMAMOTO Takashi
920d925806
iperf: Fix an unused function warning seen with clang
2021-06-17 07:30:41 +02:00
Alin Jerpelea
e78ef68927
netutils: fix relative path CI error
...
error: Path relative to repository other than nuttx must begin with the root directory
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-16 09:03:06 -05:00