qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject svn commit: r1368123 - in /qpid/proton/branches/driver_abstraction: ./ examples/ruby/ proton-c/ proton-c/bindings/ proton-c/bindings/php/ proton-c/bindings/python/ proton-c/bindings/ruby/ proton-c/docs/api/ proton-c/include/proton/ proton-c/src/codec/ ...
Date Wed, 01 Aug 2012 16:57:29 GMT
Author: kgiusti
Date: Wed Aug  1 16:57:28 2012
New Revision: 1368123

URL: http://svn.apache.org/viewvc?rev=1368123&view=rev
Log:
NO-JIRA: sync to latest trunk

Added:
    qpid/proton/branches/driver_abstraction/.gitignore
      - copied unchanged from r1368118, qpid/proton/trunk/.gitignore
    qpid/proton/branches/driver_abstraction/examples/ruby/
      - copied from r1368118, qpid/proton/trunk/examples/ruby/
    qpid/proton/branches/driver_abstraction/proton-c/bindings/ruby/
      - copied from r1368118, qpid/proton/trunk/proton-c/bindings/ruby/
    qpid/proton/branches/driver_abstraction/tests/proton_tests/sasl.py
      - copied unchanged from r1368118, qpid/proton/trunk/tests/proton_tests/sasl.py
Modified:
    qpid/proton/branches/driver_abstraction/   (props changed)
    qpid/proton/branches/driver_abstraction/config.sh
    qpid/proton/branches/driver_abstraction/proton-c/CMakeLists.txt
    qpid/proton/branches/driver_abstraction/proton-c/bindings/CMakeLists.txt
    qpid/proton/branches/driver_abstraction/proton-c/bindings/php/CMakeLists.txt
    qpid/proton/branches/driver_abstraction/proton-c/bindings/python/CMakeLists.txt
    qpid/proton/branches/driver_abstraction/proton-c/bindings/python/python.i
    qpid/proton/branches/driver_abstraction/proton-c/docs/api/CMakeLists.txt
    qpid/proton/branches/driver_abstraction/proton-c/include/proton/buffer.h
    qpid/proton/branches/driver_abstraction/proton-c/include/proton/codec.h
    qpid/proton/branches/driver_abstraction/proton-c/include/proton/driver.h
    qpid/proton/branches/driver_abstraction/proton-c/include/proton/engine.h
    qpid/proton/branches/driver_abstraction/proton-c/include/proton/error.h
    qpid/proton/branches/driver_abstraction/proton-c/include/proton/framing.h
    qpid/proton/branches/driver_abstraction/proton-c/include/proton/message.h
    qpid/proton/branches/driver_abstraction/proton-c/include/proton/messenger.h
    qpid/proton/branches/driver_abstraction/proton-c/include/proton/parser.h
    qpid/proton/branches/driver_abstraction/proton-c/include/proton/sasl.h
    qpid/proton/branches/driver_abstraction/proton-c/include/proton/scanner.h
    qpid/proton/branches/driver_abstraction/proton-c/include/proton/types.h
    qpid/proton/branches/driver_abstraction/proton-c/include/proton/util.h
    qpid/proton/branches/driver_abstraction/proton-c/src/codec/codec.c
    qpid/proton/branches/driver_abstraction/proton-c/src/sasl/sasl.c
    qpid/proton/branches/driver_abstraction/tests/proton_tests/__init__.py

Propchange: qpid/proton/branches/driver_abstraction/
------------------------------------------------------------------------------
  Merged /qpid/proton/trunk:r1359741-1368118

Modified: qpid/proton/branches/driver_abstraction/config.sh
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/config.sh?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/config.sh (original)
+++ qpid/proton/branches/driver_abstraction/config.sh Wed Aug  1 16:57:28 2012
@@ -22,13 +22,22 @@ export PROTON_HOME=$(dirname $(readlink 
 
 if [ -z "$CPROTON_BUILD" ]; then
     if [ -d $PROTON_HOME/proton-c/build ]; then
-        export PYTHON_BINDINGS=$PROTON_HOME/proton-c/build/bindings/python
+        PROTON_BINDINGS=$PROTON_HOME/proton-c/build/bindings
     else
-        export PYTHON_BINDINGS=$PROTON_HOME/proton-c/bindings/python
+        PROTON_BINDINGS=$PROTON_HOME/proton-c/bindings
     fi
 else
-    export PYTHON_BINDINGS=$CPROTON_BUILD/bindings/python
+    PROTON_BINDINGS=$CPROTON_BUILD/bindings
 fi
 
+# Python & Jython
+export PYTHON_BINDINGS=$PROTON_BINDINGS/python
 export PYTHONPATH=$PROTON_HOME/tests:$PROTON_HOME/proton-c:$PYTHON_BINDINGS
 export JYTHONPATH=$PROTON_HOME/tests:$PROTON_HOME/proton-j:$PROTON_HOME/proton-j/dist/lib/qpidproton.jar
+
+# PHP
+export PHP_BINDINGS=$PROTON_BINDINGS/php
+
+# Ruby
+export RUBY_BINDINGS=$PROTON_BINDINGS/ruby
+export RUBYLIB=$RUBY_BINDINGS

Modified: qpid/proton/branches/driver_abstraction/proton-c/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/CMakeLists.txt?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/CMakeLists.txt (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/CMakeLists.txt Wed Aug  1 16:57:28 2012
@@ -1,6 +1,6 @@
 cmake_minimum_required (VERSION 2.6)
 
-project (Proton)
+project (Proton C)
 
 set (PN_VERSION_MAJOR 0)
 set (PN_VERSION_MINOR 1)
@@ -52,10 +52,9 @@ endif (POLLER STREQUAL poll)
 
 
 add_library (
-  qpidproton SHARED
+  qpid-proton SHARED
 
   src/util.c
-  src/driver.c
   src/error.c
   src/buffer.c
   src/parser.c
@@ -73,31 +72,36 @@ add_library (
 
   ${PROJECT_BINARY_DIR}/encodings.h
   ${PROJECT_BINARY_DIR}/protocol.h
+)
 
+add_library (
+  qpid-proton-posix SHARED
+
+  src/driver.c
   src/messenger.c
 
   ${pn_driver_impl}
 )
 
-include(FindSWIG)
+find_package(SWIG)
 if (SWIG_FOUND)
   add_subdirectory(bindings)
 endif (SWIG_FOUND)
 
 add_executable (proton src/proton.c)
-target_link_libraries (proton qpidproton ${LINK_DEPS})
+target_link_libraries (proton qpid-proton qpid-proton-posix ${LINK_DEPS})
 
 add_executable (proton-dump src/proton-dump.c)
-target_link_libraries (proton-dump qpidproton ${LINK_DEPS})
+target_link_libraries (proton-dump qpid-proton)
 
 add_subdirectory(docs/api)
 
 set_target_properties (
-  qpidproton proton proton-dump
+  qpid-proton qpid-proton-posix proton proton-dump
   PROPERTIES
   COMPILE_FLAGS "-Wall -Werror -pedantic-errors -std=c99 -g -Iinclude -fPIC"
 )
 
-install (TARGETS proton qpidproton
+install (TARGETS proton proton-dump qpid-proton qpid-proton-posix
          RUNTIME DESTINATION bin
          LIBRARY DESTINATION lib)

Modified: qpid/proton/branches/driver_abstraction/proton-c/bindings/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/bindings/CMakeLists.txt?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/bindings/CMakeLists.txt (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/bindings/CMakeLists.txt Wed Aug  1 16:57:28
2012
@@ -19,16 +19,24 @@
 
 include(UseSWIG)
 
+set (BINDING_DEPS qpid-proton qpid-proton-posix ${LINK_DEPS})
+
 # Build wrapper for Python:
-# @todo: conditionalize on whether python is available!
-add_subdirectory(python)
+find_package (PythonLibs)
+if (PYTHONLIBS_FOUND)
+  add_subdirectory(python)
+endif (PYTHONLIBS_FOUND)
+
+# Build wrapper for Ruby:
+find_package(Ruby)
+if (RUBY_FOUND)
+  add_subdirectory(ruby)
+endif (RUBY_FOUND)
 
 # Build wrapper for PHP
 # For now, assume PHP support if the 'php-config' tool is present.
 # @todo: allow user to specify which php-config if multiple PHP sources installed!
-
-FIND_PROGRAM(PHP_CONFIG_EXE php-config)
-IF(PHP_CONFIG_EXE)
+find_program(PHP_CONFIG_EXE php-config)
+if (PHP_CONFIG_EXE)
   add_subdirectory(php)
-ENDIF(PHP_CONFIG_EXE)
-
+endif (PHP_CONFIG_EXE)

Modified: qpid/proton/branches/driver_abstraction/proton-c/bindings/php/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/bindings/php/CMakeLists.txt?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/bindings/php/CMakeLists.txt (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/bindings/php/CMakeLists.txt Wed Aug 
1 16:57:28 2012
@@ -24,17 +24,27 @@
 # Uses the php-config command line tool from PHP to extract the location of the PHP header
 # files
 
-EXECUTE_PROCESS(COMMAND ${PHP_CONFIG_EXE} --includes
+execute_process(COMMAND ${PHP_CONFIG_EXE} --includes
                 OUTPUT_VARIABLE PHP_INCLUDES
                 RESULT_VARIABLE retval
                 ERROR_VARIABLE  errmsg
                 OUTPUT_STRIP_TRAILING_WHITESPACE)
-IF (NOT ${retval} EQUAL 0)
-   MESSAGE(SEND_ERROR "Command \"${PHP_CONFIG_EXE} --include\" failed with output:\n${errmsg}")
-ELSE()
-   #MESSAGE(STATUS "PHP_INCLUDES=[${PHP_INCLUDES}]")
-   set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/php.i PROPERTIES SWIG_FLAGS "-I${PROJECT_SOURCE_DIR}/include")
-   swig_add_module(cproton php ${CMAKE_CURRENT_SOURCE_DIR}/php.i)
-   set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "${PHP_INCLUDES}")
-   swig_link_libraries(cproton qpidproton ${LINK_DEPS})
-ENDIF()
+
+set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/php.i PROPERTIES SWIG_FLAGS "-I${PROJECT_SOURCE_DIR}/include")
+swig_add_module(cproton php ${CMAKE_CURRENT_SOURCE_DIR}/php.i)
+set_target_properties(cproton PROPERTIES PREFIX "")
+set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "${PHP_INCLUDES}")
+swig_link_libraries(cproton ${BINDING_DEPS})
+
+execute_process(COMMAND ${PHP_CONFIG_EXE} --extension-dir
+                OUTPUT_VARIABLE PHP_EXT_DIR
+                OUTPUT_STRIP_TRAILING_WHITESPACE)
+execute_process(COMMAND ${PHP_CONFIG_EXE} --prefix
+                OUTPUT_VARIABLE PHP_PFX
+                OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+string(REPLACE ${PHP_PFX} ${CMAKE_INSTALL_PREFIX} PHP_REL_EXT_DIR ${PHP_EXT_DIR})
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton.so
+        DESTINATION ${PHP_REL_EXT_DIR}
+        COMPONENT PHP)

Modified: qpid/proton/branches/driver_abstraction/proton-c/bindings/python/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/bindings/python/CMakeLists.txt?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/bindings/python/CMakeLists.txt (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/bindings/python/CMakeLists.txt Wed Aug
 1 16:57:28 2012
@@ -1,7 +1,26 @@
-find_package (PythonLibs)
-
 set(CMAKE_SWIG_FLAGS "-threads")
 
 swig_add_module(cproton python python.i)
 include_directories (${PYTHON_INCLUDE_PATH})
-swig_link_libraries(cproton qpidproton ${LINK_DEPS} ${PYTHON_LIBRARIES})
+swig_link_libraries(cproton ${BINDING_DEPS} ${PYTHON_LIBRARIES})
+
+find_package(PythonInterp REQUIRED)
+
+execute_process(COMMAND ${PYTHON_EXECUTABLE}
+                -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True,
prefix='${CMAKE_INSTALL_PREFIX}')"
+                OUTPUT_VARIABLE PYTHON_SITEARCH_PACKAGES
+                OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile cproton.py
+                              WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile cproton.py
+                              WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton.py
+              ${CMAKE_CURRENT_BINARY_DIR}/cproton.pyc
+              ${CMAKE_CURRENT_BINARY_DIR}/cproton.pyo
+        DESTINATION ${PYTHON_SITEARCH_PACKAGES}
+        COMPONENT Python)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_cproton.so
+        RENAME _cproton.so
+        DESTINATION ${PYTHON_SITEARCH_PACKAGES}
+        COMPONENT Python)

Modified: qpid/proton/branches/driver_abstraction/proton-c/bindings/python/python.i
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/bindings/python/python.i?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/bindings/python/python.i (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/bindings/python/python.i Wed Aug  1 16:57:28
2012
@@ -104,6 +104,23 @@ ssize_t pn_input(pn_transport_t *transpo
 %}
 %ignore pn_output;
 
+ssize_t pn_sasl_input(pn_sasl_t *sasl, char *STRING, size_t LENGTH);
+%ignore pn_sasl_input;
+
+%rename(pn_sasl_output) wrap_pn_sasl_output;
+%inline %{
+  int wrap_pn_sasl_output(pn_sasl_t *sasl, char *OUTPUT, size_t *OUTPUT_SIZE) {
+    ssize_t sz = pn_sasl_output(sasl, OUTPUT, *OUTPUT_SIZE);
+    if (sz >= 0) {
+      *OUTPUT_SIZE = sz;
+    } else {
+      *OUTPUT_SIZE = 0;
+    }
+    return sz;
+  }
+%}
+%ignore pn_sasl_output;
+
 %rename(pn_delivery) wrap_pn_delivery;
 %inline %{
   pn_delivery_t *wrap_pn_delivery(pn_link_t *link, char *STRING, size_t LENGTH) {

Modified: qpid/proton/branches/driver_abstraction/proton-c/docs/api/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/docs/api/CMakeLists.txt?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/docs/api/CMakeLists.txt (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/docs/api/CMakeLists.txt Wed Aug  1 16:57:28
2012
@@ -17,19 +17,20 @@
 # under the License.
 #
 
-include(FindDoxygen)
+find_package(Doxygen)
 if (DOXYGEN_FOUND)
-    configure_file (${CMAKE_CURRENT_SOURCE_DIR}/user.doxygen.in
-                    ${CMAKE_CURRENT_BINARY_DIR}/user.doxygen)
-    add_custom_target (docs-user-api COMMAND ${DOXYGEN_EXECUTABLE} user.doxygen)
+  configure_file (${CMAKE_CURRENT_SOURCE_DIR}/user.doxygen.in
+                  ${CMAKE_CURRENT_BINARY_DIR}/user.doxygen)
+  add_custom_target (docs COMMAND ${DOXYGEN_EXECUTABLE} user.doxygen)
 
-    # HTML files are generated to ./html - put those in the install.
-    install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
-             DESTINATION docs/api
-             COMPONENT documentation)
-    # if (CPACK_GENERATOR STREQUAL "NSIS")
-    #     set (CPACK_NSIS_MENU_LINKS
-    #          "${QPID_INSTALL_HTMLDIR}/index.html" "Qpid C++ API Documentation"
-    #          "https://issues.apache.org/jira/browse/QPID" "Report Qpid Problem")
-    # endif (CPACK_GENERATOR STREQUAL "NSIS")
+  # HTML files are generated to ./html - put those in the install.
+  install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
+           DESTINATION docs/api
+           COMPONENT documentation
+           OPTIONAL)
+  # if (CPACK_GENERATOR STREQUAL "NSIS")
+  #     set (CPACK_NSIS_MENU_LINKS
+  #          "${QPID_INSTALL_HTMLDIR}/index.html" "Qpid C++ API Documentation"
+  #          "https://issues.apache.org/jira/browse/QPID" "Report Qpid Problem")
+  # endif (CPACK_GENERATOR STREQUAL "NSIS")
 endif (DOXYGEN_FOUND)

Modified: qpid/proton/branches/driver_abstraction/proton-c/include/proton/buffer.h
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/include/proton/buffer.h?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/include/proton/buffer.h (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/include/proton/buffer.h Wed Aug  1 16:57:28
2012
@@ -1,5 +1,5 @@
-#ifndef _PROTON_BUFFER_H
-#define _PROTON_BUFFER_H 1
+#ifndef PROTON_BUFFER_H
+#define PROTON_BUFFER_H 1
 
 /*
  *

Modified: qpid/proton/branches/driver_abstraction/proton-c/include/proton/codec.h
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/include/proton/codec.h?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/include/proton/codec.h (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/include/proton/codec.h Wed Aug  1 16:57:28
2012
@@ -1,5 +1,5 @@
-#ifndef _PROTON_CODEC_H
-#define _PROTON_CODEC_H 1
+#ifndef PROTON_CODEC_H
+#define PROTON_CODEC_H 1
 
 /*
  *

Modified: qpid/proton/branches/driver_abstraction/proton-c/include/proton/driver.h
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/include/proton/driver.h?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/include/proton/driver.h (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/include/proton/driver.h Wed Aug  1 16:57:28
2012
@@ -1,5 +1,5 @@
-#ifndef _PROTON_DRIVER_H
-#define _PROTON_DRIVER_H 1
+#ifndef PROTON_DRIVER_H
+#define PROTON_DRIVER_H 1
 
 /*
  *

Modified: qpid/proton/branches/driver_abstraction/proton-c/include/proton/engine.h
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/include/proton/engine.h?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/include/proton/engine.h (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/include/proton/engine.h Wed Aug  1 16:57:28
2012
@@ -1,5 +1,5 @@
-#ifndef _PROTON_ENGINE_H
-#define _PROTON_ENGINE_H 1
+#ifndef PROTON_ENGINE_H
+#define PROTON_ENGINE_H 1
 
 /*
  *
@@ -86,7 +86,7 @@ typedef int pn_trace_t;
  *
  * @return pointer to a new connection object.
  */
-pn_connection_t *pn_connection();
+pn_connection_t *pn_connection(void);
 
 /** Retrieve the state of the connection.
  *

Modified: qpid/proton/branches/driver_abstraction/proton-c/include/proton/error.h
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/include/proton/error.h?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/include/proton/error.h (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/include/proton/error.h Wed Aug  1 16:57:28
2012
@@ -1,5 +1,5 @@
-#ifndef _PROTON_ERROR_H
-#define _PROTON_ERROR_H 1
+#ifndef PROTON_ERROR_H
+#define PROTON_ERROR_H 1
 
 /*
  *

Modified: qpid/proton/branches/driver_abstraction/proton-c/include/proton/framing.h
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/include/proton/framing.h?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/include/proton/framing.h (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/include/proton/framing.h Wed Aug  1 16:57:28
2012
@@ -1,5 +1,5 @@
-#ifndef _PROTON_FRAMING_H
-#define _PROTON_FRAMING_H 1
+#ifndef PROTON_FRAMING_H
+#define PROTON_FRAMING_H 1
 
 /*
  *

Modified: qpid/proton/branches/driver_abstraction/proton-c/include/proton/message.h
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/include/proton/message.h?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/include/proton/message.h (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/include/proton/message.h Wed Aug  1 16:57:28
2012
@@ -1,5 +1,5 @@
-#ifndef _PROTON_MESSAGE_H
-#define _PROTON_MESSAGE_H 1
+#ifndef PROTON_MESSAGE_H
+#define PROTON_MESSAGE_H 1
 
 /*
  *

Modified: qpid/proton/branches/driver_abstraction/proton-c/include/proton/messenger.h
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/include/proton/messenger.h?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/include/proton/messenger.h (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/include/proton/messenger.h Wed Aug  1
16:57:28 2012
@@ -1,5 +1,5 @@
-#ifndef _PROTON_MESSENGER_H
-#define _PROTON_MESSENGER_H 1
+#ifndef PROTON_MESSENGER_H
+#define PROTON_MESSENGER_H 1
 
 /*
  *

Modified: qpid/proton/branches/driver_abstraction/proton-c/include/proton/parser.h
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/include/proton/parser.h?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/include/proton/parser.h (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/include/proton/parser.h Wed Aug  1 16:57:28
2012
@@ -1,5 +1,5 @@
-#ifndef _PROTON_PARSER_H
-#define _PROTON_PARSER_H 1
+#ifndef PROTON_PARSER_H
+#define PROTON_PARSER_H 1
 
 /*
  *

Modified: qpid/proton/branches/driver_abstraction/proton-c/include/proton/sasl.h
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/include/proton/sasl.h?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/include/proton/sasl.h (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/include/proton/sasl.h Wed Aug  1 16:57:28
2012
@@ -1,5 +1,5 @@
-#ifndef _PROTON_SASL_H
-#define _PROTON_SASL_H 1
+#ifndef PROTON_SASL_H
+#define PROTON_SASL_H 1
 
 /*
  *

Modified: qpid/proton/branches/driver_abstraction/proton-c/include/proton/scanner.h
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/include/proton/scanner.h?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/include/proton/scanner.h (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/include/proton/scanner.h Wed Aug  1 16:57:28
2012
@@ -1,5 +1,5 @@
-#ifndef _PROTON_SCANNER_H
-#define _PROTON_SCANNER_H 1
+#ifndef PROTON_SCANNER_H
+#define PROTON_SCANNER_H 1
 
 /*
  *

Modified: qpid/proton/branches/driver_abstraction/proton-c/include/proton/types.h
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/include/proton/types.h?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/include/proton/types.h (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/include/proton/types.h Wed Aug  1 16:57:28
2012
@@ -1,5 +1,5 @@
-#ifndef _PROTON_TYPES_H
-#define _PROTON_TYPES_H 1
+#ifndef PROTON_TYPES_H
+#define PROTON_TYPES_H 1
 
 /*
  *

Modified: qpid/proton/branches/driver_abstraction/proton-c/include/proton/util.h
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/include/proton/util.h?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/include/proton/util.h (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/include/proton/util.h Wed Aug  1 16:57:28
2012
@@ -1,5 +1,5 @@
-#ifndef _PROTON_UTIL_H
-#define _PROTON_UTIL_H 1
+#ifndef PROTON_UTIL_H
+#define PROTON_UTIL_H 1
 
 /*
  *

Modified: qpid/proton/branches/driver_abstraction/proton-c/src/codec/codec.c
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/src/codec/codec.c?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/src/codec/codec.c (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/src/codec/codec.c Wed Aug  1 16:57:28
2012
@@ -120,21 +120,21 @@ int pn_format_atom(pn_bytes_t *bytes, pn
   case PN_BOOL:
     return pn_bytes_format(bytes, atom.u.as_bool ? "true" : "false");
   case PN_UBYTE:
-    return pn_bytes_format(bytes, "%u", atom.u.as_ubyte);
+    return pn_bytes_format(bytes, "%" PRIu8, atom.u.as_ubyte);
   case PN_BYTE:
-    return pn_bytes_format(bytes, "%i", atom.u.as_byte);
+    return pn_bytes_format(bytes, "%" PRIi8, atom.u.as_byte);
   case PN_USHORT:
-    return pn_bytes_format(bytes, "%u", atom.u.as_ushort);
+    return pn_bytes_format(bytes, "%" PRIu16, atom.u.as_ushort);
   case PN_SHORT:
-    return pn_bytes_format(bytes, "%i", atom.u.as_short);
+    return pn_bytes_format(bytes, "%" PRIi16, atom.u.as_short);
   case PN_UINT:
-    return pn_bytes_format(bytes, "%u", atom.u.as_uint);
+    return pn_bytes_format(bytes, "%" PRIu32, atom.u.as_uint);
   case PN_INT:
-    return pn_bytes_format(bytes, "%i", atom.u.as_int);
+    return pn_bytes_format(bytes, "%" PRIi32, atom.u.as_int);
   case PN_ULONG:
-    return pn_bytes_format(bytes, "%lu", atom.u.as_ulong);
+    return pn_bytes_format(bytes, "%" PRIu64, atom.u.as_ulong);
   case PN_LONG:
-    return pn_bytes_format(bytes, "%li", atom.u.as_long);
+    return pn_bytes_format(bytes, "%" PRIi64, atom.u.as_long);
   case PN_FLOAT:
     return pn_bytes_format(bytes, "%g", atom.u.as_float);
   case PN_DOUBLE:
@@ -905,7 +905,7 @@ int pn_decode_atom(pn_bytes_t *bytes, pn
 
 int pn_fill_one(pn_atoms_t *atoms, const char *fmt, ...);
 
-int pn_vfill_one(pn_atoms_t *atoms, const char **fmt, va_list ap, bool skip, int *nvals)
+int pn_vfill_one(pn_atoms_t *atoms, const char **fmt, va_list *ap, bool skip, int *nvals)
 {
   int err, count;
   char code = **fmt;
@@ -928,70 +928,70 @@ int pn_vfill_one(pn_atoms_t *atoms, cons
     return 0;
   case 'o':
     atom->type = PN_BOOL;
-    atom->u.as_bool = va_arg(ap, int);
+    atom->u.as_bool = va_arg(*ap, int);
     (*nvals)++;
     return 0;
   case 'B':
     atom->type = PN_UBYTE;
-    atom->u.as_ubyte = va_arg(ap, unsigned int);
+    atom->u.as_ubyte = va_arg(*ap, unsigned int);
     (*nvals)++;
     return 0;
   case 'b':
     atom->type = PN_BYTE;
-    atom->u.as_byte = va_arg(ap, int);
+    atom->u.as_byte = va_arg(*ap, int);
     (*nvals)++;
     return 0;
   case 'H':
     atom->type = PN_USHORT;
-    atom->u.as_ushort = va_arg(ap, unsigned int);
+    atom->u.as_ushort = va_arg(*ap, unsigned int);
     (*nvals)++;
     return 0;
   case 'h':
     atom->type = PN_SHORT;
-    atom->u.as_short = va_arg(ap, int);
+    atom->u.as_short = va_arg(*ap, int);
     (*nvals)++;
     return 0;
   case 'I':
     atom->type = PN_UINT;
-    atom->u.as_uint = va_arg(ap, uint32_t);
+    atom->u.as_uint = va_arg(*ap, uint32_t);
     (*nvals)++;
     return 0;
   case 'i':
     atom->type = PN_INT;
-    atom->u.as_int = va_arg(ap, int32_t);
+    atom->u.as_int = va_arg(*ap, int32_t);
     (*nvals)++;
     return 0;
   case 'L':
     atom->type = PN_ULONG;
-    atom->u.as_ulong = va_arg(ap, uint64_t);
+    atom->u.as_ulong = va_arg(*ap, uint64_t);
     (*nvals)++;
     return 0;
   case 'l':
     atom->type = PN_LONG;
-    atom->u.as_long = va_arg(ap, int64_t);
+    atom->u.as_long = va_arg(*ap, int64_t);
     (*nvals)++;
     return 0;
   case 'f':
     atom->type = PN_FLOAT;
-    atom->u.as_float = va_arg(ap, double);
+    atom->u.as_float = va_arg(*ap, double);
     (*nvals)++;
     return 0;
   case 'd':
     atom->type = PN_DOUBLE;
-    atom->u.as_double = va_arg(ap, double);
+    atom->u.as_double = va_arg(*ap, double);
     (*nvals)++;
     return 0;
   case 'z':
     atom->type = PN_BINARY;
-    atom->u.as_binary.size = va_arg(ap, size_t);
-    atom->u.as_binary.start = va_arg(ap, char *);
+    atom->u.as_binary.size = va_arg(*ap, size_t);
+    atom->u.as_binary.start = va_arg(*ap, char *);
     if (!atom->u.as_binary.start)
       *atom = (pn_atom_t) {PN_NULL, {0}};
     (*nvals)++;
     return 0;
   case 'S':
     atom->type = PN_STRING;
-    atom->u.as_string.start = va_arg(ap, char *);
+    atom->u.as_string.start = va_arg(*ap, char *);
     if (atom->u.as_string.start)
       atom->u.as_string.size = strlen(atom->u.as_string.start);
     else
@@ -1000,7 +1000,7 @@ int pn_vfill_one(pn_atoms_t *atoms, cons
     return 0;
   case 's':
     atom->type = PN_SYMBOL;
-    atom->u.as_symbol.start = va_arg(ap, char *);
+    atom->u.as_symbol.start = va_arg(*ap, char *);
     if (atom->u.as_symbol.start)
       atom->u.as_symbol.size = strlen(atom->u.as_symbol.start);
     else
@@ -1020,7 +1020,7 @@ int pn_vfill_one(pn_atoms_t *atoms, cons
     return 0;
   case 'T':
     atom->type = PN_TYPE;
-    atom->u.type = va_arg(ap, int);
+    atom->u.type = va_arg(*ap, int);
     (*nvals)++;
     return 0;
   case '@':
@@ -1083,7 +1083,7 @@ int pn_vfill_one(pn_atoms_t *atoms, cons
     return 0;
   case '?':
     count = 0;
-    if (va_arg(ap, int)) {
+    if (va_arg(*ap, int)) {
       // rewind atoms by one
       if (!skip) {
         atoms->start--;
@@ -1100,8 +1100,8 @@ int pn_vfill_one(pn_atoms_t *atoms, cons
     return 0;
   case '*':
     {
-      int count = va_arg(ap, int);
-      void *ptr = va_arg(ap, void *);
+      int count = va_arg(*ap, int);
+      void *ptr = va_arg(*ap, void *);
       // rewind atoms by one
       if (!skip) {
         atoms->start--;
@@ -1143,7 +1143,7 @@ int pn_fill_one(pn_atoms_t *atoms, const
   va_list ap;
   va_start(ap, fmt);
   int count = 0;
-  int err = pn_vfill_one(atoms, &fmt, ap, false, &count);
+  int err = pn_vfill_one(atoms, &fmt, &ap, false, &count);
   va_end(ap);
   return err;
 }
@@ -1153,12 +1153,19 @@ int pn_vfill_atoms(pn_atoms_t *atoms, co
   const char *pos = fmt;
   pn_atoms_t copy = *atoms;
   int count = 0;
+  va_list cp;
+  va_copy(cp, ap);
 
   while (*pos) {
-    int err = pn_vfill_one(&copy, &pos, ap, false, &count);
-    if (err) return err;
+    int err = pn_vfill_one(&copy, &pos, &cp, false, &count);
+    if (err) {
+      va_end(cp);
+      return err;
+    }
   }
 
+  va_end(cp);
+
   atoms->size -= copy.size;
   return 0;
 }
@@ -1224,7 +1231,7 @@ int pn_skip(pn_atoms_t *atoms, size_t n)
   return 0;
 }
 
-int pn_scan_one(pn_atoms_t *atoms, const char **fmt, va_list ap, bool *scanned)
+int pn_scan_one(pn_atoms_t *atoms, const char **fmt, va_list *ap, bool *scanned)
 {
   char code = **fmt;
   pn_atom_t *atom = atoms ? atoms->start : NULL;
@@ -1243,7 +1250,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 'o':
     {
-      bool *value = va_arg(ap, bool *);
+      bool *value = va_arg(*ap, bool *);
       if (atom && atom->type == PN_BOOL) {
         *value = atom->u.as_bool;
         *scanned = true;
@@ -1256,7 +1263,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 'B':
     {
-      uint8_t *value = va_arg(ap, uint8_t *);
+      uint8_t *value = va_arg(*ap, uint8_t *);
       if (atom && atom->type == PN_UBYTE) {
         *value = atom->u.as_ubyte;
         *scanned = true;
@@ -1269,7 +1276,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 'b':
     {
-      int8_t *value = va_arg(ap, int8_t *);
+      int8_t *value = va_arg(*ap, int8_t *);
       if (atom && atom->type == PN_BYTE) {
         *value = atom->u.as_byte;
         *scanned = true;
@@ -1282,7 +1289,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 'H':
     {
-      uint16_t *value = va_arg(ap, uint16_t *);
+      uint16_t *value = va_arg(*ap, uint16_t *);
       if (atom && atom->type == PN_USHORT) {
         *value = atom->u.as_ushort;
         *scanned = true;
@@ -1295,7 +1302,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 'h':
     {
-      int16_t *value = va_arg(ap, int16_t *);
+      int16_t *value = va_arg(*ap, int16_t *);
       if (atom && atom->type == PN_SHORT) {
         *value = atom->u.as_short;
         *scanned = true;
@@ -1308,7 +1315,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 'I':
     {
-      uint32_t *value = va_arg(ap, uint32_t *);
+      uint32_t *value = va_arg(*ap, uint32_t *);
       if (atom && atom->type == PN_UINT) {
         *value = atom->u.as_uint;
         *scanned = true;
@@ -1321,7 +1328,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 'i':
     {
-      int32_t *value = va_arg(ap, int32_t *);
+      int32_t *value = va_arg(*ap, int32_t *);
       if (atom && atom->type == PN_INT) {
         *value = atom->u.as_int;
         *scanned = true;
@@ -1334,7 +1341,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 'L':
     {
-      uint64_t *value = va_arg(ap, uint64_t *);
+      uint64_t *value = va_arg(*ap, uint64_t *);
       if (atom && atom->type == PN_ULONG) {
         *value = atom->u.as_ulong;
         *scanned = true;
@@ -1347,7 +1354,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 'l':
     {
-      int64_t *value = va_arg(ap, int64_t *);
+      int64_t *value = va_arg(*ap, int64_t *);
       if (atom && atom->type == PN_LONG) {
         *value = atom->u.as_long;
         *scanned = true;
@@ -1360,7 +1367,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 'f':
     {
-      float *value = va_arg(ap, float *);
+      float *value = va_arg(*ap, float *);
       if (atom && atom->type == PN_FLOAT) {
         *value = atom->u.as_float;
         *scanned = true;
@@ -1373,7 +1380,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 'd':
     {
-      double *value = va_arg(ap, double *);
+      double *value = va_arg(*ap, double *);
       if (atom && atom->type == PN_DOUBLE) {
         *value = atom->u.as_double;
         *scanned = true;
@@ -1386,7 +1393,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 'z':
     {
-      pn_bytes_t *bytes = va_arg(ap, pn_bytes_t *);
+      pn_bytes_t *bytes = va_arg(*ap, pn_bytes_t *);
       if (atom && atom->type == PN_BINARY) {
         *bytes = atom->u.as_binary;
         *scanned = true;
@@ -1399,7 +1406,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 'S':
     {
-      pn_bytes_t *bytes = va_arg(ap, pn_bytes_t *);
+      pn_bytes_t *bytes = va_arg(*ap, pn_bytes_t *);
       if (atom && atom->type == PN_STRING) {
         *bytes = atom->u.as_string;
         *scanned = true;
@@ -1412,7 +1419,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 's':
     {
-      pn_bytes_t *bytes = va_arg(ap, pn_bytes_t *);
+      pn_bytes_t *bytes = va_arg(*ap, pn_bytes_t *);
       if (atom && atom->type == PN_SYMBOL) {
         *bytes = atom->u.as_symbol;
         *scanned = true;
@@ -1450,7 +1457,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
     return 0;
   case 'T':
     if (atom && atom->type == PN_TYPE) {
-      pn_type_t *type = va_arg(ap, pn_type_t *);
+      pn_type_t *type = va_arg(*ap, pn_type_t *);
       *type = atom->u.type;
       *scanned = true;
     } else {
@@ -1577,7 +1584,7 @@ int pn_scan_one(pn_atoms_t *atoms, const
         fprintf(stderr, "codes must follow ?\n");
         return PN_ARG_ERR;
       }
-      bool *sc = va_arg(ap, bool *);
+      bool *sc = va_arg(*ap, bool *);
       err = pn_scan_one(atoms, fmt, ap, sc);
       if (err) return err;
       *scanned = true;
@@ -1603,12 +1610,19 @@ int pn_vscan_atoms(const pn_atoms_t *ato
   pn_atoms_t copy = *atoms;
   const char *pos = fmt;
   bool scanned;
+  va_list cp;
+  va_copy(cp, ap);
 
   while (*pos) {
-    int err = pn_scan_one(&copy, &pos, ap, &scanned);
-    if (err) return err;
+    int err = pn_scan_one(&copy, &pos, &cp, &scanned);
+    if (err) {
+      va_end(cp);
+      return err;
+    }
   }
 
+  va_end(cp);
+
   return 0;
 }
 

Modified: qpid/proton/branches/driver_abstraction/proton-c/src/sasl/sasl.c
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/proton-c/src/sasl/sasl.c?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/proton-c/src/sasl/sasl.c (original)
+++ qpid/proton/branches/driver_abstraction/proton-c/src/sasl/sasl.c Wed Aug  1 16:57:28 2012
@@ -57,7 +57,6 @@ pn_sasl_t *pn_sasl()
 {
   pn_sasl_t *sasl = malloc(sizeof(pn_sasl_t));
   sasl->disp = pn_dispatcher(1, sasl);
-  sasl->disp->batch = false;
 
   pn_dispatcher_action(sasl->disp, SASL_INIT, "SASL-INIT", pn_do_init);
   pn_dispatcher_action(sasl->disp, SASL_MECHANISMS, "SASL-MECHANISMS", pn_do_mechanisms);
@@ -272,6 +271,13 @@ void pn_sasl_process(pn_sasl_t *sasl)
   if (!sasl->client && sasl->outcome != PN_SASL_NONE && !sasl->sent_done)
{
     pn_server_done(sasl);
     sasl->sent_done = true;
+  }
+
+  // XXX: need to finish this check when challenge/response is complete
+  //      check for client is outome is received
+  //      check for server is that there are no pending frames (either init
+  //      or challenges) from client
+  if (!sasl->client && sasl->sent_done && sasl->rcvd_init) {
     sasl->rcvd_done = true;
     sasl->disp->halt = true;
   }
@@ -282,6 +288,8 @@ ssize_t pn_sasl_input(pn_sasl_t *sasl, c
   ssize_t n = pn_dispatcher_input(sasl->disp, bytes, available);
   if (n < 0) return n;
 
+  pn_sasl_process(sasl);
+
   if (sasl->rcvd_done) {
     if (pn_sasl_state(sasl) == PN_SASL_PASS) {
       if (n) {

Modified: qpid/proton/branches/driver_abstraction/tests/proton_tests/__init__.py
URL: http://svn.apache.org/viewvc/qpid/proton/branches/driver_abstraction/tests/proton_tests/__init__.py?rev=1368123&r1=1368122&r2=1368123&view=diff
==============================================================================
--- qpid/proton/branches/driver_abstraction/tests/proton_tests/__init__.py (original)
+++ qpid/proton/branches/driver_abstraction/tests/proton_tests/__init__.py Wed Aug  1 16:57:28
2012
@@ -20,3 +20,4 @@
 import proton_tests.engine
 import proton_tests.message
 import proton_tests.messenger
+import proton_tests.sasl



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message