url: add support for server:port syntax in the url

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
master
Ronnie Sahlberg 2021-07-18 07:46:09 +10:00
parent cdb377532a
commit 752cb4134d
2 changed files with 7 additions and 1 deletions

2
README
View File

@ -40,7 +40,7 @@ URL-FORMAT:
Libnfs uses RFC2224 style URLs extended with some minor libnfs extensions.
The basic syntax of these URLs is :
nfs://<server|ipv4|ipv6>/path[?arg=val[&arg=val]*]
nfs://<server|ipv4|ipv6>[:<port>]/path[?arg=val[&arg=val]*]
Arguments supported by libnfs are :
tcp-syncnt=<int> : Number of SYNs to send during the session establish

View File

@ -358,6 +358,12 @@ nfs_parse_url(struct nfs_context *nfs, const char *url, int dir, int incomplete)
}
*strp = 0;
strp = strchr(urls->server, ':');
if (strp) {
*strp++ = 0;
nfs->nfsport = atoi(strp);
}
if (dir) {
flagsp = strchr(urls->path, '?');
goto flags;