Skip to content

Commit

Permalink
ctl: typos
Browse files Browse the repository at this point in the history
  • Loading branch information
dilyanpalauzov authored and miconda committed Apr 10, 2023
1 parent 129fb56 commit d251ec9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/modules/ctl/binrpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
* represented)
* CL = cookie length -1 (number of bytes on which the cookie is represented)
* E.g.: LL= 0 => total_len is represented on 1 byte (LL+1)
* CL= 3 => cookie is represneted on 4 bytes (CL+1)
* CL= 3 => cookie is represented on 4 bytes (CL+1)
*/
/* record format:
* 1b 3b 4b
* |S | size | type || <optional value len> ... || <optional value> ... ||
*
* if S==0, size is the size (in bytes) of the value (if size==0 => null value)
* if S==1, optional_value_len is present, and size is it's size
* if S==1, optional_value_len is present, and size is its size
* (if size==0 => and type==array or struct => marks end, else
* error, reserved)
* Examples:
Expand Down Expand Up @@ -344,7 +344,7 @@ inline static int binrpc_build_hdr( int type, int body_len,



/* changes the length of a header (enough space must be availale) */
/* changes the length of a header (enough space must be available) */
inline static int binrpc_hdr_change_len(unsigned char* hdr, int hdr_len,
int new_len)
{
Expand Down Expand Up @@ -417,7 +417,7 @@ inline static int binrpc_add_skip(struct binrpc_pkt* pkt, int bytes)
* adds only the string mark and len, you'll have to memcpy the contents
* manually later (and also use binrpc_add_skip(pkt, l) or increase
* pkt->crt directly if you want to continue adding to this pkt).
* Usefull for optimizing str writing (e.g. writev(iovec))
* Useful for optimizing str writing (e.g. writev(iovec))
* WARNING: use with care, low level function, binrpc_addstr or
* binrpc_add_str_type are probably what you want.
* WARNING1: BINRPC_T_STR and BINRPC_T_AVP must be 0 term, the len passed to
Expand Down
10 changes: 5 additions & 5 deletions src/modules/ctl/binrpc_run.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ static void _rpc_fault(struct binrpc_ctx* ctx, int code,

if (ctx->replied){
LOG(L_ERR, "ERROR: binrpc: rpc_send: rpc method %s tried to reply"
" more then once\n", ctx->method?ctx->method:"");
" more than once\n", ctx->method?ctx->method:"");
return;
}
err=0;
Expand Down Expand Up @@ -483,7 +483,7 @@ static void rpc_fault(struct binrpc_ctx* ctx, int code, char* fmt, ...)

if (ctx->replied){
LOG(L_ERR, "ERROR: binrpc: rpc_send: rpc method %s tried to reply"
" more then once\n", ctx->method?ctx->method:"");
" more than once\n", ctx->method?ctx->method:"");
return;
}
va_start(ap, fmt);
Expand All @@ -505,7 +505,7 @@ static int rpc_fault_prepare(struct binrpc_ctx* ctx, int code, char* fmt, ...)

if (ctx->replied){
LOG(L_ERR, "ERROR: binrpc: rpc_send: rpc method %s tried to reply"
" more then once\n", ctx->method?ctx->method:"");
" more than once\n", ctx->method?ctx->method:"");
return -1;
}
va_start(ap, fmt);
Expand Down Expand Up @@ -576,7 +576,7 @@ static int rpc_send(struct binrpc_ctx* ctx)

if (ctx->replied){
LOG(L_ERR, "ERROR: binrpc: rpc_send: rpc method %s tried to reply"
" more then once\n", ctx->method?ctx->method:"");
" more than once\n", ctx->method?ctx->method:"");
goto error;
}
b_len=body_get_len(&ctx->out.pkt, &ctx->out.structs);
Expand Down Expand Up @@ -617,7 +617,7 @@ static int rpc_send(struct binrpc_ctx* ctx)
* needed (after bytes_needed new bytes received this
* function will be called again
* reply, - buffer where the reply will be written
* reply_len - intially filled with the reply buffer len,
* reply_len - initially filled with the reply buffer len,
* after the call will contain how much of that
* buffer was really used
* returns: number of bytes processed on success/partial success
Expand Down
2 changes: 1 addition & 1 deletion src/modules/ctl/ctl.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ modparam("ctl", "binrpc", "tcp:3012") # tcp any , port 3012
modparam("ctl", "binrpc", "udp:*:3012") # udp any , port 3012

# old fifo support
modparam("ctl", "fifo", "fifo:/tmp/ser_fifo") # clasic fifo
modparam("ctl", "fifo", "fifo:/tmp/ser_fifo") # classic fifo
modparam("ctl", "fifo", "/tmp/ser_fifo2")
modparam("ctl", "fifo", "udp:*:2050") # fifo protocol over udp
modparam("ctl", "fifo", "tcp:*:2050") # fifo over tcp
Expand Down
6 changes: 3 additions & 3 deletions src/modules/ctl/fifo_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct readline_handle{

enum text_flags {
CHUNK_SEEN = (1 << 0),
CHUNK_POSITIONAL = (1 << 1), /* Positinal parameter, should be followed by \n */
CHUNK_POSITIONAL = (1 << 1), /* Positional parameter, should be followed by \n */
CHUNK_MEMBER_NAME = (1 << 2), /* Struct member name, should be followed by : */
CHUNK_MEMBER_VALUE = (1 << 3) /* Struct member value, should be followed by , if
* there is another member name and \n if not */
Expand Down Expand Up @@ -178,7 +178,7 @@ static int rpc_send (rpc_ctx_t* ctx); /
static void rpc_fault (rpc_ctx_t* ctx, int code, char* fmt, ...); /* Signal a failure to the client */
static int rpc_add (rpc_ctx_t* ctx, char* fmt, ...); /* Add a new piece of data to the result */
static int rpc_scan (rpc_ctx_t* ctx, char* fmt, ...); /* Retrieve request parameters */
static int rpc_rpl_printf (rpc_ctx_t* ctx, char* fmt, ...); /* Add printf-like formated data to the result set */
static int rpc_rpl_printf (rpc_ctx_t* ctx, char* fmt, ...); /* Add printf-like formatted data to the result set */
static int rpc_struct_add (struct text_chunk* s, char* fmt, ...); /* Create a new structure */
static int rpc_struct_scan (struct rpc_struct* s, char* fmt, ...); /* Scan attributes of a structure */
static int rpc_struct_printf(struct text_chunk* s, char* name, char* fmt, ...);
Expand Down Expand Up @@ -457,7 +457,7 @@ static struct rpc_struct* new_struct(rpc_ctx_t* ctx, str* line)
/* Create value chunk */
v = new_chunk_unescape(&value);
if (!v) {
rpc_fault(ctx, 400, "Error while processing struct membeer '%.*s'"
rpc_fault(ctx, 400, "Error while processing struct member '%.*s'"
" on line %d", name.len, ZSW(name.s), ctx->line_no);
goto err;
}
Expand Down
10 changes: 5 additions & 5 deletions src/modules/ctl/io_listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ void io_listen_loop(int fd_no, struct ctrl_socket* cs_lst)
* from this fd (e.g.: we are closing it )
* 0 on EAGAIN or when by some other way it is known that no more
* io events are queued on the fd (the receive buffer is empty).
* Usefull to detect when there are no more io events queued for
* Useful to detect when there are no more io events queued for
* sigio_rt, epoll_et, kqueue.
* >0 on successfull read from the fd (when there might be more io
* queued -- the receive buffer might still be non-empty)
Expand Down Expand Up @@ -382,7 +382,7 @@ static int handle_ctrl_dgram(struct ctrl_socket* cs)
* from this fd (e.g.: we are closing it )
* 0 on EAGAIN or when by some other way it is known that no more
* io events are queued on the fd (the receive buffer is empty).
* Usefull to detect when there are no more io events queued for
* Useful to detect when there are no more io events queued for
* sigio_rt, epoll_et, kqueue.
* >0 on successfull accept from the fd (when there might be more io
* queued -- the receive buffer might still be non-empty)
Expand Down Expand Up @@ -458,7 +458,7 @@ static int handle_new_connect(struct ctrl_socket* cs)
* from this fd (e.g.: we are closing it )
* 0 on EAGAIN or when by some other way it is known that no more
* io events are queued on the fd (the receive buffer is empty).
* Usefull to detect when there are no more io events queued for
* Useful to detect when there are no more io events queued for
* sigio_rt, epoll_et, kqueue.
* >0 on successfull read from the fd (when there might be more io
* queued -- the receive buffer might still be non-empty)
Expand Down Expand Up @@ -572,7 +572,7 @@ static int handle_stream_read(struct stream_connection* s_c, int idx)
* from this fd (e.g.: we are closing it )
* 0 on EAGAIN or when by some other way it is known that no more
* io events are queued on the fd (the receive buffer is empty).
* Usefull to detect when there are no more io events queued for
* Useful to detect when there are no more io events queued for
* sigio_rt, epoll_et, kqueue.
* >0 on successfull read from the fd (when there might be more io
* queued -- the receive buffer might still be non-empty)
Expand Down Expand Up @@ -685,7 +685,7 @@ static int handle_fifo_read(struct ctrl_socket* cs, int idx)
* return: -1 on error
* 0 on EAGAIN or when by some other way it is known that no more
* io events are queued on the fd (the receive buffer is empty).
* Usefull to detect when there are no more io events queued for
* Useful to detect when there are no more io events queued for
* sigio_rt, epoll_et, kqueue.
* >0 on successfull read from the fd (when there might be more io
* queued -- the receive buffer might still be non-empty)
Expand Down

0 comments on commit d251ec9

Please sign in to comment.