Commit 65a1bebe authored by Jukka Rissanen's avatar Jukka Rissanen
Browse files

net: Replace NET_WAIT_FOREVER by SYS_FOREVER_MS



As we now have SYS_FOREVER_MS, use that instead of network
specific NET_WAIT_FOREVER.

Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
parent b78c9dca
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -28,12 +28,6 @@
extern "C" {
#endif

/**
 * Symbol to indicate that the caller wants the timeout to be waited forever.
 * This can be used when a network API expects a millisecond timeout.
 */
#define NET_WAIT_FOREVER (-1)

/** Let the max timeout be 100 ms lower because of
 * possible rounding in delayed work implementation.
 */
+3 −3
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ struct websocket_request {
 * @param req Websocket request. User should allocate and fill the request
 *        data.
 * @param timeout Max timeout to wait for the connection. The timeout value is
 *        in milliseconds. Value NET_WAIT_FOREVER means to wait forever.
 *        in milliseconds. Value SYS_FOREVER_MS means to wait forever.
 * @param user_data User specified data that is passed to the callback.
 *
 * @return Websocket id to be used when sending/receiving Websocket data.
@@ -143,7 +143,7 @@ int websocket_connect(int http_sock, struct websocket_request *req,
 *        is the only message, then opcode should have proper opcode (text or
 *        binary) set.
 * @param timeout How long to try to send the message. The value is in
 *        milliseconds. Value NET_WAIT_FOREVER means to wait forever.
 *        milliseconds. Value SYS_FOREVER_MS means to wait forever.
 *
 * @return <0 if error, >=0 amount of bytes sent
 */
@@ -163,7 +163,7 @@ int websocket_send_msg(int ws_sock, const u8_t *payload, size_t payload_len,
 * @param message_type Type of the message.
 * @param remaining How much there is data left in the message after this read.
 * @param timeout How long to try to receive the message.
 *        The value is in milliseconds. Value NET_WAIT_FOREVER means to wait
 *        The value is in milliseconds. Value SYS_FOREVER_MS means to wait
 *        forever.
 *
 * @return <0 if error, >=0 amount of bytes received
+1 −1
Original line number Diff line number Diff line
@@ -309,7 +309,7 @@ static void poll_mqtt(void)
	int rc;

	while (mqtt_connected) {
		rc = wait(NET_WAIT_FOREVER);
		rc = wait(SYS_FOREVER_MS);
		if (rc > 0) {
			mqtt_input(&client_ctx);
		}
+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ static size_t how_much_to_send(size_t max_len)
static ssize_t sendall_with_ws_api(int sock, const void *buf, size_t len)
{
	return websocket_send_msg(sock, buf, len, WEBSOCKET_OPCODE_DATA_TEXT,
				  true, true, NET_WAIT_FOREVER);
				  true, true, SYS_FOREVER_MS);
}

static ssize_t sendall_with_bsd_api(int sock, const void *buf, size_t len)
+1 −5
Original line number Diff line number Diff line
@@ -897,11 +897,7 @@ int dns_resolve_name(struct dns_resolve_context *ctx,
		return -EINVAL;
	}

	if (timeout == NET_WAIT_FOREVER) {
		tout = K_FOREVER;
	} else {
		tout = K_MSEC(timeout);
	}
	tout = SYS_TIMEOUT_MS(timeout);

	/* Timeout cannot be 0 as we cannot resolve name that fast.
	 */
Loading