Skip to content

Commit 60f6613

Browse files
andreivasiliuandrey-zelenkov
authored andcommitted
Fix comments for src/nxt_unit.h.
This fixes some typos and grammatical errors in the comments of src/nxt_unit.h Link: <#889> [ Adjust summary and write commit message as this just contains the fixes from the PR and not actual changes - Andrew ] Signed-off-by: Andrew Clayton <[email protected]>
1 parent bd89c7b commit 60f6613

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

Diff for: src/nxt_unit.h

+19-19
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ enum {
4040
/*
4141
* Mostly opaque structure with library state.
4242
*
43-
* Only user defined 'data' pointer exposed here. The rest is unit
43+
* Only the user defined 'data' pointer is exposed here. The rest is unit
4444
* implementation specific and hidden.
4545
*/
4646
struct nxt_unit_s {
@@ -51,8 +51,8 @@ struct nxt_unit_s {
5151
* Thread context.
5252
*
5353
* First (main) context is provided 'for free'. To receive and process
54-
* requests in other thread, one need to allocate context and use it
55-
* further in this thread.
54+
* requests in other threads, one needs to allocate a new context and use it
55+
* further in that thread.
5656
*/
5757
struct nxt_unit_ctx_s {
5858
void *data; /* User context-specific data. */
@@ -72,7 +72,7 @@ struct nxt_unit_port_id_s {
7272
};
7373

7474
/*
75-
* unit provides port storage which is able to store and find the following
75+
* Unit provides port storage which is able to store and find the following
7676
* data structures.
7777
*/
7878
struct nxt_unit_port_s {
@@ -114,13 +114,13 @@ struct nxt_unit_request_info_s {
114114

115115

116116
/*
117-
* Set of application-specific callbacks. Application may leave all optional
118-
* callbacks as NULL.
117+
* Set of application-specific callbacks. The application may leave all
118+
* optional callbacks as NULL.
119119
*/
120120
struct nxt_unit_callbacks_s {
121121
/*
122-
* Process request. Unlike all other callback, this callback
123-
* need to be defined by application.
122+
* Process request. Unlike all other callbacks, this callback is required
123+
* and needs to be defined by the application.
124124
*/
125125
void (*request_handler)(nxt_unit_request_info_t *req);
126126

@@ -201,15 +201,15 @@ struct nxt_unit_read_info_s {
201201
nxt_unit_ctx_t *nxt_unit_init(nxt_unit_init_t *);
202202

203203
/*
204-
* Main function useful in case when application does not have it's own
205-
* event loop. nxt_unit_run() starts infinite message wait and process loop.
204+
* Main function, useful in case the application does not have its own event
205+
* loop. nxt_unit_run() starts an infinite message wait and process loop.
206206
*
207207
* for (;;) {
208208
* app_lib->port_recv(...);
209209
* nxt_unit_process_msg(...);
210210
* }
211211
*
212-
* The normally function returns when QUIT message received from Unit.
212+
* The function returns normally when a QUIT message is received from Unit.
213213
*/
214214
int nxt_unit_run(nxt_unit_ctx_t *);
215215

@@ -220,10 +220,10 @@ int nxt_unit_run_shared(nxt_unit_ctx_t *ctx);
220220
nxt_unit_request_info_t *nxt_unit_dequeue_request(nxt_unit_ctx_t *ctx);
221221

222222
/*
223-
* Receive and process one message, invoke configured callbacks.
223+
* Receive and process one message, and invoke configured callbacks.
224224
*
225-
* If application implements it's own event loop, each datagram received
226-
* from port socket should be initially processed by unit. This function
225+
* If the application implements its own event loop, each datagram received
226+
* from the port socket should be initially processed by unit. This function
227227
* may invoke other application-defined callback for message processing.
228228
*/
229229
int nxt_unit_run_once(nxt_unit_ctx_t *ctx);
@@ -234,8 +234,8 @@ int nxt_unit_process_port_msg(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port);
234234
void nxt_unit_done(nxt_unit_ctx_t *);
235235

236236
/*
237-
* Allocate and initialize new execution context with new listen port to
238-
* process requests in other thread.
237+
* Allocate and initialize a new execution context with a new listen port to
238+
* process requests in another thread.
239239
*/
240240
nxt_unit_ctx_t *nxt_unit_ctx_alloc(nxt_unit_ctx_t *, void *);
241241

@@ -253,7 +253,7 @@ void nxt_unit_split_host(char *host_start, uint32_t host_length,
253253
void nxt_unit_request_group_dup_fields(nxt_unit_request_info_t *req);
254254

255255
/*
256-
* Allocate response structure capable to store limited numer of fields.
256+
* Allocate response structure capable of storing a limited number of fields.
257257
* The structure may be accessed directly via req->response pointer or
258258
* filled step-by-step using functions add_field and add_content.
259259
*/
@@ -273,8 +273,8 @@ int nxt_unit_response_add_content(nxt_unit_request_info_t *req,
273273
const void* src, uint32_t size);
274274

275275
/*
276-
* Send prepared response to Unit server. Response structure destroyed during
277-
* this call.
276+
* Send the prepared response to the Unit server. The Response structure is
277+
* destroyed during this call.
278278
*/
279279
int nxt_unit_response_send(nxt_unit_request_info_t *req);
280280

0 commit comments

Comments
 (0)