Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package aws-c-s3 for openSUSE:Factory 
checked in at 2024-04-02 16:43:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/aws-c-s3 (Old)
 and      /work/SRC/openSUSE:Factory/.aws-c-s3.new.1905 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "aws-c-s3"

Tue Apr  2 16:43:24 2024 rev:4 rq:1163974 version:0.5.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/aws-c-s3/aws-c-s3.changes        2024-03-26 
19:29:45.290441524 +0100
+++ /work/SRC/openSUSE:Factory/.aws-c-s3.new.1905/aws-c-s3.changes      
2024-04-02 16:45:18.935371978 +0200
@@ -1,0 +2,6 @@
+Thu Mar 28 10:10:46 UTC 2024 - John Paul Adrian Glaubitz 
<adrian.glaub...@suse.com>
+
+- Update to version 0.5.4
+  * UserAgent updates by @waahm7 in (#414)
+
+-------------------------------------------------------------------

Old:
----
  v0.5.3.tar.gz

New:
----
  v0.5.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ aws-c-s3.spec ++++++
--- /var/tmp/diff_new_pack.p5XPVs/_old  2024-04-02 16:45:20.603431519 +0200
+++ /var/tmp/diff_new_pack.p5XPVs/_new  2024-04-02 16:45:20.619432090 +0200
@@ -19,7 +19,7 @@
 %define library_version 1.0.0
 %define library_soversion 0unstable
 Name:           aws-c-s3
-Version:        0.5.3
+Version:        0.5.4
 Release:        0
 Summary:        AWS Cross-Platform, C99 wrapper for cryptography primitives
 License:        Apache-2.0

++++++ v0.5.3.tar.gz -> v0.5.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/aws-c-s3-0.5.3/include/aws/s3/private/s3_platform_info.h 
new/aws-c-s3-0.5.4/include/aws/s3/private/s3_platform_info.h
--- old/aws-c-s3-0.5.3/include/aws/s3/private/s3_platform_info.h        
2024-03-21 00:40:53.000000000 +0100
+++ new/aws-c-s3-0.5.4/include/aws/s3/private/s3_platform_info.h        
2024-03-22 16:34:43.000000000 +0100
@@ -73,7 +73,7 @@
  * @return byte_cursor containing the instance type. If this is empty, the 
instance type could not be determined.
  */
 AWS_S3_API
-struct aws_byte_cursor aws_s3_get_ec2_instance_type(struct 
aws_s3_platform_info_loader *loader);
+struct aws_byte_cursor aws_s3_get_ec2_instance_type(struct 
aws_s3_platform_info_loader *loader, bool cached_only);
 
 AWS_EXTERN_C_END
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aws-c-s3-0.5.3/include/aws/s3/private/s3_util.h 
new/aws-c-s3-0.5.4/include/aws/s3/private/s3_util.h
--- old/aws-c-s3-0.5.3/include/aws/s3/private/s3_util.h 2024-03-21 
00:40:53.000000000 +0100
+++ new/aws-c-s3-0.5.4/include/aws/s3/private/s3_util.h 2024-03-22 
16:34:43.000000000 +0100
@@ -109,6 +109,12 @@
 extern const struct aws_byte_cursor g_user_agent_header_product_name;
 
 AWS_S3_API
+extern const struct aws_byte_cursor g_user_agent_header_platform;
+
+AWS_S3_API
+extern const struct aws_byte_cursor g_user_agent_header_unknown;
+
+AWS_S3_API
 extern const struct aws_byte_cursor g_acl_header_name;
 
 AWS_S3_API
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aws-c-s3-0.5.3/include/aws/s3/s3.h 
new/aws-c-s3-0.5.4/include/aws/s3/s3.h
--- old/aws-c-s3-0.5.3/include/aws/s3/s3.h      2024-03-21 00:40:53.000000000 
+0100
+++ new/aws-c-s3-0.5.4/include/aws/s3/s3.h      2024-03-22 16:34:43.000000000 
+0100
@@ -119,6 +119,13 @@
 const struct aws_s3_platform_info *aws_s3_get_current_platform_info(void);
 
 /*
+ * Returns the ec2 instance_type for current platform if possible
+ * NOTE: THIS API IS EXPERIMENTAL AND UNSTABLE
+ */
+AWS_S3_API
+struct aws_byte_cursor aws_s3_get_current_platform_ec2_intance_type(bool 
cached_only);
+
+/*
  * Retrieves a list of EC2 instance types with recommended configuration.
  * Returns aws_array_list<aws_byte_cursor>. The caller is responsible for 
cleaning up the array list.
  */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aws-c-s3-0.5.3/source/s3.c 
new/aws-c-s3-0.5.4/source/s3.c
--- old/aws-c-s3-0.5.3/source/s3.c      2024-03-21 00:40:53.000000000 +0100
+++ new/aws-c-s3-0.5.4/source/s3.c      2024-03-22 16:34:43.000000000 +0100
@@ -104,6 +104,10 @@
     return aws_s3_get_platform_info_for_current_environment(s_loader);
 }
 
+struct aws_byte_cursor aws_s3_get_current_platform_ec2_intance_type(bool 
cached_only) {
+    return aws_s3_get_ec2_instance_type(s_loader, cached_only);
+}
+
 struct aws_array_list aws_s3_get_platforms_with_recommended_config(void) {
     return aws_s3_get_recommended_platforms(s_loader);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aws-c-s3-0.5.3/source/s3_platform_info.c 
new/aws-c-s3-0.5.4/source/s3_platform_info.c
--- old/aws-c-s3-0.5.3/source/s3_platform_info.c        2024-03-21 
00:40:53.000000000 +0100
+++ new/aws-c-s3-0.5.4/source/s3_platform_info.c        2024-03-22 
16:34:43.000000000 +0100
@@ -486,7 +486,7 @@
     return callback_info.instance_type;
 }
 
-struct aws_byte_cursor aws_s3_get_ec2_instance_type(struct 
aws_s3_platform_info_loader *loader) {
+struct aws_byte_cursor aws_s3_get_ec2_instance_type(struct 
aws_s3_platform_info_loader *loader, bool cached_only) {
     aws_mutex_lock(&loader->lock_data.lock);
     struct aws_byte_cursor return_cur;
     AWS_ZERO_STRUCT(return_cur);
@@ -499,6 +499,14 @@
             aws_string_bytes(loader->lock_data.detected_instance_type));
         goto return_instance_and_unlock;
     }
+    if (cached_only) {
+        AWS_LOGF_TRACE(
+            AWS_LS_S3_CLIENT,
+            "id=%p: Instance type has not been cached. Returning without 
trying to determine instance type since "
+            "cached_only is set.",
+            (void *)loader);
+        goto return_instance_and_unlock;
+    }
 
     AWS_LOGF_TRACE(
         AWS_LS_S3_CLIENT,
@@ -556,7 +564,7 @@
 const struct aws_s3_platform_info 
*aws_s3_get_platform_info_for_current_environment(
     struct aws_s3_platform_info_loader *loader) {
     /* getting the instance type will set it on the loader the first time if 
it can */
-    aws_s3_get_ec2_instance_type(loader);
+    aws_s3_get_ec2_instance_type(loader, false /*cached_only*/);
     /* will never be mutated after the above call. */
     return &loader->lock_data.current_env_platform_info;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aws-c-s3-0.5.3/source/s3_util.c 
new/aws-c-s3-0.5.4/source/s3_util.c
--- old/aws-c-s3-0.5.3/source/s3_util.c 2024-03-21 00:40:53.000000000 +0100
+++ new/aws-c-s3-0.5.4/source/s3_util.c 2024-03-22 16:34:43.000000000 +0100
@@ -6,6 +6,7 @@
 #include "aws/s3/private/s3_util.h"
 #include "aws/s3/private/s3_client_impl.h"
 #include "aws/s3/private/s3_meta_request_impl.h"
+#include "aws/s3/private/s3_platform_info.h"
 #include "aws/s3/private/s3_request.h"
 #include <aws/auth/credentials.h>
 #include <aws/common/clock.h>
@@ -66,6 +67,8 @@
 const struct aws_byte_cursor g_user_agent_header_name = 
AWS_BYTE_CUR_INIT_FROM_STRING_LITERAL("User-Agent");
 const struct aws_byte_cursor g_user_agent_header_product_name =
     AWS_BYTE_CUR_INIT_FROM_STRING_LITERAL("CRTS3NativeClient");
+const struct aws_byte_cursor g_user_agent_header_platform = 
AWS_BYTE_CUR_INIT_FROM_STRING_LITERAL("platform");
+const struct aws_byte_cursor g_user_agent_header_unknown = 
AWS_BYTE_CUR_INIT_FROM_STRING_LITERAL("unknown");
 
 const uint32_t g_s3_max_num_upload_parts = 10000;
 const size_t g_s3_min_upload_part_size = MB_TO_BYTES(5);
@@ -352,9 +355,13 @@
 
     const struct aws_byte_cursor space_delimiter = 
AWS_BYTE_CUR_INIT_FROM_STRING_LITERAL(" ");
     const struct aws_byte_cursor forward_slash = 
AWS_BYTE_CUR_INIT_FROM_STRING_LITERAL("/");
-
-    const size_t user_agent_product_version_length =
-        g_user_agent_header_product_name.len + forward_slash.len + 
g_s3_client_version.len;
+    struct aws_byte_cursor platform_cursor = 
aws_s3_get_current_platform_ec2_intance_type(true /* cached_only */);
+    if (!platform_cursor.len) {
+        platform_cursor = g_user_agent_header_unknown;
+    }
+    const size_t user_agent_length = g_user_agent_header_product_name.len + 
forward_slash.len +
+                                     g_s3_client_version.len + 
space_delimiter.len + g_user_agent_header_platform.len +
+                                     forward_slash.len + platform_cursor.len;
 
     struct aws_http_headers *headers = aws_http_message_get_headers(message);
     AWS_ASSERT(headers != NULL);
@@ -369,9 +376,7 @@
         /* If the header was found, then create a buffer with the total size 
we'll need, and append the current user
          * agent header with a trailing space. */
         aws_byte_buf_init(
-            &user_agent_buffer,
-            allocator,
-            current_user_agent_header.len + space_delimiter.len + 
user_agent_product_version_length);
+            &user_agent_buffer, allocator, current_user_agent_header.len + 
space_delimiter.len + user_agent_length);
 
         aws_byte_buf_append_dynamic(&user_agent_buffer, 
&current_user_agent_header);
 
@@ -382,7 +387,7 @@
 
         /* If the header was not found, then create a buffer with just the 
size of the user agent string that is about
          * to be appended to the buffer. */
-        aws_byte_buf_init(&user_agent_buffer, allocator, 
user_agent_product_version_length);
+        aws_byte_buf_init(&user_agent_buffer, allocator, user_agent_length);
     }
 
     /* Append the client's user-agent string. */
@@ -390,6 +395,10 @@
         aws_byte_buf_append_dynamic(&user_agent_buffer, 
&g_user_agent_header_product_name);
         aws_byte_buf_append_dynamic(&user_agent_buffer, &forward_slash);
         aws_byte_buf_append_dynamic(&user_agent_buffer, &g_s3_client_version);
+        aws_byte_buf_append_dynamic(&user_agent_buffer, &space_delimiter);
+        aws_byte_buf_append_dynamic(&user_agent_buffer, 
&g_user_agent_header_platform);
+        aws_byte_buf_append_dynamic(&user_agent_buffer, &forward_slash);
+        aws_byte_buf_append_dynamic(&user_agent_buffer, &platform_cursor);
     }
 
     /* Apply the updated header. */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aws-c-s3-0.5.3/tests/s3_data_plane_tests.c 
new/aws-c-s3-0.5.4/tests/s3_data_plane_tests.c
--- old/aws-c-s3-0.5.3/tests/s3_data_plane_tests.c      2024-03-21 
00:40:53.000000000 +0100
+++ new/aws-c-s3-0.5.4/tests/s3_data_plane_tests.c      2024-03-22 
16:34:43.000000000 +0100
@@ -5253,12 +5253,16 @@
     AWS_ASSERT(dest);
 
     const struct aws_byte_cursor forward_slash = 
AWS_BYTE_CUR_INIT_FROM_STRING_LITERAL("/");
+    const struct aws_byte_cursor single_space = 
AWS_BYTE_CUR_INIT_FROM_STRING_LITERAL(" ");
 
     ASSERT_SUCCESS(aws_byte_buf_init(dest, allocator, 32));
     ASSERT_SUCCESS(aws_byte_buf_append_dynamic(dest, 
&g_user_agent_header_product_name));
     ASSERT_SUCCESS(aws_byte_buf_append_dynamic(dest, &forward_slash));
     ASSERT_SUCCESS(aws_byte_buf_append_dynamic(dest, &g_s3_client_version));
-
+    ASSERT_SUCCESS(aws_byte_buf_append_dynamic(dest, &single_space));
+    ASSERT_SUCCESS(aws_byte_buf_append_dynamic(dest, 
&g_user_agent_header_platform));
+    ASSERT_SUCCESS(aws_byte_buf_append_dynamic(dest, &forward_slash));
+    ASSERT_SUCCESS(aws_byte_buf_append_dynamic(dest, 
&g_user_agent_header_unknown));
     return AWS_OP_SUCCESS;
 }
 
@@ -5270,7 +5274,6 @@
     AWS_ZERO_STRUCT(tester);
     ASSERT_SUCCESS(aws_s3_tester_init(allocator, &tester));
 
-    const struct aws_byte_cursor forward_slash = 
AWS_BYTE_CUR_INIT_FROM_STRING_LITERAL("/");
     const struct aws_byte_cursor single_space = 
AWS_BYTE_CUR_INIT_FROM_STRING_LITERAL(" ");
 
     struct aws_byte_buf expected_user_agent_value_buf;
@@ -5290,8 +5293,8 @@
 
         ASSERT_TRUE(headers != NULL);
         ASSERT_SUCCESS(aws_http_headers_get(headers, g_user_agent_header_name, 
&user_agent_value));
-        ASSERT_TRUE(aws_byte_cursor_eq(&user_agent_value, 
&expected_user_agent_value));
-
+        ASSERT_BIN_ARRAYS_EQUALS(
+            user_agent_value.ptr, user_agent_value.len, 
expected_user_agent_value.ptr, expected_user_agent_value.len);
         aws_http_message_release(message);
     }
 
@@ -5303,10 +5306,7 @@
         aws_byte_buf_init(&total_expected_user_agent_value_buf, allocator, 64);
         aws_byte_buf_append_dynamic(&total_expected_user_agent_value_buf, 
&dummy_agent_header_value);
         aws_byte_buf_append_dynamic(&total_expected_user_agent_value_buf, 
&single_space);
-
-        aws_byte_buf_append_dynamic(&total_expected_user_agent_value_buf, 
&g_user_agent_header_product_name);
-        aws_byte_buf_append_dynamic(&total_expected_user_agent_value_buf, 
&forward_slash);
-        aws_byte_buf_append_dynamic(&total_expected_user_agent_value_buf, 
&g_s3_client_version);
+        aws_byte_buf_append_dynamic(&total_expected_user_agent_value_buf, 
&expected_user_agent_value);
 
         struct aws_byte_cursor total_expected_user_agent_value =
             aws_byte_cursor_from_buf(&total_expected_user_agent_value_buf);
@@ -5323,7 +5323,11 @@
             struct aws_byte_cursor user_agent_value;
             AWS_ZERO_STRUCT(user_agent_value);
             ASSERT_SUCCESS(aws_http_headers_get(headers, 
g_user_agent_header_name, &user_agent_value));
-            ASSERT_TRUE(aws_byte_cursor_eq(&user_agent_value, 
&total_expected_user_agent_value));
+            ASSERT_BIN_ARRAYS_EQUALS(
+                user_agent_value.ptr,
+                user_agent_value.len,
+                total_expected_user_agent_value.ptr,
+                total_expected_user_agent_value.len);
         }
 
         aws_byte_buf_clean_up(&total_expected_user_agent_value_buf);

Reply via email to