diff options
author | Jean-Philippe Lesot <jplesot@google.com> | 2015-04-14 21:16:50 +0200 |
---|---|---|
committer | Jean-Philippe Lesot <jplesot@google.com> | 2015-04-14 22:21:07 +0200 |
commit | baff988ebb836d4d2facc4091924d10e744863d2 (patch) | |
tree | f85dba2e976d285058639ecf37202482c5d03bcc /jack/etc | |
parent | 4ed719ec1fc778ba9cbcca0f735ede845a19058a (diff) | |
download | toolchain_jack-baff988ebb836d4d2facc4091924d10e744863d2.tar.gz toolchain_jack-baff988ebb836d4d2facc4091924d10e744863d2.tar.bz2 toolchain_jack-baff988ebb836d4d2facc4091924d10e744863d2.zip |
Introduce protocol number and jack version in Jack server
Change-Id: I7601ccaa5c666d40be170397ae0878a6aaeb85eb
Diffstat (limited to 'jack/etc')
-rwxr-xr-x | jack/etc/jack | 11 | ||||
-rwxr-xr-x | jack/etc/jack-admin | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/jack/etc/jack b/jack/etc/jack index bfe20fb0..92eda239 100755 --- a/jack/etc/jack +++ b/jack/etc/jack @@ -14,8 +14,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# v 1.1-a11 +# v 1.1-a11 (2-12) # +NEEDED_VERSION=2-12 +PROTOCOLE_VERSION=1 + set -o nounset umask 077 @@ -123,7 +126,7 @@ DELAY_CONNECT=3 # Launch compilation DATE_CONNECT=$(date +%s) while true; do - HTTP_CODE=$(curl --fail --silent --data @- --output "$JACK_EXIT" --write-out %{http_code} --connect-timeout 5 --no-proxy 127.0.0.1:$SERVER_PORT_SERVICE http://127.0.0.1:$SERVER_PORT_SERVICE/jack <<< "+ $JACK_OUT $JACK_ERR $JACK_CLI") + HTTP_CODE=$(curl --fail --silent --data @- --output "$JACK_EXIT" --write-out %{http_code} --connect-timeout 5 --no-proxy 127.0.0.1:$SERVER_PORT_SERVICE http://127.0.0.1:$SERVER_PORT_SERVICE/jack/$PROTOCOLE_VERSION/$NEEDED_VERSION <<< "+ $JACK_OUT $JACK_ERR $JACK_CLI") CURL_CODE=$? JACK_CODE=$(cat "$JACK_EXIT") if [ $CURL_CODE -eq 0 ]; then @@ -157,6 +160,10 @@ while true; do # 400: Bad request echo "Bad request, see server log ($SERVER_LOG)" >&2 abort + elif [ $HTTP_CODE -eq 501 ]; then + # 501: Not implemented + echo "Jack version not available, try to shutdown server (jack-admin stop-server)" >&2 + abort else # Other echo "Internal unknown error ($HTTP_CODE), try other ports in ~/.jack, or see server log ($SERVER_LOG)" >&2 diff --git a/jack/etc/jack-admin b/jack/etc/jack-admin index c3a00071..0d4546a6 100755 --- a/jack/etc/jack-admin +++ b/jack/etc/jack-admin @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# v 1.1-a11 +# v 1.1-a11 (2-12) # set -o nounset umask 077 |