.gear/rules | 2 + .../tags/398f2f84c5b0020f318d1b82c21a45301165907e | 6 ++ .gear/tags/list | 1 + CMakeLists.txt | 5 +- CMakeModules/GenerateExportHeader.cmake | 21 ++-- include/openobex/obex_const.h | 4 + lib/CMakeLists.txt | 2 - lib/api.c | 2 +- lib/obex_client.c | 11 ++ lib/obex_object.c | 23 ++-- lib/transport/irobex.c | 1 + libopenobex.spec | 118 +++++++++++++++++++++ 12 files changed, 169 insertions(+), 27 deletions(-) diff --git a/.gear/rules b/.gear/rules new file mode 100644 index 0000000..4fcfd99 --- /dev/null +++ b/.gear/rules @@ -0,0 +1,2 @@ +tar: @version@:. +diff: @version@:. . diff --git a/.gear/tags/398f2f84c5b0020f318d1b82c21a45301165907e b/.gear/tags/398f2f84c5b0020f318d1b82c21a45301165907e new file mode 100644 index 0000000..0207325 --- /dev/null +++ b/.gear/tags/398f2f84c5b0020f318d1b82c21a45301165907e @@ -0,0 +1,6 @@ +object 9084eff99f7841502c545ad32fe980528acdbd18 +type commit +tag 1.7.1 +tagger Hendrik Sattler 1374428411 +0200 + +Releasing OpenOBEX-1.7.1 diff --git a/.gear/tags/list b/.gear/tags/list new file mode 100644 index 0000000..e5cc09a --- /dev/null +++ b/.gear/tags/list @@ -0,0 +1 @@ +398f2f84c5b0020f318d1b82c21a45301165907e 1.7.1 diff --git a/CMakeLists.txt b/CMakeLists.txt index cd5a20c..8c63427 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ cmake_minimum_required ( VERSION 2.8.5 FATAL_ERROR ) +set ( CMAKE_POLICY_DEFAULT_CMP0022 OLD ) +cmake_policy ( VERSION 2.8.5 ) + project ( openobex C ) # @@ -35,7 +38,7 @@ include ( GNUInstallDirs ) # This module currently expects C++ to be enabled in CMake-2.8.10. include ( GenerateExportHeader ) -add_compiler_export_flags ( COMPILER_FLAG_VISIBILITY ) +add_compiler_export_flags ( C ) # # define how to build libraries diff --git a/CMakeModules/GenerateExportHeader.cmake b/CMakeModules/GenerateExportHeader.cmake index 1f26bf0..8547048 100644 --- a/CMakeModules/GenerateExportHeader.cmake +++ b/CMakeModules/GenerateExportHeader.cmake @@ -374,16 +374,9 @@ function(GENERATE_EXPORT_HEADER TARGET_LIBRARY) _do_generate_export_header(${TARGET_LIBRARY} ${ARGN}) endfunction() -function(add_compiler_export_flags) - if(DEFINED CMAKE_CXX_COMPILER) - _test_compiler_hidden_visibility(CXX) - _test_compiler_has_deprecated(CXX) - elseif(DEFINED CMAKE_C_COMPILER) - _test_compiler_hidden_visibility(C) - _test_compiler_has_deprecated(C) - else() - message ( FATAL_ERROR "No supported language enabled." ) - endif() +function(add_compiler_export_flags lang) + _test_compiler_hidden_visibility(lang) + _test_compiler_has_deprecated(lang) if(NOT (USE_COMPILER_HIDDEN_VISIBILITY AND COMPILER_HAS_HIDDEN_VISIBILITY)) # Just return if there are no flags to add. @@ -392,15 +385,15 @@ function(add_compiler_export_flags) set (EXTRA_FLAGS "-fvisibility=hidden") - if(COMPILER_HAS_HIDDEN_INLINE_VISIBILITY) + if(lang STREQUAL "CXX" AND COMPILER_HAS_HIDDEN_INLINE_VISIBILITY) set (EXTRA_FLAGS "${EXTRA_FLAGS} -fvisibility-inlines-hidden") endif() # Either return the extra flags needed in the supplied argument, or to the # CMAKE_CXX_FLAGS if no argument is supplied. - if(ARGV0) - set(${ARGV0} "${EXTRA_FLAGS}" PARENT_SCOPE) + if(ARGV1) + set(${ARGV1} "${EXTRA_FLAGS}" PARENT_SCOPE) else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS}" PARENT_SCOPE) + set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} ${EXTRA_FLAGS}" PARENT_SCOPE) endif() endfunction() diff --git a/include/openobex/obex_const.h b/include/openobex/obex_const.h index 63d9698..beb372c 100644 --- a/include/openobex/obex_const.h +++ b/include/openobex/obex_const.h @@ -184,6 +184,10 @@ enum obex_event { OBEX_EV_UNEXPECTED = 10, /** First packet of an incoming request has been parsed */ OBEX_EV_REQCHECK = 11, + /** A Continue response was received and a new request is about to be sent. + * CancelRequest() can be used to stop the request processing. + */ + OBEX_EV_CONTINUE = 12, }; /* For OBEX_Init() */ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index b8f068e..8ebcd39 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -8,7 +8,6 @@ set ( openobex_PROPERTIES VERSION SOVERSION COMPILE_DEFINITIONS - COMPILE_FLAGS LINK_FLAGS ) @@ -132,7 +131,6 @@ if ( OPENOBEX_USB ) ) endif ( OPENOBEX_USB ) -set ( openobex_COMPILE_FLAGS "${openobex_COMPILE_FLAGS} ${COMPILER_FLAG_VISIBILITY}" ) set ( openobex_LINK_FLAGS "${openobex_LINK_FLAGS} ${LINKER_FLAG_NOUNDEFINED}" ) if ( WIN32 ) diff --git a/lib/api.c b/lib/api.c index e1956fa..c8cfcb1 100644 --- a/lib/api.c +++ b/lib/api.c @@ -1036,7 +1036,7 @@ int CALLAPI IrOBEX_TransportConnect(obex_t *self, const char *service) err = OBEX_EnumerateInterfaces(self); if (err <= 0) - return err; + return -1; intf = OBEX_GetInterfaceByIndex(self, 0); intf->irda.service = service; diff --git a/lib/obex_client.c b/lib/obex_client.c index 75868aa..f5b0f5a 100644 --- a/lib/obex_client.c +++ b/lib/obex_client.c @@ -188,7 +188,18 @@ static result_t obex_client_response_rx(obex_t *self) /* Are we done yet? */ if (rsp == OBEX_RSP_CONTINUE) { + enum obex_cmd cmd = self->object->cmd; + DEBUG(3, "Continue...\n"); + obex_deliver_event(self, OBEX_EV_CONTINUE, cmd, rsp, false); + + /* Return if the user cancelled the request without sending ABORT. + * If ABORT is being sent, we continue as usual and let the normal + * tx_prepare() handle it. + */ + if (self->object == NULL) + return RESULT_SUCCESS; + self->substate = SUBSTATE_TX_PREPARE; return obex_client_response_tx_prepare(self); diff --git a/lib/obex_object.c b/lib/obex_object.c index 9bac04a..7c230cd 100644 --- a/lib/obex_object.c +++ b/lib/obex_object.c @@ -196,15 +196,20 @@ int obex_object_addheader(obex_t *self, obex_object_t *object, uint8_t hi, if (id == OBEX_HDR_ID_BODY) { if (flags & OBEX_FL_STREAM_DATAEND) { /* End of stream marker */ - if (object->body == NULL) - return -1; - /* Set the remaining data on the BODY header... */ - obex_hdr_set_data(object->body, hv.bs, hv_size); - obex_hdr_stream_finish(object->body); - object->body = NULL; - /* ...and add the BODY_END header to the end */ - hdr = obex_hdr_ptr_create(OBEX_HDR_ID_BODY_END, - OBEX_HDR_TYPE_BYTES, NULL, 0); + if (object->body == NULL) { + /* A body with a single chunk. */ + hdr = obex_hdr_ptr_create(OBEX_HDR_ID_BODY_END, OBEX_HDR_TYPE_BYTES, hv.bs, hv_size); + hdr = obex_hdr_stream_create(self, hdr); + obex_hdr_stream_finish(hdr); + } else { + /* Set the remaining data on the BODY header... */ + obex_hdr_set_data(object->body, hv.bs, hv_size); + obex_hdr_stream_finish(object->body); + object->body = NULL; + /* ...and add the BODY_END header to the end */ + hdr = obex_hdr_ptr_create(OBEX_HDR_ID_BODY_END, + OBEX_HDR_TYPE_BYTES, NULL, 0); + } ret = 1; goto out; diff --git a/lib/transport/irobex.c b/lib/transport/irobex.c index b68a8fc..64a329c 100644 --- a/lib/transport/irobex.c +++ b/lib/transport/irobex.c @@ -184,6 +184,7 @@ static bool irobex_select_interface(obex_t *self, obex_interface_t *intf) /* local address */ memset(&addr, 0, sizeof(addr)); addr.sir_family = AF_IRDA; + addr.sir_lsap_sel = LSAP_ANY; #ifndef _WIN32 addr.sir_addr = intf->irda.local; #else diff --git a/libopenobex.spec b/libopenobex.spec new file mode 100644 index 0000000..656c0cc --- /dev/null +++ b/libopenobex.spec @@ -0,0 +1,118 @@ +Name: libopenobex +Version: 1.7.1 +Release: alt2 + +Summary: OpenOBEX - Free implementation of the Object Exchange protocol +License: LGPL +Group: System/Libraries +URL: http://openobex.sourceforge.net +Packager: Valery Inozemtsev + +Source: %name-%version.tar +Patch: %name-%version-%release.patch + +BuildRequires: gcc-c++ cmake libbluez-devel libusb-devel libudev-devel +BuildRequires: doxygen xmlto + +%description +OpenOBEX - Free implementation of the Object Exchange protocol + +%package devel +Summary: Development files of OpenOBEX libraries +Group: Development/C +Requires: %name = %version-%release + +%description devel +This package contains development files of Open OBEX library + +%define _pkgdocdir %_docdir/%name-%version + +%prep +%setup +%patch -p1 +# fix udev rule +#subst 's|GROUP=\"plugdev\"|ENV{ID_MEDIA_PLAYER}="1"|' udev/openobex.rules.in +sed -i 's|MODE="660", GROUP="plugdev"|TAG+="uaccess"|' udev/openobex.rules.in + +%build +%cmake -DCMAKE_INSTALL_DOCDIR=%_pkgdocdir +%cmake_build + +%install +%cmakeinstall_std +cp AUTHORS ChangeLog README %buildroot%_pkgdocdir + +%files +%_sbindir/obex-check-device +%_libdir/*.so.* +%_udevrulesdir/60-openobex.rules +%doc %_pkgdocdir/AUTHORS +%doc %_pkgdocdir/ChangeLog +%doc %_pkgdocdir/README + +%files devel +%_includedir/* +%_libdir/*.so +%_pkgconfigdir/*.pc +%_libdir/cmake/OpenObex-1.7.1/openobex-config-version.cmake +%_libdir/cmake/OpenObex-1.7.1/openobex-config.cmake +%_libdir/cmake/OpenObex-1.7.1/openobex-target-release.cmake +%_libdir/cmake/OpenObex-1.7.1/openobex-target.cmake +%doc %_pkgdocdir/html/ + +%changelog +* Mon Jan 19 2015 Yuri N. Sedunov 1.7.1-alt2 +- fixed incorrect udev.rules + +* Sat Dec 06 2014 Yuri N. Sedunov 1.7.1-alt1 +- 1.7.1 + +* Thu Aug 09 2012 Valery Inozemtsev 1.6-alt1 +- 1.6 + +* Sun Dec 05 2010 Valery Inozemtsev 1.5-alt3 +- updated build dependencies + +* Thu Jun 11 2009 Valery Inozemtsev 1.5-alt2 +- updated build dependencies + +* Mon Mar 23 2009 Pavlov Konstantin 1.5-alt1 +- 1.5 release. + +* Thu Nov 20 2008 Pavlov Konstantin 1.4-alt1 +- 1.4 release. +- Removed %%post/%%postun stuff. + +* Mon Jan 28 2008 Pavlov Konstantin 1.3-alt2 +- Fix #14024. + +* Fri Aug 11 2006 Pavlov Konstantin 1.3-alt1 +- 1.3 version. +- Added libusb-devel, pkg-config and xmlto to BuildRequires. +- Removed -config from %%files section as it doesn't exist anymore. +- Rewrote %%descriptions and %%summaries. +- Build docs (thx vsu@). +- Substited Copyright tag with License. +- Fixed Requires. +- s/relaname/realname. +- Fixed %%post and %%postun. +- Added a switch to deal with static. Default: off. + +* Wed Feb 01 2006 Anton Farygin 1.0.1-alt2.1 +- NMU: fixed build for x86_64 (added autoreconf into build section) + +* Fri Dec 12 2003 Grigory Milev 1.0.1-alt2 +- remove *.la files due policy + +* Wed Oct 22 2003 Grigory Milev 1.0.1-alt1 +- new version released + +* Thu Apr 17 2003 Grigory Milev 1.0.0-alt2 +- move static devellibraries to separate package + +* Tue Jan 21 2003 Grigory Milev 1.0.0-alt1 +- new version released + +* Tue Dec 10 2002 Grigory Milev 0.9.8-alt1 +- Initial build +