mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
added -w command line option for axhttd
fixed compilation error for axtlswrap git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@216 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
parent
2e0da63a79
commit
cbd60876eb
@ -41,6 +41,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/poll.h>
|
#include <sys/poll.h>
|
||||||
|
#include "os_port.h"
|
||||||
#include "ssl.h"
|
#include "ssl.h"
|
||||||
|
|
||||||
/* If nothing is received or sent in this many seconds, give up */
|
/* If nothing is received or sent in this many seconds, give up */
|
||||||
|
@ -44,6 +44,7 @@ struct serverstruct *servers;
|
|||||||
struct connstruct *usedconns;
|
struct connstruct *usedconns;
|
||||||
struct connstruct *freeconns;
|
struct connstruct *freeconns;
|
||||||
const char * const server_version = "axhttpd/"AXTLS_VERSION;
|
const char * const server_version = "axhttpd/"AXTLS_VERSION;
|
||||||
|
static const char *webroot = CONFIG_HTTP_WEBROOT;
|
||||||
|
|
||||||
static void addtoservers(int sd);
|
static void addtoservers(int sd);
|
||||||
static int openlistener(char *address, int port);
|
static int openlistener(char *address, int port);
|
||||||
@ -182,9 +183,18 @@ int main(int argc, char *argv[])
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%s: [-p [address:]httpport] [-s [address:]httpsport]\n",
|
if (strcmp(argv[i], "-w") == 0 && argv[i+1] != NULL)
|
||||||
argv[0]);
|
{
|
||||||
exit(0);
|
webroot = argv[i+1];
|
||||||
|
i += 2;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%s:\n"
|
||||||
|
" [-p [address:]httpport]\n"
|
||||||
|
" [-s [address:]httpsport]\n"
|
||||||
|
" [-w webroot]\n", argv[0]);
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < INITIAL_CONNECTION_SLOTS; i++)
|
for (i = 0; i < INITIAL_CONNECTION_SLOTS; i++)
|
||||||
@ -644,10 +654,9 @@ void removeconnection(struct connstruct *cn)
|
|||||||
/*
|
/*
|
||||||
* Change directories one way or the other.
|
* Change directories one way or the other.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void ax_chdir(void)
|
static void ax_chdir(void)
|
||||||
{
|
{
|
||||||
static char *webroot = CONFIG_HTTP_WEBROOT;
|
|
||||||
|
|
||||||
if (chdir(webroot))
|
if (chdir(webroot))
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_HTTP_VERBOSE
|
#ifdef CONFIG_HTTP_VERBOSE
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user