Permalink
Browse files

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
  • Loading branch information...
jedwing committed May 23, 2009
1 parent bc087ed commit deca6eed5feedad5e8358b206b98d1af573f8c29
Showing with 7 additions and 8 deletions.
  1. +6 −8 contrib/mozilla_helper.sh
  2. +1 −0 src/chm_http.c
View
@@ -8,15 +8,13 @@ echo "unpacking :$*: on $host:$port" >/tmp/chm.log
chm_http --port=$port --bind=$host "$*" >chm.log 2>&1 &
HTTP=/tmp/chm2http.html
-echo -e "<html><head>\n<title>$*</title>" >$HTTP
-echo -e "<meta http-equiv='refresh' content=\"5;
-url=http://$host:$port/\">" >>$HTTP
-echo -e "<title>working</title></head>" >>$HTTP
-echo -e "<body>please wait while I unpack :$*:<br>working...<br><br>"
->>$HTTP
-echo -e "chm_http reports:<br>" >>$HTTP
+echo "<html><head><title>$*</title>" >$HTTP
+echo "<meta http-equiv='refresh' content=\"5; url=http://$host:$port/\">" >>$HTTP
+echo "<title>working</title></head>" >>$HTTP
+echo "<body>please wait while I unpack :$*:<br>working...<br><br>" >>$HTTP
+echo "chm_http reports:<br>" >>$HTTP
cat chm.log >>$HTTP
-echo -e "</body></html>" >>$HTTP
+echo "</body></html>" >>$HTTP
mozilla -remote "openURL($HTTP)"
rm -f /tmp/chm.log /tmp/chm2http.html
View
@@ -193,6 +193,7 @@ static void chmhttp_server(const char *filename)
break;
pthread_create(&tid, NULL, _slave, (void *)slave);
+ pthread_detach(&tid);
}
free(slave);
}

0 comments on commit deca6ee

Please sign in to comment.