You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -76,6 +76,7 @@ OPTIONS:
76
76
-g, --gid Group id to run with
77
77
-s, --signal Signal to send to the command when exit it (default: 1, SIGHUP)
78
78
-a, --url-arg Allow client to send command line arguments in URL (eg: http://localhost:7681?arg=foo&arg=bar)
79
+
-f, --arg-file Temporary file template to write URL arguments to (ex. /tmp/prefix); the temporary file's full path is then passed in as a command line argument
79
80
-R, --readonly Do not allow clients to write to the TTY
80
81
-t, --client-option Send option to client (format: key=value), repeat to add more options
81
82
-T, --terminal-type Terminal type to report, default: xterm-256color
" -s, --signal Signal to send to the command when exit it (default: 1, SIGHUP)\n"
110
110
" -a, --url-arg Allow client to send command line arguments in URL (eg: http://localhost:7681?arg=foo&arg=bar)\n"
111
-
" -f, --arg-file Allow client to write URL arguments to a temporary file; the file name is then passed in as a command line argument\n"
111
+
" -f, --arg-file Temporary file template to write URL arguments to (ex. /tmp/prefix); the temporary file's full path is then passed in as a command line argument\n"
112
112
" -R, --readonly Do not allow clients to write to the TTY\n"
113
113
" -t, --client-option Send option to client (format: key=value), repeat to add more options\n"
114
114
" -T, --terminal-type Terminal type to report, default: xterm-256color\n"
@@ -184,6 +184,7 @@ static struct server *server_new(int argc, char **argv, int start) {
184
184
185
185
staticvoidserver_free(structserver*ts) {
186
186
if (ts==NULL) return;
187
+
if (ts->arg_file!=NULL) free(ts->arg_file);
187
188
if (ts->credential!=NULL) free(ts->credential);
188
189
if (ts->index!=NULL) free(ts->index);
189
190
free(ts->command);
@@ -323,10 +324,10 @@ int main(int argc, char **argv) {
323
324
break;
324
325
case'a':
325
326
server->url_arg= true;
326
-
server->arg_file=false;
327
+
server->arg_file=NULL;
327
328
break;
328
329
case'f':
329
-
server->arg_file=true;
330
+
server->arg_file=strdup(optarg);
330
331
server->url_arg= false;
331
332
break;
332
333
case'R':
@@ -545,7 +546,7 @@ int main(int argc, char **argv) {
545
546
}
546
547
if (server->check_origin) lwsl_notice(" check origin: true\n");
547
548
if (server->url_arg) lwsl_notice(" allow url arg to cli arg: true\n");
548
-
if (server->arg_file) lwsl_notice(" allow url arg to tmp file: true\n");
549
+
if (server->arg_file!=NULL) lwsl_notice(" temp file template: %s\n", server->arg_file);
549
550
if (server->readonly) lwsl_notice(" readonly: true\n");
550
551
if (server->max_clients>0)
551
552
lwsl_notice(" max clients: %d\n", server->max_clients);
0 commit comments