Skip to content

Commit deca6ee

Browse files
committed
Fixing two Debian-reported bugs.
1. chm_http begins to refuse connections after a while (created threads were never joined...) 2. bashism used in user-contributed script mozilla_helper.sh
1 parent bc087ed commit deca6ee

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

contrib/mozilla_helper.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@ echo "unpacking :$*: on $host:$port" >/tmp/chm.log
88
chm_http --port=$port --bind=$host "$*" >chm.log 2>&1 &
99

1010
HTTP=/tmp/chm2http.html
11-
echo -e "<html><head>\n<title>$*</title>" >$HTTP
12-
echo -e "<meta http-equiv='refresh' content=\"5;
13-
url=http://$host:$port/\">" >>$HTTP
14-
echo -e "<title>working</title></head>" >>$HTTP
15-
echo -e "<body>please wait while I unpack :$*:<br>working...<br><br>"
16-
>>$HTTP
17-
echo -e "chm_http reports:<br>" >>$HTTP
11+
echo "<html><head><title>$*</title>" >$HTTP
12+
echo "<meta http-equiv='refresh' content=\"5; url=http://$host:$port/\">" >>$HTTP
13+
echo "<title>working</title></head>" >>$HTTP
14+
echo "<body>please wait while I unpack :$*:<br>working...<br><br>" >>$HTTP
15+
echo "chm_http reports:<br>" >>$HTTP
1816
cat chm.log >>$HTTP
19-
echo -e "</body></html>" >>$HTTP
17+
echo "</body></html>" >>$HTTP
2018

2119
mozilla -remote "openURL($HTTP)"
2220
rm -f /tmp/chm.log /tmp/chm2http.html

src/chm_http.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ static void chmhttp_server(const char *filename)
193193
break;
194194

195195
pthread_create(&tid, NULL, _slave, (void *)slave);
196+
pthread_detach(&tid);
196197
}
197198
free(slave);
198199
}

0 commit comments

Comments
 (0)