mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-05 17:30:27 +00:00
Removed overwriting -b flag, now launches to serveradd:port
This commit is contained in:
parent
df9e0bf18f
commit
a6000b42f2
1 changed files with 5 additions and 6 deletions
|
@ -319,7 +319,6 @@ static bool terminated;
|
||||||
static bool uniprocess;
|
static bool uniprocess;
|
||||||
static bool invalidated;
|
static bool invalidated;
|
||||||
static bool logmessages;
|
static bool logmessages;
|
||||||
static bool launchbrowser;
|
|
||||||
static bool checkedmethod;
|
static bool checkedmethod;
|
||||||
static bool connectionclose;
|
static bool connectionclose;
|
||||||
static bool keyboardinterrupt;
|
static bool keyboardinterrupt;
|
||||||
|
@ -619,8 +618,7 @@ static void GetOpts(int argc, char *argv[]) {
|
||||||
logmessages = true;
|
logmessages = true;
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
launchbrowser = true;
|
logbodies = true;
|
||||||
// logbodies = true;
|
|
||||||
break;
|
break;
|
||||||
case 'z':
|
case 'z':
|
||||||
printport = true;
|
printport = true;
|
||||||
|
@ -1473,8 +1471,10 @@ static void LaunchBrowser() {
|
||||||
} else {
|
} else {
|
||||||
prog = "xdg-open";
|
prog = "xdg-open";
|
||||||
}
|
}
|
||||||
snprintf(openbrowsercommand, sizeof(openbrowsercommand),
|
struct in_addr addr = serveraddr.sin_addr;
|
||||||
"%s http://127.0.0.1:%d", prog, ntohs(serveraddr.sin_port));
|
if (addr.s_addr == INADDR_ANY) addr.s_addr = htonl(INADDR_LOOPBACK);
|
||||||
|
snprintf(openbrowsercommand, sizeof(openbrowsercommand), "%s http://%s:%d",
|
||||||
|
prog, inet_ntoa(addr), ntohs(serveraddr.sin_port));
|
||||||
DEBUGF("Opening browser with command %s\n", openbrowsercommand);
|
DEBUGF("Opening browser with command %s\n", openbrowsercommand);
|
||||||
system(openbrowsercommand);
|
system(openbrowsercommand);
|
||||||
}
|
}
|
||||||
|
@ -2655,7 +2655,6 @@ void RedBean(int argc, char *argv[]) {
|
||||||
inbuf.p = xvalloc(inbuf.n);
|
inbuf.p = xvalloc(inbuf.n);
|
||||||
hdrbuf.n = 4 * 1024;
|
hdrbuf.n = 4 * 1024;
|
||||||
hdrbuf.p = xvalloc(hdrbuf.n);
|
hdrbuf.p = xvalloc(hdrbuf.n);
|
||||||
if (launchbrowser) LaunchBrowser();
|
|
||||||
while (!terminated) {
|
while (!terminated) {
|
||||||
if (zombied) {
|
if (zombied) {
|
||||||
ReapZombies();
|
ReapZombies();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue