Hello community, here is the log from the commit of package openobex for openSUSE:Factory checked in at 2017-07-07 10:16:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/openobex (Old) and /work/SRC/openSUSE:Factory/.openobex.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openobex" Fri Jul 7 10:16:59 2017 rev:36 rq:508337 version:1.7.2 Changes: -------- --- /work/SRC/openSUSE:Factory/openobex/openobex.changes 2015-08-27 08:57:13.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.openobex.new/openobex.changes 2017-07-07 10:17:01.758053431 +0200 @@ -1,0 +2,7 @@ +Tue Jul 4 10:17:48 UTC 2017 - [email protected] + +- Version update to 1.7.2: + * Couple of tiny fixes +- Refresh patch xopen-source.patch + +------------------------------------------------------------------- Old: ---- openobex-1.7.1-Source.tar.gz New: ---- openobex-1.7.2-Source.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ openobex.spec ++++++ --- /var/tmp/diff_new_pack.ssN66c/_old 2017-07-07 10:17:02.669924406 +0200 +++ /var/tmp/diff_new_pack.ssN66c/_new 2017-07-07 10:17:02.673923840 +0200 @@ -1,7 +1,7 @@ # # spec file for package openobex # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,10 +17,10 @@ Name: openobex -Version: 1.7.1 +Version: 1.7.2 Release: 0 Summary: Open Source Implementation of the Object Exchange (OBEX) Protocol -License: GPL-2.0+ and LGPL-2.1+ +License: GPL-2.0+ AND LGPL-2.1+ Group: Development/Libraries/Other Url: http://openobex.sourceforge.net/ Source: http://sourceforge.net/projects/%{name}/files/%{name}/%{version}/%{name}-%{version}-Source.tar.gz @@ -35,9 +35,8 @@ BuildRequires: gcc-c++ BuildRequires: libusb-1_0-devel BuildRequires: libxml2-tools -BuildRequires: pkg-config +BuildRequires: pkgconfig BuildRequires: xsltproc -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description OBEX is a session protocol and can best be described as a binary HTTP @@ -47,7 +46,7 @@ %package -n libopenobex2 Summary: Open Source Implementation of the Object Exchange (OBEX) Protocol -License: GPL-2.0+ and LGPL-2.1+ +License: GPL-2.0+ AND LGPL-2.1+ Group: Productivity/Networking/Web/Utilities Provides: %{name} = %{version}-%{release} Obsoletes: %{name} < %{version}-%{release} @@ -60,7 +59,7 @@ %package apps Summary: Open Source Implementation of the Object Exchange (OBEX) Protocol -License: GPL-2.0+ and LGPL-2.1+ +License: GPL-2.0+ AND LGPL-2.1+ Group: Productivity/Networking/Web/Utilities %description apps @@ -98,21 +97,18 @@ %fdupes %{buildroot}%{_docdir} # don't ship obex_test program, that is for testing purposes only # and has some problems (multiple buffer overflows etc.) -rm -f $RPM_BUILD_ROOT%{_bindir}/obex_test -rm -f $RPM_BUILD_ROOT%{_mandir}/man1/obex_test.1* +rm -f %{buildroot}%{_bindir}/obex_test +rm -f %{buildroot}%{_mandir}/man1/obex_test.1* %post -n libopenobex2 -p /sbin/ldconfig - %postun -n libopenobex2 -p /sbin/ldconfig %files -n libopenobex2 -%defattr(-,root,root) # NEWS is empty %doc AUTHORS COPYING COPYING.LIB ChangeLog README %{_libdir}/libopenobex.so.* %files apps -%defattr(-,root,root) %{_bindir}/ircp %{_bindir}/irobex_palm3 %{_bindir}/irxfer @@ -121,7 +117,6 @@ %{_mandir}/man1/* %files devel -%defattr(-,root,root) %dir %{_docdir}/%{name} %{_docdir}/%{name}/* %{_includedir}/openobex/ ++++++ openobex-1.7.1-Source.tar.gz -> openobex-1.7.2-Source.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/CMakeLists.txt new/openobex-1.7.2-Source/CMakeLists.txt --- old/openobex-1.7.1-Source/CMakeLists.txt 2013-07-21 19:25:55.000000000 +0200 +++ new/openobex-1.7.2-Source/CMakeLists.txt 2016-04-07 21:44:12.000000000 +0200 @@ -1,17 +1,9 @@ -cmake_minimum_required ( VERSION 2.8.5 FATAL_ERROR ) +cmake_minimum_required ( VERSION 3.1 FATAL_ERROR ) -project ( openobex C ) - -# -# The project version -# -set ( VERSION_MAJOR 1 ) -set ( VERSION_MINOR 7 ) -set ( VERSION_PATCH 1 ) -set ( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}" ) -if ( VERSION_PATCH GREATER 0 ) - set ( VERSION "${VERSION}.${VERSION_PATCH}" ) -endif ( VERSION_PATCH GREATER 0 ) +project ( openobex + LANGUAGES C + VERSION 1.7.2 +) # # The path for our own CMake modules @@ -35,7 +27,7 @@ # 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 @@ -207,10 +199,10 @@ set ( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.LIB" ) set ( CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README" ) -set ( CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}" ) -set ( CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}" ) -set ( CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}" ) -set ( CPACK_PACKAGE_VERSION "${VERSION}" ) +set ( CPACK_PACKAGE_VERSION_MAJOR "${openobex_VERSION_MAJOR}" ) +set ( CPACK_PACKAGE_VERSION_MINOR "${openobex_VERSION_MINOR}" ) +set ( CPACK_PACKAGE_VERSION_PATCH "${openobex_VERSION_PATCH}" ) +set ( CPACK_PACKAGE_VERSION "${openobex_VERSION}" ) if ( UNIX ) set ( CPACK_GENERATOR "TGZ" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/CMakeModules/GenerateExportHeader.cmake new/openobex-1.7.2-Source/CMakeModules/GenerateExportHeader.cmake --- old/openobex-1.7.1-Source/CMakeModules/GenerateExportHeader.cmake 2013-02-17 23:41:38.000000000 +0100 +++ new/openobex-1.7.2-Source/CMakeModules/GenerateExportHeader.cmake 2015-10-04 11:27:08.000000000 +0200 @@ -206,11 +206,11 @@ mark_as_advanced(USE_COMPILER_HIDDEN_VISIBILITY) if(USE_COMPILER_HIDDEN_VISIBILITY) - if("${lang}" MATCHES "^CXX$") + if(lang MATCHES "^CXX$") check_cxx_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY) check_cxx_compiler_flag(-fvisibility-inlines-hidden COMPILER_HAS_HIDDEN_INLINE_VISIBILITY) - elseif("${lang}" MATCHES "^C$") + elseif(lang MATCHES "^C$") check_c_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY) endif() endif(USE_COMPILER_HIDDEN_VISIBILITY) @@ -226,10 +226,10 @@ set(COMPILER_HAS_DEPRECATED "" CACHE INTERNAL "Compiler support for a deprecated attribute") else() - if("${lang}" MATCHES "^CXX$") + if(lang MATCHES "^CXX$") _check_cxx_compiler_attribute("__attribute__((__deprecated__))" COMPILER_HAS_DEPRECATED_ATTR) - elseif("${lang}" MATCHES "^C$") + elseif(lang MATCHES "^C$") _check_c_compiler_attribute("__attribute__((__deprecated__))" COMPILER_HAS_DEPRECATED_ATTR) endif() @@ -374,16 +374,9 @@ _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 @@ 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/apps/CMakeLists.txt new/openobex-1.7.2-Source/apps/CMakeLists.txt --- old/openobex-1.7.1-Source/apps/CMakeLists.txt 2012-03-17 14:17:48.000000000 +0100 +++ new/openobex-1.7.2-Source/apps/CMakeLists.txt 2015-10-04 11:38:57.000000000 +0200 @@ -35,8 +35,7 @@ foreach ( prog ${OPENOBEX_APPS} ) add_executable ( ${prog} EXCLUDE_FROM_ALL ${${prog}_SOURCES} ) target_link_libraries ( ${prog} ${${prog}_LIBS} ) - get_target_property ( ${prog}_EXECUTABLE ${prog} LOCATION ) - install ( PROGRAMS ${${prog}_EXECUTABLE} + install ( PROGRAMS $<TARGET_FILE:${prog}> DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT applications OPTIONAL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/apps/ircp/CMakeLists.txt new/openobex-1.7.2-Source/apps/ircp/CMakeLists.txt --- old/openobex-1.7.1-Source/apps/ircp/CMakeLists.txt 2012-03-17 14:17:48.000000000 +0100 +++ new/openobex-1.7.2-Source/apps/ircp/CMakeLists.txt 2015-10-04 11:38:15.000000000 +0200 @@ -10,8 +10,7 @@ add_executable ( ircp EXCLUDE_FROM_ALL ${ircp_SOURCES} ) target_link_libraries ( ircp openobex ) -get_target_property ( ircp_EXECUTABLE ircp LOCATION ) -install ( PROGRAMS ${ircp_EXECUTABLE} +install ( PROGRAMS $<TARGET_FILE:ircp> DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT applications OPTIONAL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/apps/obex_tcp.c new/openobex-1.7.2-Source/apps/obex_tcp.c --- old/openobex-1.7.1-Source/apps/obex_tcp.c 2012-03-28 21:18:23.000000000 +0200 +++ new/openobex-1.7.2-Source/apps/obex_tcp.c 2016-04-06 12:39:21.000000000 +0200 @@ -23,6 +23,7 @@ #include <config.h> #endif #define _XOPEN_SOURCE 520 +#define _POSIX_C_SOURCE 201112L // for getaddrinfo() #ifdef _WIN32 #include <winsock2.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/apps/obex_test/CMakeLists.txt new/openobex-1.7.2-Source/apps/obex_test/CMakeLists.txt --- old/openobex-1.7.1-Source/apps/obex_test/CMakeLists.txt 2012-03-18 10:00:59.000000000 +0100 +++ new/openobex-1.7.2-Source/apps/obex_test/CMakeLists.txt 2016-04-06 12:44:29.000000000 +0200 @@ -5,12 +5,6 @@ obex_test_server.c obex_test_server.h ) -if ( NOT WIN32 ) - list ( APPEND obex_test_SOURCES - obex_test_cable.c obex_test_cable.h - ) -endif ( NOT WIN32 ) - add_executable ( obex_test EXCLUDE_FROM_ALL ${obex_test_SOURCES} ) @@ -25,8 +19,7 @@ target_link_libraries ( obex_test ws2_32 ) endif ( WIN32 ) -get_target_property ( obex_test_EXECUTABLE obex_test LOCATION ) -install ( PROGRAMS ${obex_test_EXECUTABLE} +install ( PROGRAMS $<TARGET_FILE:obex_test> DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT applications OPTIONAL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/apps/obex_test/obex_test.c new/openobex-1.7.2-Source/apps/obex_test/obex_test.c --- old/openobex-1.7.1-Source/apps/obex_test/obex_test.c 2013-07-15 21:16:48.000000000 +0200 +++ new/openobex-1.7.2-Source/apps/obex_test/obex_test.c 2016-04-06 12:46:25.000000000 +0200 @@ -42,12 +42,9 @@ #include "obex_test_server.h" #if defined(_WIN32) -#undef HAVE_CABLE_OBEX #define in_addr_t unsigned long #else -#include "obex_test_cable.h" -#define HAVE_CABLE_OBEX 1 #include <sys/socket.h> #include <arpa/inet.h> #include <netdb.h> @@ -191,11 +188,6 @@ int usbobex = FALSE; obex_interface_t *obex_intf = NULL; #endif -#ifdef HAVE_CABLE_OBEX - int cobex = FALSE, r320 = FALSE; - char *port; - obex_ctrans_t custfunc; -#endif if (argc == 2 && strcmp(argv[1], "-h") == 0) { printf( @@ -203,10 +195,6 @@ "\n" "Options:\n" " -f [flags] Set some flags: n=non-blocking\n" -#ifdef HAVE_CABLE_OBEX - " -s [tty] Use cable transport (Sony-Ericsson phones/DCU-11 cable)\n" - " -r [tty] Use cable transport for R320\n" -#endif #ifdef HAVE_BLUETOOTH " -b [addr] [chan] Use bluetooth RFCOMM transport\n" #endif @@ -241,14 +229,6 @@ } } -#ifdef HAVE_CABLE_OBEX - if ((argc == i+1 || argc == i+2) && strcmp(argv[i], "-s") == 0) - cobex = TRUE; - if ((argc == i+1 || argc == i+2) && strcmp(argv[i], "-r") == 0) { - cobex = TRUE; - r320 = TRUE; - } -#endif #ifdef HAVE_BLUETOOTH if (argc >= i+1 && strcmp(argv[i], "-b") == 0) btobex = 1; @@ -260,42 +240,6 @@ if (argc == i+1 && strcmp(argv[i], "-i") == 0) tcpobex = TRUE; -#ifdef HAVE_CABLE_OBEX - if (cobex) { - if (argc == i+2) - port = argv[i+1]; - else - port = "/dev/ttyS0"; - - if (r320) - printf("OBEX to R320 on %s!\n", port); - else - printf("OBEX on %s!\n", port); - - custfunc.customdata = cobex_open(port, r320); - - if (custfunc.customdata == NULL) { - printf("cobex_open() failed\n"); - return -1; - } - - handle = OBEX_Init(OBEX_TRANS_CUSTOM, obex_event, flags); - if (!handle) { - perror( "OBEX_Init failed"); - return -1; - } - - custfunc.connect = cobex_connect; - custfunc.disconnect = cobex_disconnect; - custfunc.write = cobex_write; - custfunc.handleinput = cobex_handle_input; - custfunc.listen = cobex_connect; // Listen and connect is 100% same on cable - - if (OBEX_RegisterCTransport(handle, &custfunc) < 0) - printf("Custom transport callback-registration failed\n"); - - } else -#endif #ifdef HAVE_BLUETOOTH if (btobex) { const char *channel_arg = NULL; @@ -446,14 +390,6 @@ break; case 'c': /* First connect transport */ -#ifdef HAVE_CABLE_OBEX - if (cobex) { - if (OBEX_TransportConnect(handle, (void*) 1, 0) < 0) { - printf("Transport connect error! (Serial)\n"); - break; - } - } else -#endif #ifdef HAVE_BLUETOOTH if (btobex) { if (bacmp(&bdaddr, BDADDR_ANY) == 0) { @@ -493,14 +429,6 @@ break; case 's': /* First register server */ -#ifdef HAVE_CABLE_OBEX - if (cobex) { - if (OBEX_ServerRegister(handle, (void*) 1, 0) < 0) { - printf("Server register error! (Serial)\n"); - break; - } - } else -#endif #ifdef HAVE_BLUETOOTH if (btobex) { if (BtOBEX_ServerRegister(handle, BDADDR_ANY, channel) < 0) { @@ -534,10 +462,6 @@ printf("Unknown command %s\n", cmd); } } -#ifdef HAVE_CABLE_OBEX - if (cobex) - cobex_close(custfunc.customdata); -#endif return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/apps/obex_test/obex_test.h new/openobex-1.7.2-Source/apps/obex_test/obex_test.h --- old/openobex-1.7.1-Source/apps/obex_test/obex_test.h 2012-03-18 10:41:14.000000000 +0100 +++ new/openobex-1.7.2-Source/apps/obex_test/obex_test.h 2016-04-06 12:52:04.000000000 +0200 @@ -8,11 +8,6 @@ #ifndef OBEX_TEST_H #define OBEX_TEST_H -#ifndef _WIN32 -#include "obex_test_cable.h" -#endif - - struct context { int serverdone; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/apps/obex_test/obex_test_cable.c new/openobex-1.7.2-Source/apps/obex_test/obex_test_cable.c --- old/openobex-1.7.1-Source/apps/obex_test/obex_test_cable.c 2012-03-17 09:09:56.000000000 +0100 +++ new/openobex-1.7.2-Source/apps/obex_test/obex_test_cable.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,409 +0,0 @@ -/** - \file apps/obex_test_cable.c - OBEX over a serial port in Linux; Can be used with an Ericsson R320s phone. - OpenOBEX test applications and sample code. - - Copyright (c) 1999, 2000 Pontus Fuchs, All Rights Reserved. - - OpenOBEX is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OpenOBEX. If not, see <http://www.gnu.org/>. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#define _BSD_SOURCE - -#include <openobex/obex.h> - -#include <stdio.h> -#include <stdlib.h> -#include <fcntl.h> -#include <errno.h> -#include <string.h> -#include <unistd.h> - -#ifdef _WIN32 -#include <io.h> -#define read _read -#define write _write -#if ! defined(strcasecmp) -#define strcasecmp(a,b) _stricmp(a,b) -#endif -#else -#include <sys/ioctl.h> -#include <sys/time.h> -#include <strings.h> -#endif - -#include "obex_test_cable.h" - -#define TRUE 1 -#define FALSE 0 - -static void cobex_cleanup(struct cobex_context *gt, int force); - -/*#define TTBT "AT*TTBT=0001EC4AF6E7\r"*/ - -// -// Send an AT-command and return back one line of answer if any. -// To read a line without sending anything set cmd as NULL -// (this function should be rewritten!) -// -int cobex_do_at_cmd(struct cobex_context *gt, char *cmd, char *rspbuf, int rspbuflen, int timeout) -{ -#if defined(_WIN32) -#if ! defined(_MSC_VER) -#warning "Implementation for win32 is missing!" -#endif - return -1; -#else - fd_set ttyset; - struct timeval tv; - int fd; - - char *answer = NULL; - char *answer_end = NULL; - int answer_size; - - char tmpbuf[100] = {0,}; - int actual; - int total = 0; - int done = 0; - - CDEBUG("\n"); - - fd = gt->ttyfd; - rspbuf[0] = 0; - if(fd < 0) - return -1; - - if(cmd != NULL) { - // Write command - int cmdlen; - - cmdlen = strlen(cmd); - CDEBUG("Sending command %s\n", cmd); - if(write(fd, cmd, cmdlen) < cmdlen) { - perror("Error writing to port"); - return -1; - } - } - - while(!done) { - FD_ZERO(&ttyset); - FD_SET(fd, &ttyset); - tv.tv_sec = timeout; - tv.tv_usec = 0; - if(select(fd+1, &ttyset, NULL, NULL, &tv)) { - actual = read(fd, &tmpbuf[total], sizeof(tmpbuf) - total); - if(actual < 0) - return actual; - total += actual; - -// printf("tmpbuf=%d: %s\n", total, tmpbuf); - - /* Answer didn't come within the length of the buffer. Cancel! */ - if(total == sizeof(tmpbuf)) - return -1; - - if( (answer = index(tmpbuf, '\n')) ) { - // Remove first line (echo) - if( (answer_end = index(answer+1, '\n')) ) { - // Found end of answer - done = 1; - } - } - } - else { - /* Anser didn't come in time. Cancel */ - CDEBUG("Timeout waiting for answer\n"); - return -1; - } - } - - -// printf("buf:%08lx answer:%08lx end:%08lx\n", tmpbuf, answer, answer_end); - - -// printf("Answer: %s\n", answer); - - // Remove heading and trailing \r - if((*answer_end == '\r') || (*answer_end == '\n')) - answer_end--; - if((*answer_end == '\r') || (*answer_end == '\n')) - answer_end--; - if((*answer == '\r') || (*answer == '\n')) - answer++; - if((*answer == '\r') || (*answer == '\n')) - answer++; -// printf("Answer: %s\n", answer); - - answer_size = (answer_end) - answer +1; - -// printf("Answer size=%d\n", answer_size); - if( (answer_size) >= rspbuflen ) - return -1; - - - strncpy(rspbuf, answer, answer_size); - rspbuf[answer_size] = 0; - return 0; -#endif -} - -// -// Open serial port and if we are using an r320, set it in OBEX-mode. -// -static int cobex_init(struct cobex_context *gt) -{ -#ifdef _WIN32 -#if ! defined(_MSC_VER) -#warning "Implementation for win32 is missing!" -#endif -#else - char rspbuf[200]; - - CDEBUG("\n"); - - if( (gt->ttyfd = open(gt->portname, O_RDWR | O_NONBLOCK | O_NOCTTY, 0)) < 0 ) { - perror("Can' t open tty"); - return -1; - } - - tcgetattr(gt->ttyfd, >->oldtio); - memset(>->newtio, 0, sizeof(gt->newtio)); - gt->newtio.c_cflag = B115200 | CS8 | CREAD | CRTSCTS; - gt->newtio.c_iflag = IGNPAR; - gt->newtio.c_oflag = 0; - tcflush(gt->ttyfd, TCIFLUSH); - tcsetattr(gt->ttyfd, TCSANOW, >->newtio); - - // If we don't speak to an R320s we are happy here. - if(!gt->r320) - return 1; - - // Set up R320s phone in OBEX mode. - if(cobex_do_at_cmd(gt, "ATZ\r", rspbuf, sizeof(rspbuf), 1) < 0) { - printf("Comm-error sending ATZ\n"); - goto err; - } - -#ifdef TTBT - /* Special BT-mode */ - if(cobex_do_at_cmd(gt, TTBT, rspbuf, sizeof(rspbuf), 10) < 0) { - printf("Comm-error sending AT*TTBT\n"); - goto err; - } - - if(strcasecmp("OK", rspbuf) != 0) { - printf("Error doing AT*TTBT (%s)\n", rspbuf); - goto err; - } -#endif - - if(strcasecmp("OK", rspbuf) != 0) { - printf("Error doing ATZ (%s)\n", rspbuf); - goto err; - } - - if(cobex_do_at_cmd(gt, "AT*EOBEX\r", rspbuf, sizeof(rspbuf), 1) < 0) { - printf("Comm-error sending AT*EOBEX\n"); - goto err; - } - if(strcasecmp("CONNECT", rspbuf) != 0) { - printf("Error doing AT*EOBEX (%s)\n", rspbuf); - goto err; - } - return 1; -err: - cobex_cleanup(gt, TRUE); -#endif - return -1; -} - -// -// Close down. If force is TRUE. Try to break out of OBEX-mode. -// -static void cobex_cleanup(struct cobex_context *gt, int force) -{ -#ifndef _WIN32 - if(force) { - // Send a break to get out of OBEX-mode -#ifdef TCSBRKP - if(ioctl(gt->ttyfd, TCSBRKP, 0) < 0) { -#elif defined(TCSBRK) - if(ioctl(gt->ttyfd, TCSBRK, 0) < 0) { -#else - if(tcsendbreak(gt->ttyfd, 0) < 0) { -#endif /* TCSBRKP */ - printf("Unable to send break!\n"); - } - } - close(gt->ttyfd); - gt->ttyfd = -1; -#endif -} - -// -// Open up cable OBEX -// -struct cobex_context * cobex_open(const char *port, int r320) -{ - struct cobex_context *gt; - - CDEBUG("\n"); - gt = malloc(sizeof(struct cobex_context)); - if (gt == NULL) - return NULL; - memset(gt, 0, sizeof(struct cobex_context)); - - gt->ttyfd = -1; - gt->portname = port; - gt->r320 = r320; - return gt; -} - -// -// Close down cable OBEX. -// -void cobex_close(struct cobex_context *gt) -{ - free(gt); -} - - -// -// Do transport connect or listen -// -int cobex_connect(obex_t *handle, void * userdata) -{ - struct cobex_context *gt; - - CDEBUG("\n"); - - gt = userdata; - - if(gt->ttyfd >= 0) { - CDEBUG("fd already exist. Using it\n"); - return 1; - - } - if(cobex_init(gt) < 0) - return -1; - return 1; -} - -// -// Do transport disconnect -// -int cobex_disconnect(obex_t *handle, void * userdata) -{ - char rspbuf[20]; - struct cobex_context *gt; - - CDEBUG("\n"); - gt = userdata; - - /* The R320 will send back OK after OBEX disconnect */ - if(gt->r320) { - CDEBUG("R320!!!\n"); - if(cobex_do_at_cmd(gt, NULL, rspbuf, sizeof(rspbuf), 1) < 0) - printf("Comm-error waiting for OK after disconnect\n"); - else if(strcasecmp(rspbuf, "OK") != 0) - printf("Excpected OK after OBEX diconnect got %s\n", rspbuf); - -#ifdef TTBT - sleep(2); - if(cobex_do_at_cmd(gt, "---", rspbuf, sizeof(rspbuf), 5) < 0) - printf("Comm-error Sending ---\n"); - else if(strcasecmp(rspbuf, "DISCONNECT") != 0) - printf("Error waiting for DISCONNECT (%s)\n", rspbuf); - sleep(2); -#endif - - } - - cobex_cleanup(gt, FALSE); - return 1; -} - -// -// Called when data needs to be written -// -int cobex_write(obex_t *handle, void * userdata, uint8_t *buffer, int length) -{ - struct cobex_context *gt; - int actual; - - CDEBUG("\n"); - gt = userdata; - actual = write(gt->ttyfd, buffer, length); - CDEBUG("Wrote %d bytes (expected %d)\n", actual, length); - return actual; -} - -// -// Called when more data is needed. -// -int cobex_handle_input(obex_t *handle, void * userdata, int timeout) -{ - int actual; - struct cobex_context *gt; - struct timeval time; - fd_set fdset; - int ret; - - CDEBUG("\n"); - - gt = userdata; - - /* Return if no fd */ - if(gt->ttyfd < 0) { - CDEBUG("No fd!"); - return -1; - } - - time.tv_sec = timeout; - time.tv_usec = 0; - - FD_ZERO(&fdset); - FD_SET(gt->ttyfd, &fdset); - - ret = select(gt->ttyfd+1, &fdset, NULL, NULL, &time); - - /* Check if this is a timeout (0) or error (-1) */ - if (ret < 1) { - return ret; - CDEBUG("Timeout or error (%d)\n", ret); - } - actual = read(gt->ttyfd, >->inputbuf, sizeof(gt->inputbuf)); - if(actual <= 0) - return actual; - CDEBUG("Read %d bytes\n", actual); -#ifdef CABLE_DEBUG - { - int i = 0; - for(i=0;i<actual;i++) { - printf("[%0X",gt->inputbuf[i]); - if(gt->inputbuf[i] >= 32) { - printf(",%c",gt->inputbuf[i]); - } - printf("]"); - } - printf("\n"); - } -#endif - OBEX_CustomDataFeed(handle, (uint8_t *) gt->inputbuf, actual); - return actual; -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/apps/obex_test/obex_test_cable.h new/openobex-1.7.2-Source/apps/obex_test/obex_test_cable.h --- old/openobex-1.7.1-Source/apps/obex_test/obex_test_cable.h 2011-07-24 13:19:29.000000000 +0200 +++ new/openobex-1.7.2-Source/apps/obex_test/obex_test_cable.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,63 +0,0 @@ -/** - \file apps/obex_test_cable.h - OBEX over a serial port in Linux; Can be used with an Ericsson R320s phone. - OpenOBEX test applications and sample code. - - Copyright (c) 1999, 2000 Pontus Fuchs, All Rights Reserved. - - OpenOBEX is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OpenOBEX. If not, see <http://www.gnu.org/>. - */ - -#ifndef OBEX_TEST_CABLE_H -#define OBEX_TEST_CABLE_H - -#ifdef _WIN32 -#include <windows.h> -#define tty_desc_t DCB -#else -#include <termios.h> -#define tty_desc_t struct termios -#endif - -#if defined(_MSC_VER) && _MSC_VER < 1400 -static void CDEBUG(char *format, ...) {} - -#elif defined(CABLE_DEBUG) -#define CDEBUG(format, ...) printf("%s(): " format, __FUNCTION__ , ## __VA_ARGS__) - -#else -#define CDEBUG(format, ...) -#endif - -struct cobex_context -{ - const char *portname; - int ttyfd; - char inputbuf[500]; - tty_desc_t oldtio, newtio; - int r320; -}; - -/* User function */ -struct cobex_context *cobex_open(const char *port, int r320); -void cobex_close(struct cobex_context *gt); -int cobex_do_at_cmd(struct cobex_context *gt, char *cmd, char *rspbuf, int rspbuflen, int timeout); - -/* Callbacks */ -int cobex_handle_input(obex_t *handle, void * userdata, int timeout); -int cobex_write(obex_t *self, void * userdata, uint8_t *buffer, int length); -int cobex_connect(obex_t *handle, void * userdata); -int cobex_disconnect(obex_t *handle, void * userdata); - -#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/include/openobex/obex_const.h new/openobex-1.7.2-Source/include/openobex/obex_const.h --- old/openobex-1.7.1-Source/include/openobex/obex_const.h 2013-03-09 00:39:06.000000000 +0100 +++ new/openobex-1.7.2-Source/include/openobex/obex_const.h 2016-04-06 12:14:18.000000000 +0200 @@ -184,6 +184,10 @@ 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/lib/CMakeLists.txt new/openobex-1.7.2-Source/lib/CMakeLists.txt --- old/openobex-1.7.1-Source/lib/CMakeLists.txt 2013-03-04 21:47:11.000000000 +0100 +++ new/openobex-1.7.2-Source/lib/CMakeLists.txt 2016-04-06 12:20:29.000000000 +0200 @@ -8,14 +8,9 @@ VERSION SOVERSION COMPILE_DEFINITIONS - COMPILE_FLAGS LINK_FLAGS ) -# the library version always matches the project version -foreach ( i VERSION VERSION_MAJOR VERSION_MINOR VERSION_PATCH ) - set ( openobex_${i} "${${i}}" ) -endforeach ( i ) # the ABI version, must be increased on incompatible changes set ( openobex_SOVERSION "2" ) @@ -132,7 +127,6 @@ ) 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 ) @@ -184,10 +178,9 @@ ) target_link_libraries ( openobex - ${openobex_LIBRARIES} + PRIVATE + ${openobex_LIBRARIES} ) -#disable link chaining -set_property(TARGET openobex PROPERTY LINK_INTERFACE_LIBRARIES "") foreach ( i ${openobex_PROPERTIES} ) if ( DEFINED openobex_${i} ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/lib/api.c new/openobex-1.7.2-Source/lib/api.c --- old/openobex-1.7.1-Source/lib/api.c 2013-03-02 15:25:42.000000000 +0100 +++ new/openobex-1.7.2-Source/lib/api.c 2016-04-06 12:14:18.000000000 +0200 @@ -1036,7 +1036,7 @@ err = OBEX_EnumerateInterfaces(self); if (err <= 0) - return err; + return -1; intf = OBEX_GetInterfaceByIndex(self, 0); intf->irda.service = service; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/lib/obex_client.c new/openobex-1.7.2-Source/lib/obex_client.c --- old/openobex-1.7.1-Source/lib/obex_client.c 2013-02-10 18:24:11.000000000 +0100 +++ new/openobex-1.7.2-Source/lib/obex_client.c 2015-10-04 11:22:07.000000000 +0200 @@ -188,7 +188,18 @@ /* 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/lib/obex_object.c new/openobex-1.7.2-Source/lib/obex_object.c --- old/openobex-1.7.1-Source/lib/obex_object.c 2013-03-09 00:37:14.000000000 +0100 +++ new/openobex-1.7.2-Source/lib/obex_object.c 2015-10-04 11:22:07.000000000 +0200 @@ -196,15 +196,20 @@ 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/lib/openobex.rc.in new/openobex-1.7.2-Source/lib/openobex.rc.in --- old/openobex-1.7.1-Source/lib/openobex.rc.in 2011-07-24 13:19:29.000000000 +0200 +++ new/openobex-1.7.2-Source/lib/openobex.rc.in 2016-04-06 12:19:39.000000000 +0200 @@ -2,7 +2,7 @@ VS_VERSION_INFO VERSIONINFO FILEVERSION @openobex_VERSION_MAJOR@,@openobex_VERSION_MINOR@,@openobex_VERSION_PATCH@,0 - PRODUCTVERSION @VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_PATCH@,0 + PRODUCTVERSION @openobex_VERSION_MAJOR@,@openobex_VERSION_MINOR@,@openobex_VERSION_PATCH@,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifndef NDEBUG FILEFLAGS 0 @@ -27,7 +27,7 @@ VALUE "LegalCopyright", "Licensed under GPLv2 or any later version" VALUE "OriginalFilename", "openobex.dll" VALUE "ProductName", "OpenObex" - VALUE "ProductVersion", "@VERSION@" + VALUE "ProductVersion", "@openobex_VERSION@" END END BLOCK "VarFileInfo" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/lib/transport/irobex.c new/openobex-1.7.2-Source/lib/transport/irobex.c --- old/openobex-1.7.1-Source/lib/transport/irobex.c 2013-03-02 15:05:36.000000000 +0100 +++ new/openobex-1.7.2-Source/lib/transport/irobex.c 2016-04-06 12:14:18.000000000 +0200 @@ -184,6 +184,7 @@ /* 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/openobex-config-version.cmake.in new/openobex-1.7.2-Source/openobex-config-version.cmake.in --- old/openobex-1.7.1-Source/openobex-config-version.cmake.in 2012-06-18 17:07:24.000000000 +0200 +++ new/openobex-1.7.2-Source/openobex-config-version.cmake.in 2016-04-06 13:00:15.000000000 +0200 @@ -1,4 +1,4 @@ -set ( PACKAGE_VERSION "@VERSION@" ) +set ( PACKAGE_VERSION "@openobex_VERSION@" ) if ( PACKAGE_VERSION VERSION_EQUAL PACKAGE_FIND_VERSION) set ( PACKAGE_VERSION_EXACT 1 ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openobex-1.7.1-Source/openobex.pc.in new/openobex-1.7.2-Source/openobex.pc.in --- old/openobex-1.7.1-Source/openobex.pc.in 2011-07-24 13:19:29.000000000 +0200 +++ new/openobex-1.7.2-Source/openobex.pc.in 2016-04-06 12:22:30.000000000 +0200 @@ -5,7 +5,7 @@ Name: OpenOBEX Description: Free implementation of the Object Exchange protocol -Version: @VERSION@ +Version: @openobex_VERSION@ Requires.private: @REQUIRES@ Libs: -L${libdir} -lopenobex Libs.private: @LIBS_PRIVATE@ ++++++ xopen-source.patch ++++++ --- /var/tmp/diff_new_pack.ssN66c/_old 2017-07-07 10:17:02.781908560 +0200 +++ /var/tmp/diff_new_pack.ssN66c/_new 2017-07-07 10:17:02.785907994 +0200 @@ -1,13 +1,13 @@ -Index: openobex-1.7.1-Source/apps/obex_tcp.c +Index: openobex-1.7.2-Source/apps/obex_tcp.c =================================================================== ---- openobex-1.7.1-Source.orig/apps/obex_tcp.c -+++ openobex-1.7.1-Source/apps/obex_tcp.c +--- openobex-1.7.2-Source.orig/apps/obex_tcp.c ++++ openobex-1.7.2-Source/apps/obex_tcp.c @@ -22,7 +22,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif -#define _XOPEN_SOURCE 520 +#define _XOPEN_SOURCE 600 + #define _POSIX_C_SOURCE 201112L // for getaddrinfo() #ifdef _WIN32 - #include <winsock2.h>
