mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-07-04 11:04:13 +08:00
thttpd:fix Coding Style Check Failed issue
error: Mixed case identifier found Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
This commit is contained in:
parent
44d2250b6e
commit
2de1fdcebd
@ -1854,7 +1854,7 @@ static int ls(httpd_conn *hc)
|
||||
char arg[16];
|
||||
char *argv[1];
|
||||
#if CONFIG_THTTPD_CGI_TIMELIMIT > 0
|
||||
ClientData client_data;
|
||||
clientdata client_data;
|
||||
#endif
|
||||
|
||||
dirp = opendir(hc->expnfilename);
|
||||
|
@ -96,8 +96,8 @@ struct connect_s
|
||||
int conn_state;
|
||||
httpd_conn *hc;
|
||||
time_t active_at;
|
||||
Timer *wakeup_timer;
|
||||
Timer *linger_timer;
|
||||
timer *wakeup_timer;
|
||||
timer *linger_timer;
|
||||
off_t end_offset; /* The final offset+1 of the file to send */
|
||||
off_t offset; /* The current offset into the file to send */
|
||||
bool eof; /* Set true when length==0 read from file */
|
||||
@ -128,10 +128,10 @@ static void handle_linger(struct connect_s *conn, struct timeval *tv);
|
||||
static void finish_connection(struct connect_s *conn, struct timeval *tv);
|
||||
static void clear_connection(struct connect_s *conn, struct timeval *tv);
|
||||
static void really_clear_connection(struct connect_s *conn);
|
||||
static void idle(ClientData client_data, struct timeval *nowp);
|
||||
static void linger_clear_connection(ClientData client_data,
|
||||
static void idle(clientdata client_data, struct timeval *nowp);
|
||||
static void linger_clear_connection(clientdata client_data,
|
||||
struct timeval *nowp);
|
||||
static void occasional(ClientData client_data, struct timeval *nowp);
|
||||
static void occasional(clientdata client_data, struct timeval *nowp);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
@ -524,7 +524,7 @@ static void finish_connection(struct connect_s *conn, struct timeval *tv)
|
||||
|
||||
static void clear_connection(struct connect_s *conn, struct timeval *tv)
|
||||
{
|
||||
ClientData client_data;
|
||||
clientdata client_data;
|
||||
|
||||
if (conn->wakeup_timer != NULL)
|
||||
{
|
||||
@ -594,7 +594,7 @@ static void really_clear_connection(struct connect_s *conn)
|
||||
free_connections = conn;
|
||||
}
|
||||
|
||||
static void idle(ClientData client_data, struct timeval *nowp)
|
||||
static void idle(clientdata client_data, struct timeval *nowp)
|
||||
{
|
||||
int cnum;
|
||||
struct connect_s *conn;
|
||||
@ -629,7 +629,7 @@ static void idle(ClientData client_data, struct timeval *nowp)
|
||||
}
|
||||
}
|
||||
|
||||
static void linger_clear_connection(ClientData client_data,
|
||||
static void linger_clear_connection(clientdata client_data,
|
||||
struct timeval *nowp)
|
||||
{
|
||||
struct connect_s *conn;
|
||||
@ -640,7 +640,7 @@ static void linger_clear_connection(ClientData client_data,
|
||||
really_clear_connection(conn);
|
||||
}
|
||||
|
||||
static void occasional(ClientData client_data, struct timeval *nowp)
|
||||
static void occasional(clientdata client_data, struct timeval *nowp)
|
||||
{
|
||||
tmr_cleanup();
|
||||
}
|
||||
@ -727,7 +727,7 @@ int thttpd_main(int argc, char **argv)
|
||||
|
||||
/* Set up the occasional timer */
|
||||
|
||||
if (tmr_create(NULL, occasional, JunkClientData,
|
||||
if (tmr_create(NULL, occasional, junkclientdata,
|
||||
CONFIG_THTTPD_OCCASIONAL_MSEC * 1000L, 1) == NULL)
|
||||
{
|
||||
nerr("ERROR: tmr_create(occasional) failed\n");
|
||||
@ -736,7 +736,7 @@ int thttpd_main(int argc, char **argv)
|
||||
|
||||
/* Set up the idle timer */
|
||||
|
||||
if (tmr_create(NULL, idle, JunkClientData, 5 * 1000L, 1) == NULL)
|
||||
if (tmr_create(NULL, idle, junkclientdata, 5 * 1000L, 1) == NULL)
|
||||
{
|
||||
nerr("ERROR: tmr_create(idle) failed\n");
|
||||
exit(1);
|
||||
|
@ -717,7 +717,7 @@ static int cgi_child(int argc, char **argv)
|
||||
{
|
||||
FAR httpd_conn *hc = (FAR httpd_conn *)strtoul(argv[1], NULL, 16);
|
||||
#if CONFIG_THTTPD_CGI_TIMELIMIT > 0
|
||||
ClientData client_data;
|
||||
clientdata client_data;
|
||||
#endif
|
||||
FAR char **argp;
|
||||
FAR struct cgi_conn_s *cc;
|
||||
@ -1096,7 +1096,7 @@ errout_with_sem:
|
||||
}
|
||||
|
||||
#if CONFIG_THTTPD_CGI_TIMELIMIT > 0
|
||||
static void cgi_kill(ClientData client_data, struct timeval *nowp)
|
||||
static void cgi_kill(clientdata client_data, struct timeval *nowp)
|
||||
{
|
||||
pid_t pid = (pid_t)client_data.i;
|
||||
|
||||
|
@ -7,7 +7,8 @@
|
||||
*
|
||||
* Derived from the file libhttpd.c in the original THTTPD package:
|
||||
*
|
||||
* Copyright (C) 1995,1998,1999,2000,2001 by Jef Poskanzer <jef@mail.acme.com>.
|
||||
* Copyright (C) 1995,1998,1999,2000,2001 by Jef Poskanzer
|
||||
* <jef@mail.acme.com>.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -55,7 +56,7 @@
|
||||
extern int cgi(httpd_conn *hc);
|
||||
#if CONFIG_THTTPD_CGI_TIMELIMIT > 0
|
||||
struct timeval;
|
||||
static void cgi_kill(ClientData client_data, struct timeval *now);
|
||||
static void cgi_kill(clientdata client_data, struct timeval *now);
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_THTTPD && CONFIG_THTTPD_CGI_PATTERN */
|
||||
|
@ -57,20 +57,20 @@
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static Timer *timers[HASH_SIZE];
|
||||
static Timer *free_timers;
|
||||
static timer *timers[HASH_SIZE];
|
||||
static timer *free_timers;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
ClientData JunkClientData;
|
||||
clientdata junkclientdata;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
static unsigned int hash(Timer *tmr)
|
||||
static unsigned int hash(timer *tmr)
|
||||
{
|
||||
/* We can hash on the trigger time, even though it can change over the
|
||||
* life of a timer via the periodic bit.
|
||||
@ -82,11 +82,11 @@ static unsigned int hash(Timer *tmr)
|
||||
(unsigned int)tmr->time.tv_usec) % HASH_SIZE;
|
||||
}
|
||||
|
||||
static void l_add(Timer *tmr)
|
||||
static void l_add(timer *tmr)
|
||||
{
|
||||
int h = tmr->hash;
|
||||
register Timer *tmr2;
|
||||
register Timer *tmr2prev;
|
||||
register timer *tmr2;
|
||||
register timer *tmr2prev;
|
||||
|
||||
tmr2 = timers[h];
|
||||
if (tmr2 == NULL)
|
||||
@ -139,7 +139,7 @@ static void l_add(Timer *tmr)
|
||||
}
|
||||
}
|
||||
|
||||
static void l_remove(Timer *tmr)
|
||||
static void l_remove(timer *tmr)
|
||||
{
|
||||
int h = tmr->hash;
|
||||
|
||||
@ -158,7 +158,7 @@ static void l_remove(Timer *tmr)
|
||||
}
|
||||
}
|
||||
|
||||
static void l_resort(Timer *tmr)
|
||||
static void l_resort(timer *tmr)
|
||||
{
|
||||
/* Remove the timer from its old list. */
|
||||
|
||||
@ -189,10 +189,10 @@ void tmr_init(void)
|
||||
free_timers = NULL;
|
||||
}
|
||||
|
||||
Timer *tmr_create(struct timeval *now, TimerProc *timer_proc,
|
||||
ClientData client_data, long msecs, int periodic)
|
||||
timer *tmr_create(struct timeval *now, timerproc *timer_proc,
|
||||
clientdata client_data, long msecs, int periodic)
|
||||
{
|
||||
Timer *tmr;
|
||||
timer *tmr;
|
||||
|
||||
if (free_timers != NULL)
|
||||
{
|
||||
@ -201,7 +201,7 @@ Timer *tmr_create(struct timeval *now, TimerProc *timer_proc,
|
||||
}
|
||||
else
|
||||
{
|
||||
tmr = (Timer*)httpd_malloc(sizeof(Timer));
|
||||
tmr = (timer *)httpd_malloc(sizeof(timer));
|
||||
if (!tmr)
|
||||
{
|
||||
return NULL;
|
||||
@ -244,7 +244,7 @@ long tmr_mstimeout(struct timeval *now)
|
||||
int gotone;
|
||||
long msecs;
|
||||
long m;
|
||||
register Timer *tmr;
|
||||
register timer *tmr;
|
||||
|
||||
gotone = 0;
|
||||
msecs = 0;
|
||||
@ -288,8 +288,8 @@ long tmr_mstimeout(struct timeval *now)
|
||||
void tmr_run(struct timeval *now)
|
||||
{
|
||||
int h;
|
||||
Timer *tmr;
|
||||
Timer *next;
|
||||
timer *tmr;
|
||||
timer *next;
|
||||
|
||||
for (h = 0; h < HASH_SIZE; ++h)
|
||||
{
|
||||
@ -331,7 +331,7 @@ void tmr_run(struct timeval *now)
|
||||
}
|
||||
}
|
||||
|
||||
void tmr_cancel(Timer *tmr)
|
||||
void tmr_cancel(timer *tmr)
|
||||
{
|
||||
/* Remove it from its active list. */
|
||||
|
||||
@ -346,13 +346,13 @@ void tmr_cancel(Timer *tmr)
|
||||
|
||||
void tmr_cleanup(void)
|
||||
{
|
||||
Timer *tmr;
|
||||
timer *tmr;
|
||||
|
||||
while (free_timers != NULL)
|
||||
{
|
||||
tmr = free_timers;
|
||||
free_timers = tmr->next;
|
||||
httpd_free((void*)tmr);
|
||||
httpd_free((void *)tmr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,34 +65,34 @@ typedef union
|
||||
void *p;
|
||||
int i;
|
||||
long l;
|
||||
} ClientData;
|
||||
} clientdata;
|
||||
|
||||
/* The TimerProc gets called when the timer expires. It gets passed
|
||||
/* The Timerproc gets called when the timer expires. It gets passed
|
||||
* the ClientData associated with the timer, and a timeval in case
|
||||
* it wants to schedule another timer.
|
||||
*/
|
||||
|
||||
typedef void TimerProc(ClientData client_data, struct timeval *nowp);
|
||||
typedef void timerproc(clientdata client_data, struct timeval *nowp);
|
||||
|
||||
/* The Timer struct. */
|
||||
|
||||
typedef struct TimerStruct
|
||||
typedef struct timerstruct
|
||||
{
|
||||
TimerProc *timer_proc;
|
||||
ClientData client_data;
|
||||
timerproc *timer_proc;
|
||||
clientdata client_data;
|
||||
long msecs;
|
||||
int periodic;
|
||||
struct timeval time;
|
||||
struct TimerStruct *prev;
|
||||
struct TimerStruct *next;
|
||||
struct timerstruct *prev;
|
||||
struct timerstruct *next;
|
||||
int hash;
|
||||
} Timer;
|
||||
} timer;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
extern ClientData JunkClientData; /* For use when you don't care */
|
||||
extern clientdata junkclientdata; /* For use when you don't care */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
@ -103,11 +103,11 @@ extern ClientData JunkClientData; /* For use when you don't care */
|
||||
extern void tmr_init(void);
|
||||
|
||||
/* Set up a timer, either periodic or one-shot.
|
||||
* Returns (Timer *)0 on errors.
|
||||
* Returns (timer *)0 on errors.
|
||||
*/
|
||||
|
||||
extern Timer *tmr_create(struct timeval *nowp, TimerProc *timer_proc,
|
||||
ClientData client_data, long msecs, int periodic);
|
||||
extern timer *tmr_create(struct timeval *nowp, timerproc *timer_proc,
|
||||
clientdata client_data, long msecs, int periodic);
|
||||
|
||||
/* Returns a timeout in milliseconds indicating how long until the next timer
|
||||
* triggers. You can just put the call to this routine right in your poll().
|
||||
@ -126,7 +126,7 @@ extern void tmr_run(struct timeval *nowp);
|
||||
* descheduled when they run, so you don't have to call this on them.
|
||||
*/
|
||||
|
||||
extern void tmr_cancel(Timer *timer);
|
||||
extern void tmr_cancel(timer *timer);
|
||||
|
||||
/* Clean up the timers package, freeing any unused storage. */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user