summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Henry <[email protected]>2023-05-26 10:12:24 -0700
committerGitHub <[email protected]>2023-05-26 10:12:24 -0700
commit7d82d0ed7798026ac5fdbb535c61c9bf5b7e6d21 (patch)
tree3cb5235d90c1507cd2dbb4d9aa21fe9ff164c6f5
parentbb578e98793fd826b38c764201ffb7442c2297e6 (diff)
parent8bd9a18a386141bbaa69249a2c28b2bb50705cf9 (diff)
Merge pull request #218 from zerotier/brenton/fix-typos
Brenton/fix typos
-rw-r--r--include/ZeroTierSockets.h2
-rw-r--r--src/Central.cpp20
-rw-r--r--src/bindings/java/com/zerotier/sockets/ZeroTierDatagramSocket.java10
-rw-r--r--src/bindings/java/com/zerotier/sockets/ZeroTierInputStream.java26
-rw-r--r--src/bindings/java/com/zerotier/sockets/ZeroTierSocket.java18
-rw-r--r--src/lwipopts.h2
6 files changed, 39 insertions, 39 deletions
diff --git a/include/ZeroTierSockets.h b/include/ZeroTierSockets.h
index f57cd24..0374bac 100644
--- a/include/ZeroTierSockets.h
+++ b/include/ZeroTierSockets.h
@@ -1023,7 +1023,7 @@ typedef struct {
#ifndef ZTS_DISABLE_CENTRAL_API
#define ZTS_CENTRAL_DEFAULT_URL "https://my.zerotier.com"
-#define ZTS_CENRTAL_MAX_URL_LEN 128
+#define ZTS_CENTRAL_MAX_URL_LEN 128
#define ZTS_CENTRAL_TOKEN_LEN 32
#define ZTS_CENTRAL_RESP_BUF_DEFAULT_SZ (128 * 1024)
diff --git a/src/Central.cpp b/src/Central.cpp
index 247d0b2..e6ea8b0 100644
--- a/src/Central.cpp
+++ b/src/Central.cpp
@@ -25,7 +25,7 @@
#define REQ_LEN 64
-char api_url[ZTS_CENRTAL_MAX_URL_LEN];
+char api_url[ZTS_CENTRAL_MAX_URL_LEN];
char api_token[ZTS_CENTRAL_TOKEN_LEN + 1];
char* _resp_buf;
@@ -97,12 +97,12 @@ int zts_central_init(const char* url_str, const char* token_str, char* resp_buf,
// Initialize all curl internal submodules
curl_global_init(CURL_GLOBAL_ALL);
- int url_len = strnlen(url_str, ZTS_CENRTAL_MAX_URL_LEN);
- if (url_len < 3 || url_len > ZTS_CENRTAL_MAX_URL_LEN) {
+ int url_len = strnlen(url_str, ZTS_CENTRAL_MAX_URL_LEN);
+ if (url_len < 3 || url_len > ZTS_CENTRAL_MAX_URL_LEN) {
return ZTS_ERR_ARG;
}
else {
- memset(api_url, 0, ZTS_CENRTAL_MAX_URL_LEN);
+ memset(api_url, 0, ZTS_CENTRAL_MAX_URL_LEN);
strncpy(api_url, url_str, url_len);
}
int token_len = strnlen(token_str, ZTS_CENTRAL_TOKEN_LEN);
@@ -146,19 +146,19 @@ int central_req(
return ZTS_ERR_SERVICE;
}
zts_central_clear_resp_buf();
- int central_strlen = strnlen(central_str, ZTS_CENRTAL_MAX_URL_LEN);
- int api_route_strlen = strnlen(api_route_str, ZTS_CENRTAL_MAX_URL_LEN);
+ int central_strlen = strnlen(central_str, ZTS_CENTRAL_MAX_URL_LEN);
+ int api_route_strlen = strnlen(api_route_str, ZTS_CENTRAL_MAX_URL_LEN);
int token_strlen = strnlen(token_str, ZTS_CENTRAL_TOKEN_LEN);
int url_len = central_strlen + api_route_strlen;
if (token_strlen > ZTS_CENTRAL_TOKEN_LEN) {
return ZTS_ERR_ARG;
}
- if (url_len > ZTS_CENRTAL_MAX_URL_LEN) {
+ if (url_len > ZTS_CENTRAL_MAX_URL_LEN) {
return ZTS_ERR_ARG;
}
- char req_url[ZTS_CENRTAL_MAX_URL_LEN] = { 0 };
- strncpy(req_url, central_str, ZTS_CENRTAL_MAX_URL_LEN);
- strncat(req_url, api_route_str, ZTS_CENRTAL_MAX_URL_LEN);
+ char req_url[ZTS_CENTRAL_MAX_URL_LEN] = { 0 };
+ strncpy(req_url, central_str, ZTS_CENTRAL_MAX_URL_LEN);
+ strncat(req_url, api_route_str, ZTS_CENTRAL_MAX_URL_LEN);
CURL* curl;
CURLcode res;
diff --git a/src/bindings/java/com/zerotier/sockets/ZeroTierDatagramSocket.java b/src/bindings/java/com/zerotier/sockets/ZeroTierDatagramSocket.java
index a37608d..34d4470 100644
--- a/src/bindings/java/com/zerotier/sockets/ZeroTierDatagramSocket.java
+++ b/src/bindings/java/com/zerotier/sockets/ZeroTierDatagramSocket.java
@@ -165,7 +165,7 @@ public class ZeroTierDatagramSocket {
0,
packet.getLength());
if ((bytesRead <= 0) | (bytesRead == -104) /* EINTR, from SO_RCVTIMEO */) {
- throw new IOException("read​(DatagramPacket), errno=" + bytesRead);
+ throw new IOException("read(DatagramPacket), errno=" + bytesRead);
}
}
@@ -277,16 +277,16 @@ public class ZeroTierDatagramSocket {
* Return whether this ZeroTierSocket is bound to a local address
* @return true or false
*/
- public boolean isBound​()
+ public boolean isBound()
{
- return _socket.isBound​();
+ return _socket.isBound();
}
/**
* Return whether this ZeroTierSocket has been closed
* @return true or false
*/
- public boolean isClosed​()
+ public boolean isClosed()
{
return _socket.isClosed();
}
@@ -295,7 +295,7 @@ public class ZeroTierDatagramSocket {
* Return whether this ZeroTierSocket is connected to a remote address
* @return true or false
*/
- public boolean isConnected​()
+ public boolean isConnected()
{
return _socket.isConnected();
}
diff --git a/src/bindings/java/com/zerotier/sockets/ZeroTierInputStream.java b/src/bindings/java/com/zerotier/sockets/ZeroTierInputStream.java
index 8d23d88..e5d2d4f 100644
--- a/src/bindings/java/com/zerotier/sockets/ZeroTierInputStream.java
+++ b/src/bindings/java/com/zerotier/sockets/ZeroTierInputStream.java
@@ -30,7 +30,7 @@ public class ZeroTierInputStream extends InputStream {
* Close the ZeroTierInputStream
* @exception IOException when an I/O error occurs
*/
- public void close​() throws IOException
+ public void close() throws IOException
{
/* Note: this operation currently only stops RX on a socket that is shared
between both I/OStreams. This means that closing this stream will only shutdown
@@ -47,7 +47,7 @@ public class ZeroTierInputStream extends InputStream {
* @return Number of bytes transferred
* @exception IOException when an I/O error occurs
*/
- public long transferTo​(OutputStream destStream) throws IOException
+ public long transferTo(OutputStream destStream) throws IOException
{
Objects.requireNonNull(destStream, "destStream must not be null");
int bytesTransferred = 0, bytesRead;
@@ -64,7 +64,7 @@ public class ZeroTierInputStream extends InputStream {
* @return Single byte read
* @exception IOException when an I/O error occurs
*/
- public int read​() throws IOException
+ public int read() throws IOException
{
byte[] buf = new byte[1];
// Unlike a native read(), if nothing is read we should return -1
@@ -73,7 +73,7 @@ public class ZeroTierInputStream extends InputStream {
return -1;
}
if (retval < 0) {
- throw new IOException("read​(), errno=" + retval);
+ throw new IOException("read(), errno=" + retval);
}
return buf[0];
}
@@ -84,7 +84,7 @@ public class ZeroTierInputStream extends InputStream {
* @return Number of bytes read
* @exception IOException when an I/O error occurs
*/
- public int read​(byte[] destBuffer) throws IOException
+ public int read(byte[] destBuffer) throws IOException
{
Objects.requireNonNull(destBuffer, "input byte array must not be null");
// Unlike a native read(), if nothing is read we should return -1
@@ -93,7 +93,7 @@ public class ZeroTierInputStream extends InputStream {
return -1;
}
if (retval < 0) {
- throw new IOException("read​(destBuffer), errno=" + retval);
+ throw new IOException("read(destBuffer), errno=" + retval);
}
return retval;
}
@@ -106,7 +106,7 @@ public class ZeroTierInputStream extends InputStream {
* @return Number of bytes read.
* @exception IOException when an I/O error occurs
*/
- public int read​(byte[] destBuffer, int offset, int numBytes) throws IOException
+ public int read(byte[] destBuffer, int offset, int numBytes) throws IOException
{
Objects.requireNonNull(destBuffer, "input byte array must not be null");
if (offset < 0) {
@@ -127,7 +127,7 @@ public class ZeroTierInputStream extends InputStream {
return -1;
}
if (retval < 0) {
- throw new IOException("read​(destBuffer, offset, numBytes), errno=" + retval);
+ throw new IOException("read(destBuffer, offset, numBytes), errno=" + retval);
}
return retval;
}
@@ -137,7 +137,7 @@ public class ZeroTierInputStream extends InputStream {
* @return Array of bytes
* @exception IOException when an I/O error occurs
*/
- public byte[] readAllBytes​() throws IOException
+ public byte[] readAllBytes() throws IOException
{
int pendingDataSize = ZeroTierNative.zts_get_pending_data_size(zfd);
byte[] buf = new byte[pendingDataSize];
@@ -146,7 +146,7 @@ public class ZeroTierInputStream extends InputStream {
// No action needed
}
if (retval < 0) {
- throw new IOException("readAllBytes​(), errno=" + retval);
+ throw new IOException("readAllBytes(), errno=" + retval);
}
return buf;
}
@@ -159,7 +159,7 @@ public class ZeroTierInputStream extends InputStream {
* @return Nothing.
* @exception IOException when an I/O error occurs
*/
- public int readNBytes​(byte[] destBuffer, int offset, int numBytes) throws IOException
+ public int readNBytes(byte[] destBuffer, int offset, int numBytes) throws IOException
{
Objects.requireNonNull(destBuffer, "input byte array must not be null");
if (offset < 0) {
@@ -179,7 +179,7 @@ public class ZeroTierInputStream extends InputStream {
// No action needed
}
if (retval < 0) {
- throw new IOException("readNBytes​(destBuffer, offset, numBytes), errno=" + retval);
+ throw new IOException("readNBytes(destBuffer, offset, numBytes), errno=" + retval);
}
return retval;
}
@@ -190,7 +190,7 @@ public class ZeroTierInputStream extends InputStream {
* @return Nothing.
* @exception IOException when an I/O error occurs
*/
- public long skip​(long numBytes) throws IOException
+ public long skip(long numBytes) throws IOException
{
if (numBytes <= 0) {
return 0;
diff --git a/src/bindings/java/com/zerotier/sockets/ZeroTierSocket.java b/src/bindings/java/com/zerotier/sockets/ZeroTierSocket.java
index ffedb3b..7b0fea3 100644
--- a/src/bindings/java/com/zerotier/sockets/ZeroTierSocket.java
+++ b/src/bindings/java/com/zerotier/sockets/ZeroTierSocket.java
@@ -232,12 +232,12 @@ public class ZeroTierSocket {
if (_zfd < 0) {
throw new IOException("Invalid socket (fd < 0)");
}
- int accetpedFd = -1;
+ int acceptedFd = -1;
ZeroTierSocketAddress addr = new ZeroTierSocketAddress();
- if ((accetpedFd = ZeroTierNative.zts_bsd_accept(_zfd, addr)) < 0) {
- throw new IOException("Error while accepting connection (" + accetpedFd + ")");
+ if ((acceptedFd = ZeroTierNative.zts_bsd_accept(_zfd, addr)) < 0) {
+ throw new IOException("Error while accepting connection (" + acceptedFd + ")");
}
- return new ZeroTierSocket(_family, _type, _protocol, accetpedFd);
+ return new ZeroTierSocket(_family, _type, _protocol, acceptedFd);
}
/**
@@ -421,7 +421,7 @@ public class ZeroTierSocket {
* Return whether this ZeroTierSocket is bound to a local address
* @return true or false
*/
- public boolean isBound​()
+ public boolean isBound()
{
return _isBound;
}
@@ -430,7 +430,7 @@ public class ZeroTierSocket {
* Return whether this ZeroTierSocket has been closed
* @return true or false
*/
- public boolean isClosed​()
+ public boolean isClosed()
{
return _isClosed;
}
@@ -439,7 +439,7 @@ public class ZeroTierSocket {
* Return whether this ZeroTierSocket is connected to a remote address
* @return true or false
*/
- public boolean isConnected​()
+ public boolean isConnected()
{
return _isConnected;
}
@@ -526,7 +526,7 @@ public class ZeroTierSocket {
* Return whether the input-aspect of the ZeroTierSocket has been disabled.
* @return true or false
*/
- public boolean inputStreamHasBeenShutdown​()
+ public boolean inputStreamHasBeenShutdown()
{
return _inputHasBeenShutdown;
}
@@ -535,7 +535,7 @@ public class ZeroTierSocket {
* Return whether the output-aspect of the ZeroTierSocket has been disabled.
* @return true or false
*/
- public boolean outputStreamHasBeenShutdown​()
+ public boolean outputStreamHasBeenShutdown()
{
return _outputHasBeenShutdown;
}
diff --git a/src/lwipopts.h b/src/lwipopts.h
index 20e7437..5ddb269 100644
--- a/src/lwipopts.h
+++ b/src/lwipopts.h
@@ -149,7 +149,7 @@ happening sooner than they should.
#define TCP_FAST_INTERVAL TCP_TMR_INTERVAL
#endif /* TCP_FAST_INTERVAL */
-#ifndef TCP_SLOW_INTERVALs
+#ifndef TCP_SLOW_INTERVAL
/* the coarse grained timeout in milliseconds */
#define TCP_SLOW_INTERVAL (2*TCP_TMR_INTERVAL)
#endif /* TCP_SLOW_INTERVAL */