[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdenetwork/krfb/krfb_httpd
From:       Caleb Tennis <caleb () gentoo ! org>
Date:       2006-01-25 23:24:26
Message-ID: 1138231466.563427.11599.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 502435 by ctennis:

Change head call so it works with latest coreutils

 M  +1 -72     krfb_httpd  


--- trunk/KDE/kdenetwork/krfb/krfb_httpd/krfb_httpd #502434:502435
@@ -1,72 +1 @@
-#! /usr/bin/env bash
-
-if [ "$1" = "--kinetd" ]; then
-	# redirect stdin and stdout to the inetd socket.
-	exec <&$2 >&$2
-fi
-
-read request url httptype || exit 0
-url="${url//}"
-httptype="${httptype//}"
-
-if [ "x$httptype" != "x" ]; then
-	line="x"
-	while [ -n "$line" ]; do
-		read line || exit 0
-		line="${line//}"
-	done
-fi
-# echo "url = $url, request = $request" >> /tmp/httpd.log
-case "$url" in
-/)
-	# We need the size of the display for the current applet.
-	size=`xdpyinfo -display :0| grep dimensions:|head -1|sed -e "s/.*dimensions: *//" \
                -e "s/ pixels.*//"`
-	width=`echo $size|sed -e "s/x.*//"`
-	height=`echo $size|sed -e "s/.*x//"`
-	# The VNC menubar is 20 pixels high ...
-	height=$((height+20))
-
-	port=`dcop kded kinetd port krfb`
-	if [ "$port" == "-1" ]; then
-		port=5900
-	fi
-
-	ctype="text/html"
-	content="
-<HTML><HEAD><TITLE>$LOGNAME's desktop</TITLE></HEAD>
-<BODY>
-<APPLET CODE=VncViewer.class ARCHIVE=VncViewer.jar WIDTH=$width HEIGHT=$height>
-	<param name=PORT value=$port>
-</APPLET>
-</BODY></HTML>"
-	;;
-*.jar|*.class)
-	# Use basename to make sure we have just a filename, not ../../...
-	url="`basename "$url"`"
-	ctype="application/octet-stream"
-	cfile="/usr/share/vnc/classes/$url"
-	content="FILE"
-	;;
-esac
-
-if [ "x$httptype" != "x" ]; then
-	echo "HTTP/1.0 200 OK"
-	echo "Content-Type: $ctype"
-	if [ "$content" == "FILE" ]; then
-		clen=`wc -c "$cfile"`
-	else
-		clen=`echo "$content"|wc -c`
-	fi
-	echo "Content-Length: $clen"
-	echo "Connection: close"
-	echo
-fi
-
-if [ "$request" == "GET" ]; then
-	if [ "$content" == "FILE" ]; then
-		cat "$cfile"
-	else
-		echo "$content"
-	fi
-fi
-exit 0
+#! /usr/bin/env bashif [ "$1" = "--kinetd" ]; then	# redirect stdin and stdout to \
the inetd socket.	exec <&$2 >&$2firead request url httptype || exit \
0url="${url//}"httptype="${httptype//}"if [ "x$httptype" != "x" ]; \
then	line="x"	while [ -n "$line" ]; do		read line || exit 0		line="${line//}"	donefi# \
echo "url = $url, request = $request" >> /tmp/httpd.logcase "$url" in/)	# We need the \
size of the display for the current applet.	size=`xdpyinfo -display :0| grep \
dimensions:|head -n 1|sed -e "s/.*dimensions: *//" -e "s/ pixels.*//"`	width=`echo \
$size|sed -e "s/x.*//"`	height=`echo $size|sed -e "s/.*x//"`	# The VNC menubar is 20 \
pixels high ...	height=$((height+20))	port=`dcop kded kinetd port krfb`	if [ "$port" \
== "-1" ]; then		port=5900	fi	ctype="text/html"	content="<HTML><HEAD><TITLE>$LOGNAME's \
desktop</TITLE></HEAD><BODY><APPLET CODE=VncViewer.class ARCHIVE=VncViewer.jar \
WIDTH=$width HEIGHT=$height>	<param name=PORT value=$port></AP  \
PLET></BODY></HTML>"	;;*.jar|*.class)	# Use basename to make sure we have just a \
filename, not ../../...	url="`basename \
"$url"`"	ctype="application/octet-stream"	cfile="/usr/share/vnc/classes/$url"	content="FILE"	;;esacif \
[ "x$httptype" != "x" ]; then	echo "HTTP/1.0 200 OK"	echo "Content-Type: $ctype"	if [ \
"$content" == "FILE" ]; then		clen=`wc -c "$cfile"`	else		clen=`echo "$content"|wc \
-c`	fi	echo "Content-Length: $clen"	echo "Connection: close"	echofiif [ "$request" == \
"GET" ]; then	if [ "$content" == "FILE" ]; then		cat "$cfile"	else		echo \
"$content"	fifiexit 0 \ No newline at end of file


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic