-
Notifications
You must be signed in to change notification settings - Fork 22
Add listen-address parameter #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -109,8 +109,9 @@ struct _InfinotedParameterTypedValue { | |
| * infinoted_parameter_convert_boolean(), | ||
| * infinoted_parameter_convert_port(), | ||
| * infinoted_parameter_convert_nonnegative(), | ||
| * infinoted_parameter_convert_positive(), and | ||
| * infinoted_parameter_convert_security_policy(). | ||
| * infinoted_parameter_convert_positive(), | ||
| * infinoted_parameter_convert_security_policy() and | ||
| * infinoted_parameter_convert_ip_address(). | ||
| * | ||
| * Returns: %TRUE on success or %FALSE if an error occurred. | ||
| */ | ||
|
|
@@ -160,6 +161,8 @@ struct _InfinotedParameterInfo { | |
| * @INFINOTED_PARAMETER_ERROR_INVALID_SECURITY_POLICY: A security policy given | ||
| * as a parameter is not valid. The only allowed values are | ||
| * "no-tls", "allow-tls", and "require-tls". | ||
| * @INFINOTED_PARAMETER_ERROR_INVALID_IP_ADDRESS: The value given as a | ||
| * parameter is not a valid IP address. | ||
| * | ||
| * Specifies the possible error conditions for errors in the | ||
| * <literal>INFINOTED_PARAMETER_ERROR</literal> domain. These typically | ||
|
|
@@ -169,7 +172,8 @@ typedef enum _InfinotedParameterError { | |
| INFINOTED_PARAMETER_ERROR_REQUIRED, | ||
| INFINOTED_PARAMETER_ERROR_INVALID_NUMBER, | ||
| INFINOTED_PARAMETER_ERROR_INVALID_FLAG, | ||
| INFINOTED_PARAMETER_ERROR_INVALID_SECURITY_POLICY | ||
| INFINOTED_PARAMETER_ERROR_INVALID_SECURITY_POLICY, | ||
| INFINOTED_PARAMETER_ERROR_INVALID_IP_ADDRESS | ||
| } InfinotedParameterError; | ||
|
|
||
| GQuark | ||
|
|
@@ -240,6 +244,11 @@ infinoted_parameter_convert_flags(gpointer out, | |
| const GFlagsValue* values, | ||
| GError** error); | ||
|
|
||
| gboolean | ||
| infinoted_parameter_convert_ip_address(gpointer out, | ||
| gpointer in, | ||
| GError** error); | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this function to show up in the documentation, it would need to be added to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It appears to me that this is already the case: https://github.com/gobby/libinfinity/pull/15/files#diff-3023f5a98c4128f4ad459d1c20dc74c2R46
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops, I must have overlooked that. My fault! |
||
| G_END_DECLS | ||
|
|
||
| #endif /* __INFINOTED_PARAMETER_H__ */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would need a NULL check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to malloc(3)
free(NULL)does nothing, therefore the check is not strictly required as far as I understand.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this is not
free, it isinf_ip_address_free, which does not like aNULLargument. Or at least it's not documented to. It usesg_slice_freeunder the hood, which apparently handles NULL fine, but in general the*_freefunctions in libinfinity don't.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was told that it is usual for functions that free memory to handle NULL themselves, therefore it might be a good idea to just do the same for the libinfinity free functions if they need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, but it's more important to stay consistent within this PR. If I'm not mistaken some glib free functions such as
g_object_unrefdon't handle NULL arguments either.