gustavonihei commented on a change in pull request #695:
URL:
https://github.com/apache/incubator-nuttx-apps/pull/695#discussion_r622258955
##########
File path: include/netutils/webclient.h
##########
@@ -235,6 +240,29 @@ struct webclient_context
FAR void *body_callback_arg;
FAR const struct webclient_tls_ops *tls_ops;
FAR void *tls_ctx;
+ unsigned int flags;
+
+ /* WEBCLIENT_FLAG_NON_BLOCKING tells webclient_perform() to
+ * use non-blocking I/O.
+ *
+ * If this flag is set, webclient_perform() returns -EAGAIN
+ * when it would otherwise block for network I/O. In that case,
+ * the application should either retry the operation later by calling
+ * webclient_perform() again, or abort it by calling webclient_abort().
+ * It can also use webclient_get_poll_info() to avoid busy-retrying.
+ *
+ * If this flag is set, it's the application's responsibility to
+ * implement a timeout.
+ *
+ * If the application specifies tls_ops, it's the application's
+ * responsibility to make the TLS implementation to use non-blocking I/O
+ * in addition to specifying this flag.
+ *
+ * Caveat: Even when this flag is set, the current implementation performs
+ * the name resolution in a blocking manner.
+ */
+
+#define WEBCLIENT_FLAG_NON_BLOCKING 1U
Review comment:
Placement of this preprocessor definition is not compliant to the coding
standard.
##########
File path: include/netutils/webclient.h
##########
@@ -249,6 +277,19 @@ struct webclient_context
unsigned int http_status;
FAR char *http_reason;
size_t http_reason_len;
+
+ struct wget_s *ws;
+};
+
+struct webclient_poll_info
+{
+ /* A file descriptor to wait for i/o. */
+
+ int fd;
+ unsigned int flags; /* OR'ed WEBCLIENT_POLL_INFO_xxx flags */
+
+#define WEBCLIENT_POLL_INFO_WANT_READ 1U
+#define WEBCLIENT_POLL_INFO_WANT_WRITE 2U
Review comment:
Placement of these preprocessor definition is not compliant to the
coding standard.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]