63 Commits

Author SHA1 Message Date
Julius Pfrommer 5625d1d28e Fix an invalid memory access in the network layer uncovered by asan 2019-11-05 09:53:17 +01:00
Julius Pfrommer 5c753d7013 Fix job allocation in network layer (#2234) 2019-02-12 14:03:14 +01:00
Julius Pfrommer e9a8c873d5 Networking: Add flag to prevent SIGPIPE for closed sockets 2018-08-31 17:33:20 +02:00
Julius Pfrommer 6e0437e524 flush stdout after every log output 2017-05-13 11:29:02 +02:00
Stefan Profanter f3c84dca69 Workaround for casting FD in musl libc 2017-04-27 19:07:50 +02:00
Julius Pfrommer 36cf6dd982 improve logging; shorten overlong lines 2017-04-20 22:30:21 +02:00
Julius Pfrommer e861392b1c remove closed sockets before select 2017-04-20 16:16:30 +02:00
Julius Pfrommer 0ee61ba3e3 check for select returning 0 (fix #999) 2017-03-27 09:52:40 +02:00
Stefan Profanter 99116b1cdf Untabify
Command used:
`find . \( -name '*.c' -o -name '*.h' \) -not \( -path "./deps/*" -prune \) ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;`
2017-02-16 15:39:01 +01:00
Julius Pfrommer 656de37bee workaround an issue with clang and string formatting 2017-02-11 17:23:07 +01:00
Julius Pfrommer aebb8d273e use va_list in logging API (necessary for static inline functions) 2017-02-11 16:48:17 +01:00
Julius Pfrommer 917169614c fix warnings from clang-tidy 2016-12-26 13:12:08 +01:00
Julius Pfrommer 27a2b77429 fix drop in gcov coverage (#917) 2016-12-20 15:27:28 +01:00
Julius Pfrommer 2cabd7c5d9 use cmake project version facility 2016-12-07 17:04:40 +01:00
Julius Pfrommer 243237e882 feature: allow limiting the retransmission queue in the server (fix 2016-12-02 14:31:28 +01:00
Julius Pfrommer 29e0b175bc fix #891: adding malloc.h in clang under windows 2016-11-28 23:07:27 +01:00
Lorenz Haas 71e9f80031 Be afraid of premature pessimization, use pre(in|de)crement ;D 2016-11-04 13:27:30 +01:00
Stefan Profanter c98018f6e0 Add error message to "Connection failed" error 2016-10-17 16:56:50 +02:00
Julius Pfrommer 12eda25a8f fix: remove a false positive of cppcheck 2016-10-17 12:31:46 +02:00
Julius Pfrommer a28c922aee fix: more stable handling of errno on win32 2016-10-17 12:06:51 +02:00
Julius Pfrommer 49441aa92c fix: handling of WSA macros for tcp networking on win32 2016-10-17 11:49:48 +02:00
Julius Pfrommer b3aaa1ceea refactor: UA_Connection_init as memset-zero; small cleanups 2016-10-13 22:05:23 +02:00
Julius Pfrommer aad21245ee clean overlong lines in tcp network layer; improve inline docs 2016-09-28 09:09:58 +02:00
Stefan Profanter 0f7ce31433 Fix compilation errors in UDP network plugin (#820) 2016-09-27 14:28:41 +02:00
Holger Jeromin e94ee24dc6 Generic BSD detection for tcp/udp plugin (#807)
* BSD Detection in network tcp plugin

* BSD Detection in network udp plugin
2016-09-20 13:55:58 +02:00
mklingn 0932f47df1 Properly define UA_fd_set and UA_fd_isset for OpenBSD. 2016-09-16 08:39:18 +02:00
Markus Klingenberger# ceb27d614e Precompiler directives to include sys/socket on OpenBSD. 2016-09-12 10:23:44 +02:00
Stefan Profanter 0fdfcc43d4 Create specific method for splitting endpoint url. Fix #778
Windows wants strncpy_s

Port is max 6 chars

Code refactoring and cleanup

Add support for IPv6

cosmetic improvements; untabify, break overly long lines
2016-08-30 14:31:11 +02:00
Julius Pfrommer 8799b44ac4 Type handling functions in separate header (#735) 2016-08-01 16:04:53 +02:00
Julius Pfrommer da178d5b54 move standard subscription settings to plugin 2016-07-31 18:52:22 +02:00
Julius Pfrommer f916ba4886 use unlimited message size and chunk count in the default settings; move default connection settings to plugin 2016-07-23 12:03:26 +02:00
Julius Pfrommer 56e7ae441f fix inclusion order of winsock2/windows.h in amalgamation 2016-07-08 13:10:37 +02:00
Julius Pfrommer 26ca69f38c move _WINSOCK_DEPRECATED_NO_WARNINGS into plugin flags.make
so we get no warnings we people drop in the single-file release
2016-07-08 10:29:34 +02:00
Julius Pfrommer 1212aea02d switch defaults to port 4840 (IANA defined OPC UA port) 2016-07-07 03:03:00 +02:00
Julius Pfrommer d22e42a458 remove warnings from msvc (#665) 2016-07-06 21:18:39 +02:00
Julius Pfrommer 54daafd37a rename plugins to begin with ua_ 2016-06-27 07:16:33 +02:00
Julius Pfrommer 1f98aa2e01 move system-dependent clock functions into a plugin 2016-06-27 05:08:03 +02:00
Julius Pfrommer 3e298f22ce remove warnings from coverity about unchecked return values 2016-06-21 17:13:37 +02:00
Julius Pfrommer 87393df325 fix #644; sending tcp messages in blocks 2016-06-20 21:37:51 +02:00
Stasik0 dd0fbbf3f9 adding purging of SC to pass CTT, reducing default # of SCs to 40 due to a possible CTT bug 2016-06-16 10:25:43 +02:00
Stasik0 03a8e92e43 fixing typos in c4fe867742 2016-06-16 08:32:30 +02:00
Stasik0 c4fe867742 cosmetic improvement: show git version in ua node space 2016-06-15 22:05:12 +02:00
LEvertz 85c33003c5 fixed an unused variable error for loglevels greater 300 (#637) 2016-06-15 10:51:11 +02:00
Stasik0 46c2be5d5e Discovery Get Endpoints tests work now 2016-06-01 09:10:08 +02:00
Stasik0 0262159477 ajusted local client config, improved logging, relates #617 2016-05-30 14:46:02 +02:00
Julius Pfrommer 85f82c3e14 start making session behavior compliant with CTT 2016-05-28 03:42:45 +02:00
Julius Pfrommer 5237a74f30 improve logging with new convenience macros 2016-05-28 03:42:45 +02:00
Julius Pfrommer 1950b61849 add limits for session and securechannel to the server config 2016-05-28 00:31:30 +02:00
Stefan Profanter 45256a43af Fix all the cppcheck warnings and enable travis fail on cppcheck error
Fixes the following issues:

plugins/networklayer_udp.c(174): style (unsignedLessThanZero): Checking if unsigned variable 'length' is less than zero.
plugins/networklayer_tcp.c(291): style (unreadVariable): Variable 'layer' is assigned a value that is never used.
src/server/ua_services_attribute.c(13): style (variableScope): The scope of the variable 'c' can be reduced.
src/server/ua_server_worker.c(552): style (unreadVariable): Variable 'mlw' is assigned a value that is never used.
src/server/ua_services_view.c(262): style (unsignedLessThanZero): Checking if unsigned variable 'referencesSize' is less than zero.
src/server/ua_services_view.c(273): style (unsignedLessThanZero): Checking if unsigned variable 'referencesSize' is less than zero.
src/ua_types.c(544): error (memleak): Memory leak: new
src/ua_types.c(547): error (memleak): Memory leak: new
src/ua_types_encoding_binary.c(278): style (duplicateExpression): Same expression on both sides of '/'.
src/ua_types_encoding_binary.c(311): style (duplicateExpression): Same expression on both sides of '/'.
src/ua_types_encoding_binary.c(49): error (arrayIndexOutOfBounds): Array 'buf[4]' accessed at index 4, which is out of bounds.
src/ua_types_encoding_binary.c(49): error (arrayIndexOutOfBounds): Array 'buf[4]' accessed at index 5, which is out of bounds.
src/ua_types_encoding_binary.c(50): error (arrayIndexOutOfBounds): Array 'buf[4]' accessed at index 6, which is out of bounds.
src/ua_types_encoding_binary.c(50): error (arrayIndexOutOfBounds): Array 'buf[4]' accessed at index 7, which is out of bounds.
src/ua_types_encoding_binary.c(326): style (redundantCondition): Redundant condition: If decoded >= 9218868437227405313, the comparison decoded <= 9223372036854775807 is always true.
src/ua_types_encoding_binary.c(262): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
src/ua_types_encoding_binary.c(276): style (duplicateExpression): Same expression on both sides of '!='.
src/ua_types_encoding_binary.c(278): style (duplicateExpression): Same expression on both sides of '!='.
src/ua_types_encoding_binary.c(309): style (duplicateExpression): Same expression on both sides of '!='.
src/ua_types_encoding_binary.c(311): style (duplicateExpression): Same expression on both sides of '!='.

Fix cppcheck warnings

Fixes the following warnings:
plugins/networklayer_udp.c(202): style (knownConditionTrueFalse): Condition 'j==0' is always false
src/server/ua_services_nodemanagement.c(826): style (redundantAssignment): Variable 'resultsSize' is reassigned a value before the old one has been used.
2016-05-17 16:08:29 +02:00
Julius Pfrommer c317396f4c Chunking callback (#534)
* changed signature of encoding functions -> new callback interface, **dst to allow buffer changing in callback

* changed signature of callback: removed not needed parameters

* added first implementation for send-chunk-callback function. Some fields need to be filled (messagetype etc)

* added UA_SecureChannel_sendChunk, added enumeration for Message type, added request type

* added function call to encode function

* some clean up, reworked enumerations

* some trivial fixes @FlorianPalm

* changed string encoding function to split up long srings

* merging...

* added missing file

* added variable for chunking.

* added observing used chunks

* little fix in string_encodeBinary

* changed size of chunk count in connection config and increased array size (2000) to test chunking on arrays (stolen from @Stasik0 chunking_longjmp branch)

* changes in connection parameters

* added demo (server_chunking) for chunking

* removed demo configuration

* changed connection send buffer allocation (remoteConf.recvBufferSize to localConf.sendBufferSize)

* changed allocation size of send/recv buffer

* renaming

* added proposal for chunk abort

* fixing array encoding, using array encoding for string encoding, further minor fixes

* removed accidently added file

* fixing typo in demo

* fixing server_chunking (config structure)

* new callback

* simplify chunking

* remove unnecessary changes against master

* fixed compile warning

* fixed errors to get chunking to work again. started unit test for chunking

* chunking should now also work with normal arrays in addition to long strings
(still, there is a mem leak in the unit test)

* added chunked array example

* fixed array encoding problem (don't increase current source buffer pointer if encoding has failed)

* some unit tests for chunking, checking encoding of an array, tnx @FlorianPalm

* added unit test for chunked string

* changed data types to prevent warnings

* removed mem leak in string test

* re-inserted assert for clang

* cosmetics on server_chunking

* corrected cosmetics

* added abort message (chunking)

* removed memleak (still mem problem)

* fixed message size (array encoding works again)

* string encoding works again
test for chunk count and message size (local config is used)

* added evaluation of retvals to prevent encoding on NULL buffer

* removed debug printfs
testing: localConf -> remoteConf

* fixed stateless extension

* split out a separate chunking unit test

* remove the chunking example; as long as the unit test works, end users won't need to see it

* remove some cosmetic changes

* some cosmetic changes

* reverted connection settings

* changed connection settings within the server_chunking example

* cosmetic changes to the chunked encoding

* fix amalgamation build

* cleanup of encoding with chunking

* revert a a change to calloc in ua_types.c

* allow chunking in the standard config

* fix subscriptions with chunking

* use normal array encoding in variants when possible

* fix handling of old_pos pointers for chunking
2016-05-17 14:54:41 +02:00