You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2015/04/24 17:20:31 UTC
[01/25] qpid-proton git commit: removed incomplete go binding
Repository: qpid-proton
Updated Branches:
refs/heads/0.9.x [created] ee4b6e399
removed incomplete go binding
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/e0671e7b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/e0671e7b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/e0671e7b
Branch: refs/heads/0.9.x
Commit: e0671e7bd61975d42fcd0bd24f47a8067daae637
Parents: 0b4e9ba
Author: Rafael Schloming <rh...@alum.mit.edu>
Authored: Tue Mar 10 00:37:22 2015 +1300
Committer: Rafael Schloming <rh...@alum.mit.edu>
Committed: Tue Mar 10 00:37:22 2015 +1300
----------------------------------------------------------------------
proton-c/bindings/go/README.md | 133 ------------
proton-c/bindings/go/WARNING_EXPERIMENTAL | 1 -
.../bindings/go/src/apache.org/proton/doc.go | 33 ---
.../go/src/apache.org/proton/encoding.go | 216 -------------------
.../bindings/go/src/apache.org/proton/error.go | 91 --------
.../go/src/apache.org/proton/interop_test.go | 121 -----------
.../bindings/go/src/apache.org/proton/types.go | 25 ---
.../bindings/go/src/apache.org/proton/url.go | 96 ---------
.../go/src/apache.org/proton/url_test.go | 51 -----
9 files changed, 767 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e0671e7b/proton-c/bindings/go/README.md
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/README.md b/proton-c/bindings/go/README.md
deleted file mode 100644
index 31bdb5d..0000000
--- a/proton-c/bindings/go/README.md
+++ /dev/null
@@ -1,133 +0,0 @@
-# *EXPERIMENTAL* Go binding for proton
-
-This is the beginning of a [Go](http://golang.org) binding for proton.
-
-This work is in very early *experimental* stages, *everything* might change in
-future. Comments and contributions are strongly encouraged, this experiment is
-public so early feedback can guide development.
-
-- Email <pr...@qpid.apache.org>
-- Create issues <https://issues.apache.org/jira/browse/PROTON>, attach patches to an issue.
-
-## Goals
-
-The API will be inspired by the reactive, event-driven python API. Key features:
-
-- support client and server development.
-- incremental composition of functionality via handlers.
-- default handlers to make simple tasks simple.
-- deep access to AMQP protocol events when that is required.
-
-The API will be idiomatic, unsurprising, and easy to use for Go developers.
-
-There are two types of developer we want to support
-
-1. For Go developers using AMQP as a message transport:
- - Straightforward conversions between Go built-in types and AMQP types.
- - Easy message exchange via Go channels to support use in goroutines.
-
-2. For AMQP-aware developers using Go as an implementation language:
- - Go types to exactly represent all AMQP types and encoding details.
- - Full access to AMQP concepts like connections, sessions and links via handler interfaces.
-
-We will follow conventions of the C and python API where possible to help
-cross-language developers but idiomatic Go is the overriding consideration.
-
-## Status
-
-So just a simple Go `Url` type using `pn_url_t`. This establishes the basics of
-using cgo to call into proton code.
-
-## Layout
-
-This directory is a [Go work-space](http://golang.org/doc/code.html), it is not
-yet connected to the rest of the proton build.
-
-To experiment, install proton in a standard place or set these environment
-variables: `PATH`, `C_INCLUDE_PATH`, `LIBRARY_PATH` and `LD_LIBRARY_PATH`.
-
-Add this directory to `GOPATH` for the Go tools.
-
-To see the docs as text:
-
- godoc apache.org/proton
-
-To see them in your browser run this in the background and open
-http://localhost:6060 in your browser:
-
- godoc -http=:6060 -index=true&
-
-Click "Packages" and "proton" to see the proton docs. It takes a minute or two
-to generate the index so search may not work immediately.
-
-To run the unit tests:
-
- go test -a apache.org/proton
-
-## New to Go?
-
-If you are new to Go then these are a good place to start:
-
-- [A Tour of Go](http://tour.golang.org)
-- [Effective Go](http://golang.org/doc/effective_go.html)
-
-Then look at the tools and library docs at <http://golang.org> as you need them.
-
-## Design Notes
-
-### C wrapping philosophy
-
-We use `cgo` to call proton C functions directly. `cgo` is simpler and more
-direct than Swig and integrated into the Go tools.
-
-Calling C directly from Go is so easy that we will avoid low-level 1-1 wrappers
-for proton objects and focus on easy to use Go types that live within Go's
-automatic memory management.
-
-Programmers that need lower-level access than we provide can go direct to C, but
-of course we will aim to make that unnecessary in all but the most unusual cases.
-
-### Other considerations
-
-Go's use of channels for synchronization present interesting opportunities. Go
-also supports traditional locking, so we could adopt locking strategies similar
-to our other bindings, but we should investigate the Go-like alternatives. There
-are analogies between Go channels and AMQP links that we will probably exploit.
-
-## Implementation status
-
-Working on API to marshal/unmarshal AMQP data into Go types.
-
-The API will follow the style of the standard libraries encoding/json and encoding/xml.
-
-To be done:
-
-Easy unmarshaling into native Go types:
-
-- String-like AMQP types (symbol, binary, string) into Go string or []byte
-- Numeric AMQP types into any Go numeric (numeric conversion)
-- Any AMQP type into GO reflect.Value choosing the closest native Go type
-- AMQP map into go struct if keys match struct field names and values match field types
-- AMQP maps into map[K]T if all AMQP keys/values can convert to K and T (reflect.Value allowed)
-- AMQP list into []T if all list elements can convert to T (reflect.Value allowed)
-
-Easy marshaling of native Go types:
-
-- Go struct: amqp map with field names as string keys (use tags to customize?)
-- Go string to AMQP string, Go []byte to AMQP binary, Go numerics to closest AMQP numeric
-- Go []T to AMQP list
-- Go map to AMQP map
-
-Customization:
-
-- Standard encoding libraries define Marshaler and Unmarshaler interfaces.
-- User implements to customize behavior of a user type.
-- Does this require exposing the proton codec?
-
-Exact (strict) (un)marshaling:
-
-- Define special Go AMQP types that exactly reflect AMQP types & encodings.
-- Unmarshal to special types only if exact match for wire
-- Marshal special types exactly
-- Define AMQPValue which can unmarshal from any AMQP type using strict unmarshaling types.
-
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e0671e7b/proton-c/bindings/go/WARNING_EXPERIMENTAL
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/WARNING_EXPERIMENTAL b/proton-c/bindings/go/WARNING_EXPERIMENTAL
deleted file mode 100644
index 96dc92f..0000000
--- a/proton-c/bindings/go/WARNING_EXPERIMENTAL
+++ /dev/null
@@ -1 +0,0 @@
-See README.md
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e0671e7b/proton-c/bindings/go/src/apache.org/proton/doc.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/apache.org/proton/doc.go b/proton-c/bindings/go/src/apache.org/proton/doc.go
deleted file mode 100644
index 34f85fe..0000000
--- a/proton-c/bindings/go/src/apache.org/proton/doc.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-/*
-Package proton is a Go binding for the proton AMQP protocol engine.
-
-It alows you to construct and parse AMQP messages, and to implement AMQP
-clients, servers and intermediaries that can exchange messages with any
-AMQP 1.0 compliant endpoint.
-
-Encoding and decoding AMQP data follows the pattern of the standard
-encoding/json and encoding/xml packages.The mapping between AMQP and Go types is
-described in the documentation of the Marshal and Unmarshal functions.
-*/
-package proton
-
-// This file is just for the package comment.
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e0671e7b/proton-c/bindings/go/src/apache.org/proton/encoding.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/apache.org/proton/encoding.go b/proton-c/bindings/go/src/apache.org/proton/encoding.go
deleted file mode 100644
index eb42c8c..0000000
--- a/proton-c/bindings/go/src/apache.org/proton/encoding.go
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-//#include <proton/codec.h>
-import "C"
-
-import (
- "bytes"
- "io"
- "reflect"
- "unsafe"
-)
-
-//
-// Decoding from a pn_data_t
-//
-
-type pnDecoder struct{ data *C.pn_data_t }
-
-func newPnDecoder() pnDecoder { return pnDecoder{C.pn_data(0)} }
-func (pd pnDecoder) free() { C.pn_data_free((*C.pn_data_t)(pd.data)) }
-
-// decode from bytes. Return bytes decoded and errEOS if we run out of data.
-func (pd pnDecoder) decode(bytes []byte) (n int, err error) {
- C.pn_data_clear(pd.data)
- if len(bytes) == 0 {
- return 0, errEOS
- }
- cBuf := (*C.char)(unsafe.Pointer(&bytes[0]))
- result := int(C.pn_data_decode(pd.data, cBuf, C.size_t(len(bytes))))
- if result < 0 {
- return 0, errorCode(result)
- } else {
- return result, nil
- }
-}
-
-// Unmarshal decodes bytes and converts into the value pointed to by v.
-//
-// Returns the number of bytes decoded and an errorCode on error.
-func (pd pnDecoder) unmarshal(bytes []byte, v interface{}) (n int, err error) {
- n, err = pd.decode(bytes)
- if err != nil {
- return
- }
- switch v := v.(type) {
- case *string:
- err = pd.unmarshalString(v)
- case *[]byte:
- err = pd.unmarshalBytes(v)
- case *Symbol:
- err = pd.unmarshalSymbol(v)
- default:
- note := ""
- if reflect.TypeOf(v).Kind() != reflect.Ptr {
- note = "is not a pointer"
- }
- return 0, errorf("Unmarshal bad type: %T %s", v, note)
- // FIXME aconway 2015-03-02: not finished
- }
- if err != nil {
- return 0, err
- }
- return
-}
-
-func (pd pnDecoder) unmarshalPnBytes(target string) (pnBytes C.pn_bytes_t, err error) {
- switch amqpType := C.pn_data_type(pd.data); amqpType {
- case C.PN_STRING:
- pnBytes = C.pn_data_get_string(pd.data)
- case C.PN_BINARY:
- pnBytes = C.pn_data_get_binary(pd.data)
- case C.PN_SYMBOL:
- pnBytes = C.pn_data_get_symbol(pd.data)
- default:
- // FIXME aconway 2015-03-02: error message - json style UnmarsalTypeError?
- return C.pn_bytes_t{}, errorf("Unmarshal cannot convert %#v to %s", amqpType, target)
- }
- return pnBytes, nil
-}
-
-func (pd pnDecoder) unmarshalString(v *string) error {
- pnBytes, err := pd.unmarshalPnBytes("string")
- if err == nil {
- *v = C.GoStringN(pnBytes.start, C.int(pnBytes.size))
- }
- return err
-}
-
-func (pd pnDecoder) unmarshalBytes(v *[]byte) error {
- pnBytes, err := pd.unmarshalPnBytes("[]byte")
- *v = C.GoBytes(unsafe.Pointer(pnBytes.start), C.int(pnBytes.size))
- return err
-}
-
-func (pd pnDecoder) unmarshalSymbol(v *Symbol) error {
- pnBytes, err := pd.unmarshalPnBytes("symbol")
- if err == nil {
- *v = Symbol(C.GoStringN(pnBytes.start, C.int(pnBytes.size)))
- }
- return err
-}
-
-/*
-Unmarshal decodes AMQP-encoded bytes and stores the result in the value pointed to by v.
-
-FIXME mapping details
-
- +-------------------------------+-----------------------------------------------+
- |AMQP type |Go type |
- +-------------------------------+-----------------------------------------------+
- |string |string |
- +-------------------------------+-----------------------------------------------+
- |symbol |proton.Symbol |
- +-------------------------------+-----------------------------------------------+
- |binary |[]byte |
- +-------------------------------+-----------------------------------------------+
-*/
-func Unmarshal(bytes []byte, v interface{}) error {
- pd := newPnDecoder()
- defer pd.free()
- _, err := pd.unmarshal(bytes, v)
- return err
-}
-
-// Decoder decodes AMQP values from an io.Reader.
-//
-type Decoder struct {
- reader io.Reader
- buffer bytes.Buffer
- readErr error // Outstanding error on our reader
-}
-
-// NewDecoder returns a new decoder that reads from r.
-//
-// The decoder has it's own buffer and may read more data than required for the
-// AMQP values requested. Use Buffered to see if there is data left in the
-// buffer.
-//
-func NewDecoder(r io.Reader) *Decoder {
- return &Decoder{r, bytes.Buffer{}, nil}
-}
-
-// Buffered returns a reader of the data remaining in the Decoder's buffer. The
-// reader is valid until the next call to Decode.
-//
-func (d *Decoder) Buffered() io.Reader {
- return bytes.NewReader(d.buffer.Bytes())
-}
-
-// more reads more data when we can't parse a complete AMQP type
-func (d *Decoder) more() error {
- if d.readErr != nil { // Reader already broken, give up
- return d.readErr
- }
- var readSize int64 = 256
- if int64(d.buffer.Len()) > readSize { // Grow by doubling
- readSize = int64(d.buffer.Len())
- }
- var n int64
- n, d.readErr = d.buffer.ReadFrom(&io.LimitedReader{d.reader, readSize})
- if n == 0 { // ReadFrom won't report io.EOF, just returns 0
- if d.readErr != nil {
- return d.readErr
- } else {
- return errorf("no data")
- }
- }
- return nil
-}
-
-// Decode reads the next AMQP value from the Reader and stores it in the value pointed to by v.
-//
-// See the documentation for Unmarshal for details about the conversion of AMQP into a Go value.
-//
-func (d *Decoder) Decode(v interface{}) (err error) {
- pd := newPnDecoder()
- defer pd.free()
-
- // On errEOS, read more data and try again till we have a complete pn_data.
- for {
- var n int
- n, err = pd.unmarshal(d.buffer.Bytes(), v)
- switch err {
- case nil:
- d.buffer.Next(n)
- return
- case errEOS:
- err = d.more()
- if err != nil {
- return err
- }
- default:
- return err
- }
- }
- return err
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e0671e7b/proton-c/bindings/go/src/apache.org/proton/error.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/apache.org/proton/error.go b/proton-c/bindings/go/src/apache.org/proton/error.go
deleted file mode 100644
index 51cde28..0000000
--- a/proton-c/bindings/go/src/apache.org/proton/error.go
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-// #include <proton/error.h>
-import "C"
-
-import (
- "fmt"
-)
-
-// errorCode is an error code returned by proton C.
-type errorCode int
-
-const (
- errEOS errorCode = C.PN_EOS
- errError = C.PN_ERR
- errOverflow = C.PN_OVERFLOW
- errUnderflow = C.PN_UNDERFLOW
- errState = C.PN_STATE_ERR
- errArgument = C.PN_ARG_ERR
- errTimeout = C.PN_TIMEOUT
- errInterrupted = C.PN_INTR
- errInProgress = C.PN_INPROGRESS
-)
-
-// String gives a brief description of an errorCode.
-func (code errorCode) String() string {
- switch code {
- case errEOS:
- return "end of data"
- case errError:
- return "error"
- case errOverflow:
- return "overflow"
- case errUnderflow:
- return "underflow"
- case errState:
- return "bad state"
- case errArgument:
- return "invalid argument"
- case errTimeout:
- return "timeout"
- case errInterrupted:
- return "interrupted"
- case errInProgress:
- return "in progress"
- }
- return fmt.Sprintf("invalid error code %d", code)
-}
-
-// An errorCode can be used as an error
-func (code errorCode) Error() string {
- return fmt.Sprintf("proton: %v", code)
-}
-
-// pnError is a simple error string.
-//
-// NOTE: All error types used in proton have both String() and Error() methods.
-// The String() method prints the plain error message, the Error() method
-// prints the error message with a "proton:" prefix.
-// Thus you can format nested error messages with "%s" without getting nested "proton:"
-// prefixes but the prefix will be added when the end user uses Error()
-// or "%v" on the error value.
-//
-type pnError string
-
-func (err pnError) String() string { return string(err) }
-func (err pnError) Error() string { return fmt.Sprintf("proton: %s", string(err)) }
-
-// errorf creates an error with a formatted message
-func errorf(format string, a ...interface{}) error {
- return pnError(fmt.Sprintf(format, a...))
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e0671e7b/proton-c/bindings/go/src/apache.org/proton/interop_test.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/apache.org/proton/interop_test.go b/proton-c/bindings/go/src/apache.org/proton/interop_test.go
deleted file mode 100644
index db988d2..0000000
--- a/proton-c/bindings/go/src/apache.org/proton/interop_test.go
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-// Test that conversion of Go type to/from AMQP is compatible with other
-// bindings.
-//
-// FIXME aconway 2015-03-01: this should move to proton/tests/go when we integrate
-// better with the proton build system.
-//
-package proton
-
-import (
- "fmt"
- "io"
- "io/ioutil"
- "os"
- "reflect"
- "testing"
-)
-
-func getReader(t *testing.T, name string) (r io.Reader) {
- r, err := os.Open("../../../../../../tests/interop/" + name + ".amqp")
- if err != nil {
- t.Fatalf("Can't open %#v: %v", name, err)
- }
- return
-}
-
-func remaining(d *Decoder) string {
- remainder, _ := ioutil.ReadAll(io.MultiReader(d.Buffered(), d.reader))
- return string(remainder)
-}
-
-// Expectation of a test, want is the expected value, got is a pointer to a
-// instance of the same type, which will be replaced by Decode.
-type expect struct {
- want, got interface{}
-}
-
-// checkDecode: want is the expected value, gotPtr is a pointer to a
-// instance of the same type for Decode.
-func checkDecode(d *Decoder, want interface{}, gotPtr interface{}) error {
- err := d.Decode(gotPtr)
- if err != nil {
- return err
- }
- got := reflect.ValueOf(gotPtr).Elem().Interface()
- if !reflect.DeepEqual(want, got) {
- return fmt.Errorf("%#v != %#v", want, got)
- }
- return nil
-}
-
-func TestUnmarshal(t *testing.T) {
- bytes, err := ioutil.ReadAll(getReader(t, "strings"))
- if err != nil {
- t.Error(err)
- }
- var got string
- err = Unmarshal(bytes, &got)
- if err != nil {
- t.Error(err)
- }
- want := "abc\000defg"
- if want != got {
- t.Errorf("%#v != %#v", want, got)
- }
-}
-
-func TestStrings(t *testing.T) {
- d := NewDecoder(getReader(t, "strings"))
- // Test decoding as plain Go strings
- for i, want := range []string{"abc\000defg", "abcdefg", "abcdefg", "", "", ""} {
- var got string
- if err := checkDecode(d, want, &got); err != nil {
- t.Errorf("%d: %v", i, err)
- }
- }
- remains := remaining(d)
- if remains != "" {
- t.Errorf("leftover: %s", remains)
- }
-
- // Test decoding as specific string types
- d = NewDecoder(getReader(t, "strings"))
- var bytes []byte
- var str string
- var sym Symbol
- for i, expect := range []expect{
- {[]byte("abc\000defg"), &bytes},
- {"abcdefg", &str},
- {Symbol("abcdefg"), &sym},
- {make([]byte, 0), &bytes},
- {"", &str},
- {Symbol(""), &sym},
- } {
- if err := checkDecode(d, expect.want, expect.got); err != nil {
- t.Errorf("%d: %v", i, err)
- }
- }
- remains = remaining(d)
- if remains != "" {
- t.Errorf("leftover: %s", remains)
- }
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e0671e7b/proton-c/bindings/go/src/apache.org/proton/types.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/apache.org/proton/types.go b/proton-c/bindings/go/src/apache.org/proton/types.go
deleted file mode 100644
index bde1ddd..0000000
--- a/proton-c/bindings/go/src/apache.org/proton/types.go
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-// Types to exactly represent specific AMQP encodings
-
-// Symbol is the AMQP symbol data type, it can be converted to a Go string or []byte
-type Symbol string
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e0671e7b/proton-c/bindings/go/src/apache.org/proton/url.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/apache.org/proton/url.go b/proton-c/bindings/go/src/apache.org/proton/url.go
deleted file mode 100644
index 1511203..0000000
--- a/proton-c/bindings/go/src/apache.org/proton/url.go
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-/*
-#cgo LDFLAGS: -lqpid-proton
-#include <stdlib.h>
-#include <string.h>
-#include <proton/url.h>
-
-// Helper function for setting URL fields.
-typedef void (*setter_fn)(pn_url_t* url, const char* value);
-inline void set(pn_url_t *url, setter_fn s, const char* value) {
- s(url, value);
-}
-*/
-import "C"
-
-import (
- "net"
- "net/url"
- "unsafe"
-)
-
-const (
- AMQP string = "amqp"
- AMQPS = "amqps"
-)
-
-// ParseUrl parses an AMQP URL string and returns a net/url.Url.
-//
-// It is more forgiving than net/url.Parse and allows most of the parts of the
-// URL to be missing, assuming AMQP defaults.
-//
-func ParseURL(s string) (u *url.URL, err error) {
- cstr := C.CString(s)
- defer C.free(unsafe.Pointer(cstr))
- pnUrl := C.pn_url_parse(cstr)
- if pnUrl == nil {
- return nil, errorf("bad URL %#v", s)
- }
- defer C.pn_url_free(pnUrl)
-
- scheme := C.GoString(C.pn_url_get_scheme(pnUrl))
- username := C.GoString(C.pn_url_get_username(pnUrl))
- password := C.GoString(C.pn_url_get_password(pnUrl))
- host := C.GoString(C.pn_url_get_host(pnUrl))
- port := C.GoString(C.pn_url_get_port(pnUrl))
- path := C.GoString(C.pn_url_get_path(pnUrl))
-
- if err != nil {
- return nil, errorf("bad URL %#v: %s", s, err)
- }
- if scheme == "" {
- scheme = AMQP
- }
- if port == "" {
- if scheme == AMQPS {
- port = AMQPS
- } else {
- port = AMQP
- }
- }
- var user *url.Userinfo
- if password != "" {
- user = url.UserPassword(username, password)
- } else if username != "" {
- user = url.User(username)
- }
-
- u = &url.URL{
- Scheme: scheme,
- User: user,
- Host: net.JoinHostPort(host, port),
- Path: path,
- }
-
- return u, nil
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e0671e7b/proton-c/bindings/go/src/apache.org/proton/url_test.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/apache.org/proton/url_test.go b/proton-c/bindings/go/src/apache.org/proton/url_test.go
deleted file mode 100644
index 7315511..0000000
--- a/proton-c/bindings/go/src/apache.org/proton/url_test.go
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-import (
- "fmt"
-)
-
-func ExampleParseURL() {
- for _, s := range []string{
- "amqp://username:password@host:1234/path",
- "host:1234",
- "host",
- ":1234",
- "host/path",
- "amqps://host",
- "",
- } {
- u, err := ParseURL(s)
- if err != nil {
- fmt.Println(err)
- } else {
- fmt.Println(u)
- }
- }
- // Output:
- // amqp://username:password@host:1234/path
- // amqp://host:1234
- // amqp://host:amqp
- // amqp://:1234
- // amqp://host:amqp/path
- // amqps://host:amqps
- // proton: bad URL ""
-}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[04/25] qpid-proton git commit: NO-JIRA: lack of ssl support should
not prevent Container being used
Posted by ro...@apache.org.
NO-JIRA: lack of ssl support should not prevent Container being used
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/59efe4f6
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/59efe4f6
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/59efe4f6
Branch: refs/heads/0.9.x
Commit: 59efe4f6b2ea597332a2191665c498dbf44b8bd8
Parents: 27851bb
Author: Gordon Sim <gs...@redhat.com>
Authored: Mon Mar 9 14:37:35 2015 +0000
Committer: Gordon Sim <gs...@redhat.com>
Committed: Mon Mar 9 20:05:57 2015 +0000
----------------------------------------------------------------------
proton-c/bindings/python/proton/reactor.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/59efe4f6/proton-c/bindings/python/proton/reactor.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/reactor.py b/proton-c/bindings/python/proton/reactor.py
index 0c59ff9..4fda15c 100644
--- a/proton-c/bindings/python/proton/reactor.py
+++ b/proton-c/bindings/python/proton/reactor.py
@@ -585,7 +585,10 @@ class Container(Reactor):
def __init__(self, *handlers, **kwargs):
super(Container, self).__init__(*handlers, **kwargs)
if "impl" not in kwargs:
- self.ssl = SSLConfig()
+ try:
+ self.ssl = SSLConfig()
+ except SSLUnavailable:
+ self.ssl = None
self.global_handler = GlobalOverrides(kwargs.get('global_handler', self.global_handler))
self.trigger = None
self.container_id = str(generate_uuid())
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[02/25] qpid-proton git commit: NO-JIRA: fix documentation build
Posted by ro...@apache.org.
NO-JIRA: fix documentation build
(cherry picked from commit bc2b630eb969710b04a861797567ab2dc368020a)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/77403b3c
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/77403b3c
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/77403b3c
Branch: refs/heads/0.9.x
Commit: 77403b3c091b2c6dfcc766d978130a34f765ee29
Parents: e0671e7
Author: Ken Giusti <kg...@apache.org>
Authored: Mon Mar 9 13:38:56 2015 -0400
Committer: Ken Giusti <kg...@apache.org>
Committed: Mon Mar 9 15:20:02 2015 -0400
----------------------------------------------------------------------
proton-c/bindings/python/CMakeLists.txt | 5 ++++-
proton-c/bindings/python/proton/__init__.py | 2 +-
proton-c/bindings/python/proton/utils.py | 7 +++----
3 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/77403b3c/proton-c/bindings/python/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/CMakeLists.txt b/proton-c/bindings/python/CMakeLists.txt
index 7f54033..2886326 100644
--- a/proton-c/bindings/python/CMakeLists.txt
+++ b/proton-c/bindings/python/CMakeLists.txt
@@ -80,10 +80,13 @@ py_compile(${CMAKE_CURRENT_SOURCE_DIR} "${pysrc}" PROTON_ARTIFACTS)
find_program(EPYDOC_EXE epydoc)
mark_as_advanced (EPYDOC_EXE)
if (EPYDOC_EXE)
+ foreach (py_src_doc ${pysrc})
+ list(APPEND PY_DOC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${py_src_doc}")
+ endforeach(py_src_doc)
add_custom_target(docs-py COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../../env.py --
PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_SOURCE_DIR}
${EPYDOC_EXE} -v --no-private --html -o ${CMAKE_CURRENT_BINARY_DIR}/html
- ${CMAKE_CURRENT_SOURCE_DIR}/${pysrc})
+ ${PY_DOC_FILES})
add_dependencies(docs docs-py)
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html/"
DESTINATION "${PROTON_SHARE}/docs/api-py"
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/77403b3c/proton-c/bindings/python/proton/__init__.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/__init__.py b/proton-c/bindings/python/proton/__init__.py
index c200e9c..d69d3dc 100644
--- a/proton-c/bindings/python/proton/__init__.py
+++ b/proton-c/bindings/python/proton/__init__.py
@@ -3778,7 +3778,7 @@ class Url(object):
"""
Simple URL parser/constructor, handles URLs of the form:
- <scheme>://<user>:<password>@<host>:<port>/<path>
+ <scheme>://<user>:<password>@<host>:<port>/<path>
All components can be None if not specifeid in the URL string.
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/77403b3c/proton-c/bindings/python/proton/utils.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/utils.py b/proton-c/bindings/python/proton/utils.py
index fabe887..b5ecdf7 100644
--- a/proton-c/bindings/python/proton/utils.py
+++ b/proton-c/bindings/python/proton/utils.py
@@ -277,6 +277,8 @@ class AtomicCount(object):
class SyncRequestResponse(IncomingMessageHandler):
"""
Implementation of the synchronous request-responce (aka RPC) pattern.
+ @ivar address: Address for all requests, may be None.
+ @ivar connection: Connection for requests and responses.
"""
correlation_id = AtomicCount()
@@ -290,9 +292,6 @@ class SyncRequestResponse(IncomingMessageHandler):
@param address: Address for all requests.
If not specified, each request must have the address property set.
Sucessive messages may have different addresses.
-
- @ivar address: Address for all requests, may be None.
- @ivar connection: Connection for requests and responses.
"""
super(SyncRequestResponse, self).__init__()
self.connection = connection
@@ -308,7 +307,7 @@ class SyncRequestResponse(IncomingMessageHandler):
Send a request message, wait for and return the response message.
@param request: A L{proton.Message}. If L{self.address} is not set the
- L{request.address} must be set and will be used.
+ L{self.address} must be set and will be used.
"""
if not self.address and not request.address:
raise ValueError("Request message has no address: %s" % request)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[03/25] qpid-proton git commit: add missing NOTICE file
Posted by ro...@apache.org.
add missing NOTICE file
cherry-picked from 36e32d2309bb0a96e63e9874758de8906a22ec69
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/27851bbb
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/27851bbb
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/27851bbb
Branch: refs/heads/0.9.x
Commit: 27851bbbba6d979342178817734423b83b37840a
Parents: 77403b3
Author: Robert Gemmell <ro...@apache.org>
Authored: Mon Mar 9 19:36:06 2015 +0000
Committer: Robert Gemmell <ro...@apache.org>
Committed: Mon Mar 9 19:38:10 2015 +0000
----------------------------------------------------------------------
NOTICE | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/27851bbb/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..ffeab71
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,5 @@
+Apache Qpid Proton
+Copyright 2012-2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[05/25] qpid-proton git commit: PROTON-836: Missing import
SSLUnavailable in reactor.py.
Posted by ro...@apache.org.
PROTON-836: Missing import SSLUnavailable in reactor.py.
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/ea01c014
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/ea01c014
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/ea01c014
Branch: refs/heads/0.9.x
Commit: ea01c014fedd8dff134131f93b7d957aabac70ec
Parents: 59efe4f
Author: Alan Conway <ac...@redhat.com>
Authored: Wed Mar 11 11:17:23 2015 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Wed Mar 11 11:30:04 2015 -0400
----------------------------------------------------------------------
proton-c/bindings/python/proton/reactor.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ea01c014/proton-c/bindings/python/proton/reactor.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/reactor.py b/proton-c/bindings/python/proton/reactor.py
index 4fda15c..41b7372 100644
--- a/proton-c/bindings/python/proton/reactor.py
+++ b/proton-c/bindings/python/proton/reactor.py
@@ -20,7 +20,7 @@ import logging, os, Queue, socket, time, types
from heapq import heappush, heappop, nsmallest
from proton import Collector, Connection, ConnectionException, Delivery, Described, dispatch
from proton import Endpoint, Event, EventBase, EventType, generate_uuid, Handler, Link, Message
-from proton import ProtonException, PN_ACCEPTED, PN_PYREF, SASL, Session, SSL, SSLDomain, symbol
+from proton import ProtonException, PN_ACCEPTED, PN_PYREF, SASL, Session, SSL, SSLDomain, SSLUnavailable, symbol
from proton import Terminus, Timeout, Transport, TransportException, ulong, Url
from select import select
from proton.handlers import OutgoingMessageHandler
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[17/25] qpid-proton git commit:
https://issues.apache.org/jira/browse/PROTON-845
Posted by ro...@apache.org.
https://issues.apache.org/jira/browse/PROTON-845
Check for no Headers object and create one as needed.
(cherry picked from commit b541ad08805e5567bfe8279650a674163c46cb8d)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/b6fc285c
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/b6fc285c
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/b6fc285c
Branch: refs/heads/0.9.x
Commit: b6fc285c3a7bd1bf0575c78fee40d35168f9acf8
Parents: c3364ef
Author: Timothy Bish <ta...@gmail.com>
Authored: Mon Apr 6 17:06:59 2015 -0400
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 15:44:52 2015 +0100
----------------------------------------------------------------------
.../apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b6fc285c/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java
----------------------------------------------------------------------
diff --git a/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java b/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java
index 8245fb8..7dc71d7 100644
--- a/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java
+++ b/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java
@@ -20,11 +20,13 @@ import org.apache.qpid.proton.codec.CompositeWritableBuffer;
import org.apache.qpid.proton.codec.DroppingWritableBuffer;
import org.apache.qpid.proton.codec.WritableBuffer;
import org.apache.qpid.proton.amqp.UnsignedInteger;
+import org.apache.qpid.proton.amqp.messaging.Header;
import javax.jms.BytesMessage;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageFormatException;
+
import java.nio.ByteBuffer;
import org.apache.qpid.proton.message.ProtonJMessage;
@@ -83,6 +85,10 @@ public class AMQPNativeOutboundTransformer extends OutboundTransformer {
// Update the DeliveryCount header...
// The AMQP delivery-count field only includes prior failed delivery attempts,
// whereas JMSXDeliveryCount includes the first/current delivery attempt. Subtract 1.
+ if (amqp.getHeader() == null) {
+ amqp.setHeader(new Header());
+ }
+
amqp.getHeader().setDeliveryCount(new UnsignedInteger(count - 1));
// Re-encode...
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[13/25] qpid-proton git commit: PROTON-843: Java should match C for
idle timeout
Posted by ro...@apache.org.
PROTON-843: Java should match C for idle timeout
As discussed on the mailing list. Currently proton-j advertises a
provided local idle timeout value as-is, whereas proton-c will halve it
before sending it to the remote side. The two implementations should
match in behaviour.
Closes #15
(cherry picked from commit 0b439c16e72560d575bce67e5a4300d1ea89ef52)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/50ab1436
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/50ab1436
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/50ab1436
Branch: refs/heads/0.9.x
Commit: 50ab143680918f3a812cf529526459ecb6c617f1
Parents: 56101ee
Author: Dominic Evans <do...@uk.ibm.com>
Authored: Thu Apr 2 18:47:14 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 15:42:55 2015 +0100
----------------------------------------------------------------------
.../java/org/apache/qpid/proton/engine/impl/TransportImpl.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/50ab1436/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
index 852489a..b866ca8 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
@@ -798,8 +798,11 @@ public class TransportImpl extends EndpointImpl
if (_channelMax > 0) {
open.setChannelMax(UnsignedShort.valueOf((short) _channelMax));
}
+
+ // as per the recommendation in the spec, advertise half our
+ // actual timeout to the remote
if (_localIdleTimeout > 0) {
- open.setIdleTimeOut(new UnsignedInteger(_localIdleTimeout));
+ open.setIdleTimeOut(new UnsignedInteger(_localIdleTimeout / 2));
}
_isOpenSent = true;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[07/25] qpid-proton git commit: PROTON-839: Proton 0.9 RC 2 blocker -
proton_tests.utils.SyncRequestResponseTest.test_request_response ........
fail
Posted by ro...@apache.org.
PROTON-839: Proton 0.9 RC 2 blocker - proton_tests.utils.SyncRequestResponseTest.test_request_response ........ fail
Fix to reactor.py, check for lack of SSL domain.
(cherry picked from commit e31df015a79d791e62caf9bef3f29bdfd77042ef)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/c2042d7d
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/c2042d7d
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/c2042d7d
Branch: refs/heads/0.9.x
Commit: c2042d7d26c4383047dac2709d1a2effe0b11419
Parents: 0fbe80e
Author: Alan Conway <ac...@redhat.com>
Authored: Mon Mar 16 09:51:28 2015 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Mon Mar 16 10:00:02 2015 -0400
----------------------------------------------------------------------
proton-c/bindings/python/proton/reactor.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c2042d7d/proton-c/bindings/python/proton/reactor.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/reactor.py b/proton-c/bindings/python/proton/reactor.py
index 41b7372..f95bd16 100644
--- a/proton-c/bindings/python/proton/reactor.py
+++ b/proton-c/bindings/python/proton/reactor.py
@@ -613,7 +613,7 @@ class Container(Reactor):
connector.reconnect = reconnect
elif reconnect is None:
connector.reconnect = Backoff()
- connector.ssl_domain = ssl_domain or self.ssl.client
+ connector.ssl_domain = ssl_domain or (self.ssl and self.ssl.client)
conn._session_policy = SessionPerConnection() #todo: make configurable
conn.open()
return conn
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[24/25] qpid-proton git commit: PROTON-857: use maps to track handle
usage, avoid pre-allocating large arrays we typically wont utilise fully
Posted by ro...@apache.org.
PROTON-857: use maps to track handle usage, avoid pre-allocating large arrays we typically wont utilise fully
Also reduces handle-max to 65535, giving 65536 usable handles like proton-c currently has.
(cherry picked from commit 74e16dfe00f21621e8dbc27cea41ae12ad9a66c7)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/aef2fafe
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/aef2fafe
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/aef2fafe
Branch: refs/heads/0.9.x
Commit: aef2fafeeaecb2031d928099cfde0315120a241e
Parents: 7fa6807
Author: Robert Gemmell <ro...@apache.org>
Authored: Wed Apr 22 11:22:13 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 15:50:04 2015 +0100
----------------------------------------------------------------------
.../proton/engine/impl/TransportSession.java | 50 +++++++++-----------
1 file changed, 22 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/aef2fafe/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java
index fb537cc..1f4a9f8 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java
@@ -34,20 +34,22 @@ import org.apache.qpid.proton.engine.Event;
class TransportSession
{
+ private static final int HANDLE_MAX = 65535;
+
private final TransportImpl _transport;
private final SessionImpl _session;
private int _localChannel = -1;
private int _remoteChannel = -1;
private boolean _openSent;
- private final UnsignedInteger _handleMax = UnsignedInteger.valueOf(65536);
+ private final UnsignedInteger _handleMax = UnsignedInteger.valueOf(HANDLE_MAX); //TODO: should this be configurable?
private UnsignedInteger _outgoingDeliveryId = UnsignedInteger.ZERO;
private UnsignedInteger _incomingWindowSize = UnsignedInteger.ZERO;
private UnsignedInteger _outgoingWindowSize = UnsignedInteger.ZERO;
private UnsignedInteger _nextOutgoingId = UnsignedInteger.ONE;
private UnsignedInteger _nextIncomingId = null;
- private final TransportLink[] _remoteHandleMap = new TransportLink[_handleMax.intValue() + 1];
- private final TransportLink[] _localHandleMap = new TransportLink[_handleMax.intValue() + 1];
+ private final Map<UnsignedInteger, TransportLink<?>> _remoteHandlesMap = new HashMap<UnsignedInteger, TransportLink<?>>();
+ private final Map<UnsignedInteger, TransportLink<?>> _localHandlesMap = new HashMap<UnsignedInteger, TransportLink<?>>();
private final Map<String, TransportLink> _halfOpenLinks = new HashMap<String, TransportLink>();
@@ -138,15 +140,11 @@ class TransportSession
private void unsetLocalHandles()
{
- for(int i = 0; i < _localHandleMap.length; i++)
+ for (TransportLink<?> tl : _localHandlesMap.values())
{
- TransportLink<?> tl = _localHandleMap[i];
- if(tl != null)
- {
- _localHandleMap[i] = null;
- tl.clearLocalHandle();
- }
+ tl.clearLocalHandle();
}
+ _localHandlesMap.clear();
}
public void unsetRemoteChannel()
@@ -160,15 +158,11 @@ class TransportSession
private void unsetRemoteHandles()
{
- for(int i = 0; i < _remoteHandleMap.length; i++)
+ for (TransportLink<?> tl : _remoteHandlesMap.values())
{
- TransportLink<?> tl = _remoteHandleMap[i];
- if(tl != null)
- {
- _remoteHandleMap[i] = null;
- tl.clearRemoteHandle();
- }
+ tl.clearRemoteHandle();
}
+ _remoteHandlesMap.clear();
}
public UnsignedInteger getHandleMax()
@@ -231,19 +225,19 @@ class TransportSession
public TransportLink getLinkFromRemoteHandle(UnsignedInteger handle)
{
- return _remoteHandleMap[handle.intValue()];
+ return _remoteHandlesMap.get(handle);
}
public UnsignedInteger allocateLocalHandle(TransportLink transportLink)
{
- for(int i = 0; i < _localHandleMap.length; i++)
+ for(int i = 0; i <= HANDLE_MAX; i++)
{
- if(_localHandleMap[i] == null)
+ UnsignedInteger handle = UnsignedInteger.valueOf(i);
+ if(!_localHandlesMap.containsKey(handle))
{
- UnsignedInteger rc = UnsignedInteger.valueOf(i);
- _localHandleMap[i] = transportLink;
- transportLink.setLocalHandle(rc);
- return rc;
+ _localHandlesMap.put(handle, transportLink);
+ transportLink.setLocalHandle(handle);
+ return handle;
}
}
throw new IllegalStateException("no local handle available for allocation");
@@ -251,22 +245,22 @@ class TransportSession
public void addLinkRemoteHandle(TransportLink link, UnsignedInteger remoteHandle)
{
- _remoteHandleMap[remoteHandle.intValue()] = link;
+ _remoteHandlesMap.put(remoteHandle, link);
}
public void addLinkLocalHandle(TransportLink link, UnsignedInteger localhandle)
{
- _localHandleMap[localhandle.intValue()] = link;
+ _localHandlesMap.put(localhandle, link);
}
public void freeLocalHandle(UnsignedInteger handle)
{
- _localHandleMap[handle.intValue()] = null;
+ _localHandlesMap.remove(handle);
}
public void freeRemoteHandle(UnsignedInteger handle)
{
- _remoteHandleMap[handle.intValue()] = null;
+ _remoteHandlesMap.remove(handle);
}
public TransportLink resolveHalfOpenLink(String name)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[10/25] qpid-proton git commit: Release 0.9
Posted by ro...@apache.org.
Release 0.9
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/91b7ef18
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/91b7ef18
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/91b7ef18
Branch: refs/heads/0.9.x
Commit: 91b7ef1858bca2a877b528cfc19c310d7dbe74b7
Parents: bcb7a47
Author: Rafael Schloming <rh...@alum.mit.edu>
Authored: Fri Mar 27 09:58:43 2015 -0400
Committer: Rafael Schloming <rh...@alum.mit.edu>
Committed: Fri Mar 27 09:58:43 2015 -0400
----------------------------------------------------------------------
contrib/proton-hawtdispatch/pom.xml | 2 +-
contrib/proton-jms/pom.xml | 2 +-
examples/java/messenger/pom.xml | 2 +-
pom.xml | 2 +-
proton-j/pom.xml | 2 +-
tests/pom.xml | 2 +-
version.txt | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/91b7ef18/contrib/proton-hawtdispatch/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/proton-hawtdispatch/pom.xml b/contrib/proton-hawtdispatch/pom.xml
index 085b634..02587f1 100644
--- a/contrib/proton-hawtdispatch/pom.xml
+++ b/contrib/proton-hawtdispatch/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>0.9-rc-3</version>
+ <version>0.9</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/91b7ef18/contrib/proton-jms/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/proton-jms/pom.xml b/contrib/proton-jms/pom.xml
index 7048e5c..f1b43cc 100644
--- a/contrib/proton-jms/pom.xml
+++ b/contrib/proton-jms/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>0.9-rc-3</version>
+ <version>0.9</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/91b7ef18/examples/java/messenger/pom.xml
----------------------------------------------------------------------
diff --git a/examples/java/messenger/pom.xml b/examples/java/messenger/pom.xml
index becde12..1449bd0 100644
--- a/examples/java/messenger/pom.xml
+++ b/examples/java/messenger/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>0.9-rc-3</version>
+ <version>0.9</version>
<relativePath>../../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/91b7ef18/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 724b5d9..f27871b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
requiring the latest trunk build can use an unchanging value in their pom.xml.
We will use a more representative version if and when snapshots from multiple
branches are being concurrently produced. -->
- <version>0.9-rc-3</version>
+ <version>0.9</version>
<packaging>pom</packaging>
<properties>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/91b7ef18/proton-j/pom.xml
----------------------------------------------------------------------
diff --git a/proton-j/pom.xml b/proton-j/pom.xml
index e870bb1..4d73948 100644
--- a/proton-j/pom.xml
+++ b/proton-j/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>0.9-rc-3</version>
+ <version>0.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/91b7ef18/tests/pom.xml
----------------------------------------------------------------------
diff --git a/tests/pom.xml b/tests/pom.xml
index f5e1078..54e658f 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>0.9-rc-3</version>
+ <version>0.9</version>
</parent>
<description>The Proton system tests execute against either the Java or the C implementations,
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/91b7ef18/version.txt
----------------------------------------------------------------------
diff --git a/version.txt b/version.txt
index 47b764d..b63ba69 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-0.9-rc-3
+0.9
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[19/25] qpid-proton git commit: PROTON-850: ensure attach updates
correct link object
Posted by ro...@apache.org.
PROTON-850: ensure attach updates correct link object
(cherry picked from commit fd26ec66bcd1fda328ceca119efc43bf787e0bcf)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/1324d972
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/1324d972
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/1324d972
Branch: refs/heads/0.9.x
Commit: 1324d972f28c721a73e217ab9630d2c208e74b07
Parents: 69fc2eb
Author: Gordon Sim <gs...@redhat.com>
Authored: Fri Apr 17 11:41:10 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 15:48:41 2015 +0100
----------------------------------------------------------------------
proton-c/src/transport/transport.c | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1324d972/proton-c/src/transport/transport.c
----------------------------------------------------------------------
diff --git a/proton-c/src/transport/transport.c b/proton-c/src/transport/transport.c
index 8b36389..10ac8fb 100644
--- a/proton-c/src/transport/transport.c
+++ b/proton-c/src/transport/transport.c
@@ -1078,6 +1078,11 @@ pn_link_t *pn_find_link(pn_session_t *ssn, pn_bytes_t name, bool is_sender)
{
pn_link_t *link = (pn_link_t *) pn_list_get(ssn->links, i);
if (link->endpoint.type == type &&
+ // This function is used to locate the link object for an
+ // incoming attach. If a link object of the same name is found
+ // which is closed both locally and remotely, assume that is
+ // no longer in use.
+ !((link->endpoint.state & PN_LOCAL_CLOSED) && (link->endpoint.state & PN_REMOTE_CLOSED)) &&
!strncmp(name.start, pn_string_get(link->name), name.size))
{
return link;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[15/25] qpid-proton git commit: NO-JIRA: additional fix to proton-j
UTF-8
Posted by ro...@apache.org.
NO-JIRA: additional fix to proton-j UTF-8
Still the encoder wasn't 100% compliant in 0.9. Also fixup the unittest
to run a touch faster.
(cherry picked from commit 836cf278a1c2aa6d8fafe90b4b253549782bcefb)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/f46bb642
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/f46bb642
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/f46bb642
Branch: refs/heads/0.9.x
Commit: f46bb642f8421d5e254556a84bf2a4e3d17e97d4
Parents: 3e9c9b8
Author: Dominic Evans <do...@uk.ibm.com>
Authored: Thu Apr 2 20:35:33 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 15:43:58 2015 +0100
----------------------------------------------------------------------
.../apache/qpid/proton/codec/EncoderImpl.java | 2 +-
.../qpid/proton/codec/StringTypeTest.java | 63 +++++++++++---------
2 files changed, 35 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f46bb642/proton-j/src/main/java/org/apache/qpid/proton/codec/EncoderImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/codec/EncoderImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/codec/EncoderImpl.java
index 77f0efc..fd0be07 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/codec/EncoderImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/codec/EncoderImpl.java
@@ -788,7 +788,7 @@ public final class EncoderImpl implements ByteBufferEncoder
_buffer.put((byte)(0xC0 | ((c >> 6) & 0x1F)));
_buffer.put((byte)(0x80 | (c & 0x3F)));
}
- else if ((c & 0xD800) != 0xD800 || (c & 0xDC00) == 0xDC00) /* U+0800..U+FFFF - excluding surrogate pairs */
+ else if ((c & 0xD800) != 0xD800 || (c > 0xDBFF)) /* U+0800..U+FFFF - excluding surrogate pairs */
{
_buffer.put((byte)(0xE0 | ((c >> 12) & 0x0F)));
_buffer.put((byte)(0x80 | ((c >> 6) & 0x3F)));
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f46bb642/proton-j/src/test/java/org/apache/qpid/proton/codec/StringTypeTest.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/codec/StringTypeTest.java b/proton-j/src/test/java/org/apache/qpid/proton/codec/StringTypeTest.java
index 7a44063..90cfe26 100644
--- a/proton-j/src/test/java/org/apache/qpid/proton/codec/StringTypeTest.java
+++ b/proton-j/src/test/java/org/apache/qpid/proton/codec/StringTypeTest.java
@@ -27,6 +27,8 @@ import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Set;
import org.apache.qpid.proton.amqp.messaging.AmqpValue;
@@ -39,6 +41,8 @@ public class StringTypeTest
{
private static final Charset CHARSET_UTF8 = Charset.forName("UTF-8");
+ private static final List<String> TEST_DATA = generateTestData();
+
/**
* Loop over all the chars in given {@link UnicodeBlock}s and return a
* {@link Set <String>} containing all the possible values as their
@@ -91,7 +95,7 @@ public class StringTypeTest
@Test
public void calculateUTF8Length()
{
- for (final String input : generateTestData())
+ for (final String input : TEST_DATA)
{
assertEquals("Incorrect string length calculated for string '"+input+"'",input.getBytes(CHARSET_UTF8).length, StringType.calculateUTF8Length(input));
}
@@ -108,7 +112,7 @@ public class StringTypeTest
AMQPDefinedTypes.registerAllTypes(decoder, encoder);
final ByteBuffer bb = ByteBuffer.allocate(16);
- for (final String input : generateTestData())
+ for (final String input : TEST_DATA)
{
bb.clear();
final AmqpValue inputValue = new AmqpValue(input);
@@ -122,36 +126,37 @@ public class StringTypeTest
}
// build up some test data with a set of suitable Unicode characters
- private Set<String> generateTestData()
+ private static List<String> generateTestData()
{
- return new HashSet<String>()
+ return new LinkedList<String>()
+ {
+ private static final long serialVersionUID = 7331717267070233454L;
{
- private static final long serialVersionUID = 7331717267070233454L;
-
+ // non-surrogate pair blocks
+ addAll(getAllStringsFromUnicodeBlocks(UnicodeBlock.BASIC_LATIN,
+ UnicodeBlock.LATIN_1_SUPPLEMENT,
+ UnicodeBlock.GREEK,
+ UnicodeBlock.LETTERLIKE_SYMBOLS));
+ // blocks with surrogate pairs
+ //TODO: restore others when Java 7 is baseline
+ addAll(getAllStringsFromUnicodeBlocks(UnicodeBlock.LINEAR_B_SYLLABARY,
+ /*UnicodeBlock.MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS,*/
+ UnicodeBlock.MUSICAL_SYMBOLS,
+ /*UnicodeBlock.EMOTICONS,*/
+ /*UnicodeBlock.PLAYING_CARDS,*/
+ UnicodeBlock.BOX_DRAWING,
+ UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS,
+ UnicodeBlock.PRIVATE_USE_AREA,
+ UnicodeBlock.SUPPLEMENTARY_PRIVATE_USE_AREA_A,
+ UnicodeBlock.SUPPLEMENTARY_PRIVATE_USE_AREA_B));
+ // some additional combinations of characters that could cause problems to the encoder
+ String[] boxDrawing = getAllStringsFromUnicodeBlocks(UnicodeBlock.BOX_DRAWING).toArray(new String[0]);
+ String[] halfFullWidthForms = getAllStringsFromUnicodeBlocks(UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS).toArray(new String[0]);
+ for (int i = 0; i < halfFullWidthForms.length; i++)
{
- // non-surrogate pair blocks
- addAll(getAllStringsFromUnicodeBlocks(UnicodeBlock.BASIC_LATIN,
- UnicodeBlock.LATIN_1_SUPPLEMENT,
- UnicodeBlock.GREEK,
- UnicodeBlock.LETTERLIKE_SYMBOLS));
- // blocks with surrogate pairs
- //TODO: restore others when Java 7 is baseline
- addAll(getAllStringsFromUnicodeBlocks(/*UnicodeBlock.MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS,*/
- UnicodeBlock.MUSICAL_SYMBOLS,
- /*UnicodeBlock.EMOTICONS,*/
- /*UnicodeBlock.PLAYING_CARDS,*/
- UnicodeBlock.BOX_DRAWING,
- UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS,
- UnicodeBlock.SUPPLEMENTARY_PRIVATE_USE_AREA_A,
- UnicodeBlock.SUPPLEMENTARY_PRIVATE_USE_AREA_B));
- // some additional combinations of characters that could cause problems to the encoder
- String[] boxDrawing = getAllStringsFromUnicodeBlocks(UnicodeBlock.BOX_DRAWING).toArray(new String[0]);
- String[] halfFullWidthForms = getAllStringsFromUnicodeBlocks(UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS).toArray(new String[0]);
- for (int i = 0; i < halfFullWidthForms.length; i++)
- {
- add(halfFullWidthForms[i] + boxDrawing[i % boxDrawing.length]);
- }
+ add(halfFullWidthForms[i] + boxDrawing[i % boxDrawing.length]);
}
- };
+ }
+ };
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[21/25] qpid-proton git commit: PROTON-853: revert the change from
PROTON-154,
including the test since it doesnt actually fail without the change.
Posted by ro...@apache.org.
PROTON-853: revert the change from PROTON-154, including the test since it doesnt actually fail without the change.
This reverts commit 7d3063e7c488c97b9bad61e862d54b2b11dbc3d5.
(cherry picked from commit d2262bb7e2ead5b12ed2d4baf94cca6f06e0146c)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/371e2adf
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/371e2adf
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/371e2adf
Branch: refs/heads/0.9.x
Commit: 371e2adf33d17c9a55bbccdedd4c9ae42ecc6fc2
Parents: 5736c3a
Author: Robert Gemmell <ro...@apache.org>
Authored: Mon Apr 20 16:47:55 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 15:49:15 2015 +0100
----------------------------------------------------------------------
.../qpid/proton/engine/impl/TransportImpl.java | 5 +--
.../qpid/proton/engine/impl/TransportLink.java | 10 ------
tests/python/proton_tests/engine.py | 34 --------------------
3 files changed, 3 insertions(+), 46 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/371e2adf/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
index 551a699..8a7fb32 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
@@ -30,6 +30,7 @@ import org.apache.qpid.proton.amqp.Binary;
import org.apache.qpid.proton.amqp.Symbol;
import org.apache.qpid.proton.amqp.UnsignedInteger;
import org.apache.qpid.proton.amqp.UnsignedShort;
+import org.apache.qpid.proton.amqp.security.SaslCode;
import org.apache.qpid.proton.amqp.transport.Attach;
import org.apache.qpid.proton.amqp.transport.Begin;
import org.apache.qpid.proton.amqp.transport.Close;
@@ -58,6 +59,7 @@ import org.apache.qpid.proton.engine.Transport;
import org.apache.qpid.proton.engine.TransportException;
import org.apache.qpid.proton.engine.TransportResult;
import org.apache.qpid.proton.engine.TransportResultFactory;
+import org.apache.qpid.proton.engine.Sasl.SaslOutcome;
import org.apache.qpid.proton.engine.impl.ssl.ProtonSslEngineProvider;
import org.apache.qpid.proton.engine.impl.ssl.SslImpl;
import org.apache.qpid.proton.framing.TransportFrame;
@@ -404,7 +406,7 @@ public class TransportImpl extends EndpointImpl
UnsignedInteger localHandle = transportLink.getLocalHandle();
transportLink.clearLocalHandle();
transportSession.freeLocalHandle(localHandle);
- transportLink.clearSentAttach();
+
Detach detach = new Detach();
detach.setHandle(localHandle);
@@ -750,7 +752,6 @@ public class TransportImpl extends EndpointImpl
}
writeFrame(transportSession.getLocalChannel(), attach, null, null);
- transportLink.clearDetachReceived();
transportLink.sentAttach();
}
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/371e2adf/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportLink.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportLink.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportLink.java
index bdd80b5..836cf71 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportLink.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportLink.java
@@ -212,11 +212,6 @@ class TransportLink<T extends LinkImpl>
return _detachReceived;
}
- public void clearDetachReceived()
- {
- _detachReceived = false;
- }
-
public boolean attachSent()
{
return _attachSent;
@@ -227,11 +222,6 @@ class TransportLink<T extends LinkImpl>
_attachSent = true;
}
- public void clearSentAttach()
- {
- _attachSent = false;
- }
-
public void setRemoteDeliveryCount(UnsignedInteger remoteDeliveryCount)
{
_remoteDeliveryCount = remoteDeliveryCount;
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/371e2adf/tests/python/proton_tests/engine.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/engine.py b/tests/python/proton_tests/engine.py
index 62e73c1..514d361 100644
--- a/tests/python/proton_tests/engine.py
+++ b/tests/python/proton_tests/engine.py
@@ -430,40 +430,6 @@ class LinkTest(Test):
assert self.snd.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED
assert self.rcv.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED
- def test_reopen_on_same_session(self):
- """
- confirm that a link is correctly opened when attaching to a previously
- detached link on the same session
- """
- assert self.snd.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT
- assert self.rcv.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT
-
- self.snd.open()
- self.rcv.open()
- self.pump()
-
- assert self.snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
- assert self.rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
-
- self.snd.close()
- self.rcv.close()
- self.pump()
-
- assert self.snd.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED
- assert self.rcv.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED
-
- self.snd, self.rcv = self.link("test-link")
- assert self.snd.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT
- assert self.rcv.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT
-
- self.snd.open()
- self.rcv.open()
- self.pump()
-
- assert self.snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
- assert self.rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
-
-
def test_simultaneous_open_close(self):
assert self.snd.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT
assert self.rcv.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[22/25] qpid-proton git commit: PROTON-853: add a test that catches
the issue from PROTON-154 (and PROTON-850)
Posted by ro...@apache.org.
PROTON-853: add a test that catches the issue from PROTON-154 (and PROTON-850)
(cherry picked from commit 252f5f0c1a3cb50edac7813eb233a37697e1f2ab)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/acd1e1c9
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/acd1e1c9
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/acd1e1c9
Branch: refs/heads/0.9.x
Commit: acd1e1c9a582aaf190bb32ebc5bd9e590bd71930
Parents: 371e2ad
Author: Robert Gemmell <ro...@apache.org>
Authored: Mon Apr 20 17:39:25 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 15:49:26 2015 +0100
----------------------------------------------------------------------
tests/python/proton_tests/engine.py | 44 ++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/acd1e1c9/tests/python/proton_tests/engine.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/engine.py b/tests/python/proton_tests/engine.py
index 514d361..8fabf90 100644
--- a/tests/python/proton_tests/engine.py
+++ b/tests/python/proton_tests/engine.py
@@ -369,6 +369,50 @@ class SessionTest(Test):
self.pump()
assert rcv_ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED
+ def test_reopen_on_same_session_without_free(self):
+ """
+ confirm that a link is correctly opened when attaching to a previously
+ closed link *that has not been freed yet* on the same session
+ """
+ self.ssn.open()
+ self.pump()
+
+ ssn2 = self.c2.session_head(Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_ACTIVE)
+ ssn2.open()
+ self.pump()
+ snd = self.ssn.sender("test-link")
+ rcv = ssn2.receiver("test-link")
+
+ assert snd.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT
+ assert rcv.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT
+
+ snd.open()
+ rcv.open()
+ self.pump()
+
+ assert snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
+ assert rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
+
+ snd.close()
+ rcv.close()
+ self.pump()
+
+ assert snd.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED
+ assert rcv.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED
+
+ snd = self.ssn.sender("test-link")
+ rcv = ssn2.receiver("test-link")
+ assert snd.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT
+ assert rcv.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT
+
+ snd.open()
+ rcv.open()
+ self.pump()
+
+ assert snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
+ assert rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
+
+
class LinkTest(Test):
def setup(self):
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[16/25] qpid-proton git commit: NO-JIRA: fix erroneous
getRemoteIdleTimeout()
Posted by ro...@apache.org.
NO-JIRA: fix erroneous getRemoteIdleTimeout()
The getter was incorrectly dividing the value in half before returning
it.
(cherry picked from commit 677ea33fd6dfc362ab4272da394aa5944cc15637)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/c3364ef3
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/c3364ef3
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/c3364ef3
Branch: refs/heads/0.9.x
Commit: c3364ef3d18f45c942efb11e67b804c88db06f98
Parents: f46bb64
Author: Dominic Evans <do...@uk.ibm.com>
Authored: Thu Apr 2 21:00:41 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 15:44:15 2015 +0100
----------------------------------------------------------------------
.../java/org/apache/qpid/proton/engine/impl/TransportImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c3364ef3/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
index 39a059b..ee190a6 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
@@ -1458,7 +1458,7 @@ public class TransportImpl extends EndpointImpl
}
public int getRemoteIdleTimeout() {
- return _remoteIdleTimeout / 2;
+ return _remoteIdleTimeout;
}
@Override
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[09/25] qpid-proton git commit: Release 0.9-rc-3
Posted by ro...@apache.org.
Release 0.9-rc-3
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/bcb7a47b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/bcb7a47b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/bcb7a47b
Branch: refs/heads/0.9.x
Commit: bcb7a47ba0ef89b807a812caf76ddfee843f941d
Parents: 810088b
Author: Rafael Schloming <rh...@alum.mit.edu>
Authored: Tue Mar 17 09:25:04 2015 +1300
Committer: Rafael Schloming <rh...@alum.mit.edu>
Committed: Tue Mar 17 09:25:04 2015 +1300
----------------------------------------------------------------------
contrib/proton-hawtdispatch/pom.xml | 2 +-
contrib/proton-jms/pom.xml | 2 +-
examples/java/messenger/pom.xml | 2 +-
pom.xml | 2 +-
proton-j/pom.xml | 2 +-
tests/pom.xml | 2 +-
version.txt | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bcb7a47b/contrib/proton-hawtdispatch/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/proton-hawtdispatch/pom.xml b/contrib/proton-hawtdispatch/pom.xml
index 0eaa171..085b634 100644
--- a/contrib/proton-hawtdispatch/pom.xml
+++ b/contrib/proton-hawtdispatch/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>0.9-rc-3</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bcb7a47b/contrib/proton-jms/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/proton-jms/pom.xml b/contrib/proton-jms/pom.xml
index 4515cbb..7048e5c 100644
--- a/contrib/proton-jms/pom.xml
+++ b/contrib/proton-jms/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>0.9-rc-3</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bcb7a47b/examples/java/messenger/pom.xml
----------------------------------------------------------------------
diff --git a/examples/java/messenger/pom.xml b/examples/java/messenger/pom.xml
index 24e76c2..becde12 100644
--- a/examples/java/messenger/pom.xml
+++ b/examples/java/messenger/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>0.9-rc-3</version>
<relativePath>../../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bcb7a47b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 412af45..724b5d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
requiring the latest trunk build can use an unchanging value in their pom.xml.
We will use a more representative version if and when snapshots from multiple
branches are being concurrently produced. -->
- <version>1.0-SNAPSHOT</version>
+ <version>0.9-rc-3</version>
<packaging>pom</packaging>
<properties>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bcb7a47b/proton-j/pom.xml
----------------------------------------------------------------------
diff --git a/proton-j/pom.xml b/proton-j/pom.xml
index c43e78e..e870bb1 100644
--- a/proton-j/pom.xml
+++ b/proton-j/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>0.9-rc-3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bcb7a47b/tests/pom.xml
----------------------------------------------------------------------
diff --git a/tests/pom.xml b/tests/pom.xml
index 8367eca..f5e1078 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>0.9-rc-3</version>
</parent>
<description>The Proton system tests execute against either the Java or the C implementations,
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bcb7a47b/version.txt
----------------------------------------------------------------------
diff --git a/version.txt b/version.txt
index b63ba69..47b764d 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-0.9
+0.9-rc-3
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[25/25] qpid-proton git commit: update pom versions to 0.9.1-SNAPSHOT
Posted by ro...@apache.org.
update pom versions to 0.9.1-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/ee4b6e39
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/ee4b6e39
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/ee4b6e39
Branch: refs/heads/0.9.x
Commit: ee4b6e399dccfbb3609fd27ad962fdece0b1186a
Parents: aef2faf
Author: Robert Gemmell <ro...@apache.org>
Authored: Fri Apr 24 16:04:10 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 16:04:10 2015 +0100
----------------------------------------------------------------------
contrib/proton-hawtdispatch/pom.xml | 2 +-
contrib/proton-jms/pom.xml | 2 +-
examples/java/messenger/pom.xml | 2 +-
pom.xml | 2 +-
proton-j/pom.xml | 2 +-
tests/pom.xml | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ee4b6e39/contrib/proton-hawtdispatch/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/proton-hawtdispatch/pom.xml b/contrib/proton-hawtdispatch/pom.xml
index 02587f1..812d05f 100644
--- a/contrib/proton-hawtdispatch/pom.xml
+++ b/contrib/proton-hawtdispatch/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>0.9</version>
+ <version>0.9.1-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ee4b6e39/contrib/proton-jms/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/proton-jms/pom.xml b/contrib/proton-jms/pom.xml
index f1b43cc..4e062a7 100644
--- a/contrib/proton-jms/pom.xml
+++ b/contrib/proton-jms/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>0.9</version>
+ <version>0.9.1-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ee4b6e39/examples/java/messenger/pom.xml
----------------------------------------------------------------------
diff --git a/examples/java/messenger/pom.xml b/examples/java/messenger/pom.xml
index 1449bd0..0b48b7a 100644
--- a/examples/java/messenger/pom.xml
+++ b/examples/java/messenger/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>0.9</version>
+ <version>0.9.1-SNAPSHOT</version>
<relativePath>../../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ee4b6e39/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f27871b..7ae230e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
requiring the latest trunk build can use an unchanging value in their pom.xml.
We will use a more representative version if and when snapshots from multiple
branches are being concurrently produced. -->
- <version>0.9</version>
+ <version>0.9.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ee4b6e39/proton-j/pom.xml
----------------------------------------------------------------------
diff --git a/proton-j/pom.xml b/proton-j/pom.xml
index 4d73948..96877cf 100644
--- a/proton-j/pom.xml
+++ b/proton-j/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>0.9</version>
+ <version>0.9.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ee4b6e39/tests/pom.xml
----------------------------------------------------------------------
diff --git a/tests/pom.xml b/tests/pom.xml
index 54e658f..adf3cbf 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-project</artifactId>
- <version>0.9</version>
+ <version>0.9.1-SNAPSHOT</version>
</parent>
<description>The Proton system tests execute against either the Java or the C implementations,
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[06/25] qpid-proton git commit: PROTON-838: proton-hawtdispatch
cannot connect with SSL
Posted by ro...@apache.org.
PROTON-838: proton-hawtdispatch cannot connect with SSL
Remove one of calls to transport.connecting() as this causes
an assert with SslTransport
(cherry picked from commit f8ca35f3e007b99e0a5365e154e067840adcefb0)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/0fbe80e2
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/0fbe80e2
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/0fbe80e2
Branch: refs/heads/0.9.x
Commit: 0fbe80e2f81a1e8a2df55f6221b987391d5dc336
Parents: ea01c01
Author: Bozo Dragojevic <bo...@digiverse.si>
Authored: Fri Mar 13 14:01:35 2015 +0100
Committer: Bozo Dragojevic <bo...@digiverse.si>
Committed: Fri Mar 13 23:09:11 2015 +0100
----------------------------------------------------------------------
.../org/apache/qpid/proton/hawtdispatch/impl/AmqpTransport.java | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/0fbe80e2/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/impl/AmqpTransport.java
----------------------------------------------------------------------
diff --git a/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/impl/AmqpTransport.java b/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/impl/AmqpTransport.java
index 9ea048b..bc3ec2e 100644
--- a/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/impl/AmqpTransport.java
+++ b/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/impl/AmqpTransport.java
@@ -167,7 +167,6 @@ public class AmqpTransport extends WatchBase {
transport.setSendBufferSize(options.getSendBufferSize());
transport.setTrafficClass(options.getTrafficClass());
transport.setUseLocalHost(options.isUseLocalHost());
- transport.connecting(host, options.getLocalAddress());
transport.setTransportListener(new DefaultTransportListener(){
public void onTransportConnected() {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[12/25] qpid-proton git commit: fixed release.sh to work on tags
Posted by ro...@apache.org.
fixed release.sh to work on tags
(cherry picked from commit 938f4cb8c2e31c2bcc20fba7d973214ee38d650a)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/56101ee4
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/56101ee4
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/56101ee4
Branch: refs/heads/0.9.x
Commit: 56101ee431c5a2c2a5d15b01e86b88ce0be416c7
Parents: fc1d75a
Author: Rafael Schloming <rh...@alum.mit.edu>
Authored: Tue Mar 31 05:05:51 2015 -0400
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 15:42:01 2015 +0100
----------------------------------------------------------------------
bin/release.sh | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/56101ee4/bin/release.sh
----------------------------------------------------------------------
diff --git a/bin/release.sh b/bin/release.sh
index 68def92..984d7d5 100755
--- a/bin/release.sh
+++ b/bin/release.sh
@@ -51,9 +51,13 @@ die()
if [ -n "$(git status -uno --porcelain)" ]; then
die must release from a clean checkout
fi
- BRANCH=$(git symbolic-ref --short HEAD)
- REMOTE=$(git config branch.${BRANCH}.remote)
- git checkout --detach ${REMOTE}/${BRANCH}
+ BRANCH=$(git symbolic-ref -q --short HEAD)
+ if [ -n "${BRANCH}" ]; then
+ REMOTE=$(git config branch.${BRANCH}.remote)
+ git checkout --detach ${REMOTE}/${BRANCH}
+ else
+ REMOTE="origin"
+ fi
bin/version.sh $VERSION
git commit -a -m "Release $VERSION"
git tag -m "Release $VERSION" $VERSION
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[18/25] qpid-proton git commit: PROTON-854: remove sessions from the
list when they are freed
Posted by ro...@apache.org.
PROTON-854: remove sessions from the list when they are freed
(cherry picked from commit 1e4b121d6fdbcfa5585416dfdca4430e042f52bf)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/69fc2ebd
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/69fc2ebd
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/69fc2ebd
Branch: refs/heads/0.9.x
Commit: 69fc2ebdb0a2ae7fca797dc42c0d0185a45ec14d
Parents: b6fc285
Author: Robert Gemmell <ro...@apache.org>
Authored: Mon Apr 20 11:27:32 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 15:48:18 2015 +0100
----------------------------------------------------------------------
.../org/apache/qpid/proton/engine/impl/ConnectionImpl.java | 8 +++++++-
.../java/org/apache/qpid/proton/engine/impl/SessionImpl.java | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69fc2ebd/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
index 68907d5..17ffde7 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
@@ -86,6 +86,11 @@ public class ConnectionImpl extends EndpointImpl implements ProtonJConnection
return session;
}
+ void freeSession(SessionImpl session)
+ {
+ _sessions.remove(session);
+ }
+
protected LinkNode<SessionImpl> addSessionEndpoint(SessionImpl endpoint)
{
LinkNode<SessionImpl> node;
@@ -190,7 +195,8 @@ public class ConnectionImpl extends EndpointImpl implements ProtonJConnection
@Override
void doFree() {
- for(Session session : _sessions) {
+ List<SessionImpl> sessions = new ArrayList<SessionImpl>(_sessions);
+ for(Session session : sessions) {
session.free();
}
_sessions = null;
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69fc2ebd/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java
index 5eb55f5..0b3524a 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java
@@ -100,6 +100,7 @@ public class SessionImpl extends EndpointImpl implements ProtonJSession
@Override
void doFree() {
+ _connection.freeSession(this);
_connection.removeSessionEndpoint(_node);
_node = null;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[08/25] qpid-proton git commit: PROTON-834: further UTF-8 encoder
fixes
Posted by ro...@apache.org.
PROTON-834: further UTF-8 encoder fixes
After commit c65e897 it turned out there were still some issues with
strings containing a codepoint >0xDBFF which was being incorrectly
treated as a surrogate pair in the calculateUTF8Length method.
Fixed this up and added some more test coverage.
Closes #13
(cherry picked from commit 7b9b516d445ab9e86a0313709c77218d901435b1)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/810088b1
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/810088b1
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/810088b1
Branch: refs/heads/0.9.x
Commit: 810088b14dedcd12a9474687ba9cd05fc8297188
Parents: c2042d7
Author: Dominic Evans <do...@uk.ibm.com>
Authored: Mon Mar 16 12:18:20 2015 +0000
Committer: Dominic Evans <do...@uk.ibm.com>
Committed: Mon Mar 16 16:07:51 2015 +0000
----------------------------------------------------------------------
.../main/java/org/apache/qpid/proton/codec/StringType.java | 2 +-
.../java/org/apache/qpid/proton/codec/StringTypeTest.java | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/810088b1/proton-j/src/main/java/org/apache/qpid/proton/codec/StringType.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/codec/StringType.java b/proton-j/src/main/java/org/apache/qpid/proton/codec/StringType.java
index 092894d..a035e94 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/codec/StringType.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/codec/StringType.java
@@ -97,7 +97,7 @@ public class StringType extends AbstractPrimitiveType<String>
{
len++;
// surrogate pairs should always combine to create a code point with a 4 octet representation
- if ((c & 0xD800) == 0xD800)
+ if ((c & 0xD800) == 0xD800 && c < 0xDC00)
{
i++;
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/810088b1/proton-j/src/test/java/org/apache/qpid/proton/codec/StringTypeTest.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/codec/StringTypeTest.java b/proton-j/src/test/java/org/apache/qpid/proton/codec/StringTypeTest.java
index 7d78f65..7a44063 100644
--- a/proton-j/src/test/java/org/apache/qpid/proton/codec/StringTypeTest.java
+++ b/proton-j/src/test/java/org/apache/qpid/proton/codec/StringTypeTest.java
@@ -140,9 +140,17 @@ public class StringTypeTest
UnicodeBlock.MUSICAL_SYMBOLS,
/*UnicodeBlock.EMOTICONS,*/
/*UnicodeBlock.PLAYING_CARDS,*/
+ UnicodeBlock.BOX_DRAWING,
UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS,
UnicodeBlock.SUPPLEMENTARY_PRIVATE_USE_AREA_A,
UnicodeBlock.SUPPLEMENTARY_PRIVATE_USE_AREA_B));
+ // some additional combinations of characters that could cause problems to the encoder
+ String[] boxDrawing = getAllStringsFromUnicodeBlocks(UnicodeBlock.BOX_DRAWING).toArray(new String[0]);
+ String[] halfFullWidthForms = getAllStringsFromUnicodeBlocks(UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS).toArray(new String[0]);
+ for (int i = 0; i < halfFullWidthForms.length; i++)
+ {
+ add(halfFullWidthForms[i] + boxDrawing[i % boxDrawing.length]);
+ }
}
};
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[14/25] qpid-proton git commit: PROTON-844: police handle-max in
proton-j
Posted by ro...@apache.org.
PROTON-844: police handle-max in proton-j
* when receiving an attach with a handle > handle-max, the connection
should be closed
* when attempting to allocate a new local handle when handle-max are
already in-use should throw an Exception
* the default of 1024 handle-max is quite small when proton-c appears to
default to 4294967295 - increase it more modestly to 65536
Closes #16
(cherry picked from commit f937ccd04a99575cb44ec4108908d155e9f3a101)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/3e9c9b8b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/3e9c9b8b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/3e9c9b8b
Branch: refs/heads/0.9.x
Commit: 3e9c9b8bec01b8bdb06feccb715ddff5a766ab72
Parents: 50ab143
Author: Dominic Evans <do...@uk.ibm.com>
Authored: Thu Apr 2 18:59:27 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 15:43:27 2015 +0100
----------------------------------------------------------------------
.../qpid/proton/engine/impl/TransportImpl.java | 26 +++++++++++++++++---
.../proton/engine/impl/TransportSession.java | 16 ++++++------
2 files changed, 31 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/3e9c9b8b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
index b866ca8..39a059b 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
@@ -1092,7 +1092,27 @@ public class TransportImpl extends EndpointImpl
else
{
SessionImpl session = transportSession.getSession();
- TransportLink<?> transportLink = transportSession.getLinkFromRemoteHandle(attach.getHandle());
+ final UnsignedInteger handle = attach.getHandle();
+ if (handle.compareTo(transportSession.getHandleMax()) > 0) {
+ // The handle-max value is the highest handle value that can be used on the session. A peer MUST
+ // NOT attempt to attach a link using a handle value outside the range that its partner can handle.
+ // A peer that receives a handle outside the supported range MUST close the connection with the
+ // framing-error error-code.
+ ErrorCondition condition =
+ new ErrorCondition(ConnectionError.FRAMING_ERROR,
+ "handle-max exceeded");
+ _connectionEndpoint.setCondition(condition);
+ _connectionEndpoint.setLocalState(EndpointState.CLOSED);
+ if (!_isCloseSent) {
+ Close close = new Close();
+ close.setError(condition);
+ _isCloseSent = true;
+ writeFrame(0, close, null, null);
+ }
+ close_tail();
+ return;
+ }
+ TransportLink<?> transportLink = transportSession.getLinkFromRemoteHandle(handle);
LinkImpl link = null;
if(transportLink != null)
@@ -1127,8 +1147,8 @@ public class TransportImpl extends EndpointImpl
link.setRemoteSenderSettleMode(attach.getSndSettleMode());
transportLink.setName(attach.getName());
- transportLink.setRemoteHandle(attach.getHandle());
- transportSession.addLinkRemoteHandle(transportLink, attach.getHandle());
+ transportLink.setRemoteHandle(handle);
+ transportSession.addLinkRemoteHandle(transportLink, handle);
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/3e9c9b8b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java
index 6d96043..1b23df7 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java
@@ -23,6 +23,7 @@ package org.apache.qpid.proton.engine.impl;
import java.util.HashMap;
import java.util.Map;
+
import org.apache.qpid.proton.amqp.Binary;
import org.apache.qpid.proton.amqp.UnsignedInteger;
import org.apache.qpid.proton.amqp.transport.Disposition;
@@ -38,16 +39,16 @@ class TransportSession
private int _localChannel = -1;
private int _remoteChannel = -1;
private boolean _openSent;
- private UnsignedInteger _handleMax = UnsignedInteger.valueOf(1024);
+ private final UnsignedInteger _handleMax = UnsignedInteger.valueOf(65536);
private UnsignedInteger _outgoingDeliveryId = UnsignedInteger.ZERO;
private UnsignedInteger _incomingWindowSize = UnsignedInteger.ZERO;
private UnsignedInteger _outgoingWindowSize = UnsignedInteger.ZERO;
private UnsignedInteger _nextOutgoingId = UnsignedInteger.ONE;
private UnsignedInteger _nextIncomingId = null;
- private TransportLink[] _remoteHandleMap = new TransportLink[1024];
- private TransportLink[] _localHandleMap = new TransportLink[1024];
- private Map<String, TransportLink> _halfOpenLinks = new HashMap<String, TransportLink>();
+ private final TransportLink[] _remoteHandleMap = new TransportLink[_handleMax.intValue() + 1];
+ private final TransportLink[] _localHandleMap = new TransportLink[_handleMax.intValue() + 1];
+ private final Map<String, TransportLink> _halfOpenLinks = new HashMap<String, TransportLink>();
private UnsignedInteger _incomingDeliveryId = null;
@@ -55,9 +56,9 @@ class TransportSession
private UnsignedInteger _remoteOutgoingWindow;
private UnsignedInteger _remoteNextIncomingId = _nextOutgoingId;
private UnsignedInteger _remoteNextOutgoingId;
- private Map<UnsignedInteger, DeliveryImpl>
+ private final Map<UnsignedInteger, DeliveryImpl>
_unsettledIncomingDeliveriesById = new HashMap<UnsignedInteger, DeliveryImpl>();
- private Map<UnsignedInteger, DeliveryImpl>
+ private final Map<UnsignedInteger, DeliveryImpl>
_unsettledOutgoingDeliveriesById = new HashMap<UnsignedInteger, DeliveryImpl>();
private int _unsettledIncomingSize;
private boolean _endReceived;
@@ -218,8 +219,7 @@ class TransportSession
return rc;
}
}
- // TODO - error
- return UnsignedInteger.MAX_VALUE;
+ throw new IllegalStateException("no local handle available for allocation");
}
public void addLinkRemoteHandle(TransportLink link, UnsignedInteger remoteHandle)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[23/25] qpid-proton git commit: PROTON-853: dont return the cached
links if they are already in the closed state,
instead create a new object and ensure the old links also get freed. Also
fixes similar behaviour as in PROTON-850.
Posted by ro...@apache.org.
PROTON-853: dont return the cached links if they are already in the closed state, instead create a new object and ensure the old links also get freed. Also fixes similar behaviour as in PROTON-850.
This closes #21
(cherry picked from commit f2d7d669155a2ca57606c9381f4f1720739be79b)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/7fa68079
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/7fa68079
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/7fa68079
Branch: refs/heads/0.9.x
Commit: 7fa680794b7d78906129216471170dc7d720b156
Parents: acd1e1c
Author: Robert Gemmell <ro...@apache.org>
Authored: Mon Apr 20 17:41:10 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 15:49:41 2015 +0100
----------------------------------------------------------------------
.../qpid/proton/engine/impl/SessionImpl.java | 51 +++++++++++++++++++-
.../qpid/proton/engine/impl/TransportImpl.java | 6 ---
2 files changed, 50 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7fa68079/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java
index 0b3524a..45fcb70 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java
@@ -21,6 +21,7 @@
package org.apache.qpid.proton.engine.impl;
import java.util.*;
+
import org.apache.qpid.proton.engine.EndpointState;
import org.apache.qpid.proton.engine.ProtonJSession;
import org.apache.qpid.proton.engine.Session;
@@ -32,6 +33,7 @@ public class SessionImpl extends EndpointImpl implements ProtonJSession
private Map<String, SenderImpl> _senders = new LinkedHashMap<String, SenderImpl>();
private Map<String, ReceiverImpl> _receivers = new LinkedHashMap<String, ReceiverImpl>();
+ private List<LinkImpl> _oldLinksToFree = new ArrayList<LinkImpl>();
private TransportSession _transportSession;
private int _incomingCapacity = 1024*1024;
private int _incomingBytes = 0;
@@ -58,6 +60,17 @@ public class SessionImpl extends EndpointImpl implements ProtonJSession
sender = new SenderImpl(this, name);
_senders.put(name, sender);
}
+ else
+ {
+ if(sender.getLocalState() == EndpointState.CLOSED
+ && sender.getRemoteState() == EndpointState.CLOSED)
+ {
+ _oldLinksToFree.add(sender);
+
+ sender = new SenderImpl(this, name);
+ _senders.put(name, sender);
+ }
+ }
return sender;
}
@@ -69,6 +82,17 @@ public class SessionImpl extends EndpointImpl implements ProtonJSession
receiver = new ReceiverImpl(this, name);
_receivers.put(name, receiver);
}
+ else
+ {
+ if(receiver.getLocalState() == EndpointState.CLOSED
+ && receiver.getRemoteState() == EndpointState.CLOSED)
+ {
+ _oldLinksToFree.add(receiver);
+
+ receiver = new ReceiverImpl(this, name);
+ _receivers.put(name, receiver);
+ }
+ }
return receiver;
}
@@ -115,6 +139,11 @@ public class SessionImpl extends EndpointImpl implements ProtonJSession
receiver.free();
}
_receivers.clear();
+
+ List<LinkImpl> links = new ArrayList<LinkImpl>(_oldLinksToFree);
+ for(LinkImpl link : links) {
+ link.free();
+ }
}
void modifyEndpoints() {
@@ -145,12 +174,32 @@ public class SessionImpl extends EndpointImpl implements ProtonJSession
void freeSender(SenderImpl sender)
{
- _senders.remove(sender.getName());
+ String name = sender.getName();
+ SenderImpl existing = _senders.get(name);
+ if (sender.equals(existing))
+ {
+ _senders.remove(name);
+ }
+ else
+ {
+ _oldLinksToFree.remove(sender);
+ }
}
void freeReceiver(ReceiverImpl receiver)
{
_receivers.remove(receiver.getName());
+
+ String name = receiver.getName();
+ ReceiverImpl existing = _receivers.get(name);
+ if (receiver.equals(existing))
+ {
+ _receivers.remove(name);
+ }
+ else
+ {
+ _oldLinksToFree.remove(receiver);
+ }
}
@Override
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7fa68079/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
index 8a7fb32..c40cdee 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
@@ -22,15 +22,12 @@ import static org.apache.qpid.proton.engine.impl.ByteBufferUtils.pourBufferToArr
import java.nio.ByteBuffer;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Map;
-import java.util.Set;
import org.apache.qpid.proton.amqp.Binary;
import org.apache.qpid.proton.amqp.Symbol;
import org.apache.qpid.proton.amqp.UnsignedInteger;
import org.apache.qpid.proton.amqp.UnsignedShort;
-import org.apache.qpid.proton.amqp.security.SaslCode;
import org.apache.qpid.proton.amqp.transport.Attach;
import org.apache.qpid.proton.amqp.transport.Begin;
import org.apache.qpid.proton.amqp.transport.Close;
@@ -55,12 +52,9 @@ import org.apache.qpid.proton.engine.Sasl;
import org.apache.qpid.proton.engine.Ssl;
import org.apache.qpid.proton.engine.SslDomain;
import org.apache.qpid.proton.engine.SslPeerDetails;
-import org.apache.qpid.proton.engine.Transport;
import org.apache.qpid.proton.engine.TransportException;
import org.apache.qpid.proton.engine.TransportResult;
import org.apache.qpid.proton.engine.TransportResultFactory;
-import org.apache.qpid.proton.engine.Sasl.SaslOutcome;
-import org.apache.qpid.proton.engine.impl.ssl.ProtonSslEngineProvider;
import org.apache.qpid.proton.engine.impl.ssl.SslImpl;
import org.apache.qpid.proton.framing.TransportFrame;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[20/25] qpid-proton git commit: PROTON-848,
PROTON-849: dont store the TransportSession or TransportLink state in
maps,
use the references set on the associated Session and Link objects. Update
channel+link reference handling to behave more like proton-c
Posted by ro...@apache.org.
PROTON-848, PROTON-849: dont store the TransportSession or TransportLink state in maps, use the references set on the associated Session and Link objects. Update channel+link reference handling to behave more like proton-c in order to resolve the resulting test failures.
This closes #20
(cherry picked from commit f7e7ddde81cfbe02d1c24cf02df0e9a663c8dbc1)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/5736c3a4
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/5736c3a4
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/5736c3a4
Branch: refs/heads/0.9.x
Commit: 5736c3a4085d57aba07261ced0b28e9638f60bf4
Parents: 1324d97
Author: Robert Gemmell <ro...@apache.org>
Authored: Mon Apr 20 10:21:11 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 15:48:59 2015 +0100
----------------------------------------------------------------------
.../qpid/proton/engine/impl/TransportImpl.java | 18 ++++-------
.../qpid/proton/engine/impl/TransportLink.java | 19 ++++++++++--
.../proton/engine/impl/TransportSession.java | 32 ++++++++++++++++++++
tests/python/proton_tests/engine.py | 3 +-
4 files changed, 56 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5736c3a4/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
index ee190a6..551a699 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
@@ -96,10 +96,6 @@ public class TransportImpl extends EndpointImpl
private TransportInput _inputProcessor;
private TransportOutput _outputProcessor;
- private Map<SessionImpl, TransportSession> _transportSessionState = new HashMap<SessionImpl, TransportSession>();
- private Map<LinkImpl, TransportLink<?>> _transportLinkState = new HashMap<LinkImpl, TransportLink<?>>();
-
-
private DecoderImpl _decoder = new DecoderImpl();
private EncoderImpl _encoder = new EncoderImpl(_decoder);
@@ -252,12 +248,11 @@ public class TransportImpl extends EndpointImpl
@Override
public void unbind()
{
- for (TransportSession ts: _transportSessionState.values()) {
+ for (TransportSession ts: _localSessions.values()) {
ts.unbind();
}
-
- for (TransportLink tl: _transportLinkState.values()) {
- tl.unbind();
+ for (TransportSession ts: _remoteSessions.values()) {
+ ts.unbind();
}
put(Event.Type.CONNECTION_UNBOUND, _connectionEndpoint);
@@ -846,23 +841,21 @@ public class TransportImpl extends EndpointImpl
private TransportSession getTransportState(SessionImpl session)
{
- TransportSession transportSession = _transportSessionState.get(session);
+ TransportSession transportSession = session.getTransportSession();
if(transportSession == null)
{
transportSession = new TransportSession(this, session);
session.setTransportSession(transportSession);
- _transportSessionState.put(session, transportSession);
}
return transportSession;
}
private TransportLink<?> getTransportState(LinkImpl link)
{
- TransportLink<?> transportLink = _transportLinkState.get(link);
+ TransportLink<?> transportLink = link.getTransportLink();
if(transportLink == null)
{
transportLink = TransportLink.createTransportLink(link);
- _transportLinkState.put(link, transportLink);
}
return transportLink;
}
@@ -1248,6 +1241,7 @@ public class TransportImpl extends EndpointImpl
{
_remoteSessions.remove(channel);
transportSession.receivedEnd();
+ transportSession.unsetRemoteChannel();
SessionImpl session = transportSession.getSession();
session.setRemoteState(EndpointState.CLOSED);
ErrorCondition errorCondition = end.getError();
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5736c3a4/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportLink.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportLink.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportLink.java
index 2b60266..bdd80b5 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportLink.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportLink.java
@@ -46,9 +46,22 @@ class TransportLink<T extends LinkImpl>
static <L extends LinkImpl> TransportLink<L> createTransportLink(L link)
{
- return (TransportLink<L>) (link instanceof ReceiverImpl
- ? new TransportReceiver((ReceiverImpl)link)
- : new TransportSender((SenderImpl)link));
+ if (link instanceof ReceiverImpl)
+ {
+ ReceiverImpl r = (ReceiverImpl) link;
+ TransportReceiver tr = new TransportReceiver(r);
+ r.setTransportLink(tr);
+
+ return (TransportLink<L>) tr;
+ }
+ else
+ {
+ SenderImpl s = (SenderImpl) link;
+ TransportSender ts = new TransportSender(s);
+ s.setTransportLink(ts);
+
+ return (TransportLink<L>) ts;
+ }
}
void unbind()
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5736c3a4/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java
index 1b23df7..fb537cc 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java
@@ -130,19 +130,46 @@ class TransportSession
public void unsetLocalChannel()
{
if (isLocalChannelSet()) {
+ unsetLocalHandles();
_session.decref();
}
_localChannel = -1;
}
+ private void unsetLocalHandles()
+ {
+ for(int i = 0; i < _localHandleMap.length; i++)
+ {
+ TransportLink<?> tl = _localHandleMap[i];
+ if(tl != null)
+ {
+ _localHandleMap[i] = null;
+ tl.clearLocalHandle();
+ }
+ }
+ }
+
public void unsetRemoteChannel()
{
if (isRemoteChannelSet()) {
+ unsetRemoteHandles();
_session.decref();
}
_remoteChannel = -1;
}
+ private void unsetRemoteHandles()
+ {
+ for(int i = 0; i < _remoteHandleMap.length; i++)
+ {
+ TransportLink<?> tl = _remoteHandleMap[i];
+ if(tl != null)
+ {
+ _remoteHandleMap[i] = null;
+ tl.clearRemoteHandle();
+ }
+ }
+ }
public UnsignedInteger getHandleMax()
{
@@ -334,6 +361,11 @@ class TransportSession
unsetLocalChannel();
}
+ public void freeRemoteChannel()
+ {
+ unsetRemoteChannel();
+ }
+
private void setRemoteIncomingWindow(UnsignedInteger incomingWindow)
{
_remoteIncomingWindow = incomingWindow;
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5736c3a4/tests/python/proton_tests/engine.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/engine.py b/tests/python/proton_tests/engine.py
index 82869db..62e73c1 100644
--- a/tests/python/proton_tests/engine.py
+++ b/tests/python/proton_tests/engine.py
@@ -2394,9 +2394,10 @@ class TeardownLeakTest(PeerTest):
Event.TRANSPORT_CLOSED)
self.connection.free()
+ self.expect(Event.LINK_FINAL, Event.SESSION_FINAL)
self.transport.unbind()
- self.expect(Event.LINK_FINAL, Event.SESSION_FINAL, Event.CONNECTION_UNBOUND, Event.CONNECTION_FINAL)
+ self.expect(Event.CONNECTION_UNBOUND, Event.CONNECTION_FINAL)
def testLocalRemoteLeak(self):
self.doLeak(True, True)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[11/25] qpid-proton git commit: NO-JIRA: export.sh creates pax-based
tar
Posted by ro...@apache.org.
NO-JIRA: export.sh creates pax-based tar
Having switched to using git-archive, we end up creating a tar that uses
the PAX-based scheme for supporting long pathnames. This causes issues
for a number of extraction tools (ant, 7-zip, etc.) which only support
the GNU tar format. We should stick with GNU tar, as used for previous
qpid-proton releases.
Also update the script to revert to using a suffix of .tar.gz (rather
than .tgz) for the source distribution.
Closes #14
(cherry picked from commit ea9ca783cd7e7516f37f23b661ae27ba326b128b)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/fc1d75ac
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/fc1d75ac
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/fc1d75ac
Branch: refs/heads/0.9.x
Commit: fc1d75ace8a1e2bae516abc558d56881f13c42c0
Parents: 91b7ef1
Author: Dominic Evans <do...@uk.ibm.com>
Authored: Mon Mar 30 12:44:16 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Apr 24 15:41:31 2015 +0100
----------------------------------------------------------------------
bin/export.sh | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/fc1d75ac/bin/export.sh
----------------------------------------------------------------------
diff --git a/bin/export.sh b/bin/export.sh
index a0d7568..85ef2c7 100755
--- a/bin/export.sh
+++ b/bin/export.sh
@@ -20,6 +20,8 @@
#
# export.sh - Create a release archive.
+set -e
+trap "cleanup" 0 1 2 3 9 11 13 15
ME=$(basename ${0})
SRC=$(dirname $(dirname $(readlink -f $0)))
@@ -30,6 +32,13 @@ usage()
exit 1
}
+cleanup()
+{
+ trap - 0 1 2 3 9 11 13 15
+ echo
+ [ ${WORKDIR} ] && [ -d ${WORKDIR} ] && rm -rf ${WORKDIR}
+}
+
if [ $# == 1 ]; then
DIR=$1
elif [ $# == 0 ]; then
@@ -38,12 +47,22 @@ else
usage
fi
+WORKDIR=$(mktemp -d)
+
##
## Create the archive
##
(
cd ${SRC}
TAG=$(git describe --tags --always)
- ARCHIVE=$DIR/qpid-proton-${TAG}.tgz
- git archive --format=tgz --prefix=qpid-proton-${TAG}/ ${TAG} -o ${ARCHIVE}
+ MTIME=$(date -d @`git log -1 --pretty=format:%ct tags/${TAG}` '+%Y-%m-%d %H:%M:%S')
+ ARCHIVE=$DIR/qpid-proton-${TAG}.tar.gz
+ [ -d ${WORKDIR} ] || mkdir -p ${WORKDIR}
+ git archive --format=tar --prefix=qpid-proton-${TAG}/ tags/${TAG} \
+ | tar -x -C ${WORKDIR}
+ cd ${WORKDIR}
+ tar -c -z \
+ --owner=root --group=root --numeric-owner \
+ --mtime="${MTIME}" \
+ -f ${ARCHIVE} .
)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org