mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
curl: Fix indention
This commit is contained in:
parent
23ab7d8c49
commit
d111f37f74
2 changed files with 33 additions and 29 deletions
|
@ -135,21 +135,19 @@ gst_curl_ftp_sink_class_init (GstCurlFtpSinkClass * klass)
|
|||
"Enable the use of the EPSV command when doing passive FTP transfers",
|
||||
TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (gobject_class, PROP_CREATE_TEMP_FILE,
|
||||
g_param_spec_boolean ("create-tmp-file", "Enable or disable temporary file transfer",
|
||||
"Use a temporary file name when uploading a a file. When the transfer is complete, \
|
||||
g_param_spec_boolean ("create-tmp-file", "Enable or disable temporary file transfer", "Use a temporary file name when uploading a a file. When the transfer is complete, \
|
||||
this temporary file is renamed to the final file name. This is useful for ensuring \
|
||||
that remote systems do not read a partially uploaded file",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
that remote systems do not read a partially uploaded file", FALSE, G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (gobject_class, PROP_CREATE_TEMP_FILE_NAME,
|
||||
g_param_spec_string ("temp-file-name", "Creates a temporary file name with date and time",
|
||||
g_param_spec_string ("temp-file-name",
|
||||
"Creates a temporary file name with date and time",
|
||||
"Filename pattern to use when generating a temporary filename for uploads",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (gobject_class, PROP_CREATE_DIRS,
|
||||
g_param_spec_boolean ("create-dirs", "Create missing directories",
|
||||
"Attempt to create missing directory included in the path",
|
||||
FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
"Attempt to create missing directory included in the path", FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -180,7 +178,7 @@ set_ftp_dynamic_options_unlocked (GstCurlBaseSink * basesink)
|
|||
gchar *tmp = NULL;
|
||||
GstCurlFtpSink *sink = GST_CURL_FTP_SINK (basesink);
|
||||
|
||||
if(sink->tmpfile_create) {
|
||||
if (sink->tmpfile_create) {
|
||||
gchar *rename_from = NULL;
|
||||
gchar *rename_to = NULL;
|
||||
gchar *uploadfile_as = NULL;
|
||||
|
@ -196,15 +194,17 @@ set_ftp_dynamic_options_unlocked (GstCurlBaseSink * basesink)
|
|||
if (sink->tmpfile_name != NULL) {
|
||||
tmpfile_name = g_strdup_printf ("%s", sink->tmpfile_name);
|
||||
} else {
|
||||
tmpfile_name = g_strdup_printf (".tmp.%04X%04X", g_random_int (), g_random_int ());
|
||||
tmpfile_name =
|
||||
g_strdup_printf (".tmp.%04X%04X", g_random_int (), g_random_int ());
|
||||
}
|
||||
|
||||
rename_from = g_strdup_printf ("%s%s", RENAME_FROM, tmpfile_name);
|
||||
|
||||
last_slash = strrchr (basesink->file_name, '/');
|
||||
if (last_slash != NULL) {
|
||||
dir_name = g_strndup (basesink->file_name, last_slash - basesink->file_name);
|
||||
rename_to = g_strdup_printf ("%s%s", RENAME_TO, last_slash+1);
|
||||
dir_name =
|
||||
g_strndup (basesink->file_name, last_slash - basesink->file_name);
|
||||
rename_to = g_strdup_printf ("%s%s", RENAME_TO, last_slash + 1);
|
||||
uploadfile_as = g_strdup_printf ("%s/%s", dir_name, tmpfile_name);
|
||||
} else {
|
||||
rename_to = g_strdup_printf ("%s%s", RENAME_TO, basesink->file_name);
|
||||
|
@ -222,7 +222,7 @@ set_ftp_dynamic_options_unlocked (GstCurlBaseSink * basesink)
|
|||
g_free (uploadfile_as);
|
||||
g_free (dir_name);
|
||||
g_free (tmpfile_name);
|
||||
if(last_slash != NULL) {
|
||||
if (last_slash != NULL) {
|
||||
*last_slash = '\0';
|
||||
}
|
||||
} else {
|
||||
|
@ -302,7 +302,8 @@ gst_curl_ftp_sink_set_property (GObject * object, guint prop_id,
|
|||
break;
|
||||
case PROP_CREATE_TEMP_FILE:
|
||||
sink->tmpfile_create = g_value_get_boolean (value);
|
||||
GST_DEBUG_OBJECT (sink, "create-tmp-file set to %d", sink->tmpfile_create);
|
||||
GST_DEBUG_OBJECT (sink, "create-tmp-file set to %d",
|
||||
sink->tmpfile_create);
|
||||
break;
|
||||
case PROP_CREATE_TEMP_FILE_NAME:
|
||||
g_free (sink->tmpfile_name);
|
||||
|
|
|
@ -122,7 +122,8 @@ static gboolean gst_curl_smtp_sink_prepare_transfer (GstCurlBaseSink * bcsink);
|
|||
static size_t gst_curl_smtp_sink_transfer_data_buffer (GstCurlBaseSink * sink,
|
||||
void *curl_ptr, size_t block_size, guint * last_chunk);
|
||||
static size_t gst_curl_smtp_sink_flush_data_unlocked (GstCurlBaseSink * bcsink,
|
||||
void *curl_ptr, size_t block_size, gboolean new_file, gboolean close_transfer);
|
||||
void *curl_ptr, size_t block_size, gboolean new_file,
|
||||
gboolean close_transfer);
|
||||
|
||||
/* private functions */
|
||||
|
||||
|
@ -750,14 +751,16 @@ gst_curl_smtp_sink_flush_data_unlocked (GstCurlBaseSink * bcsink,
|
|||
gint len;
|
||||
gchar *data_out;
|
||||
|
||||
GST_DEBUG ("live: %d, num attachments: %d, num attachments_left: %d, eos: %d, "
|
||||
GST_DEBUG
|
||||
("live: %d, num attachments: %d, num attachments_left: %d, eos: %d, "
|
||||
"close_transfer: %d, final boundary: %d, array_len: %d", bcsink->is_live,
|
||||
sink->nbr_attachments, sink->nbr_attachments_left, sink->eos, close_transfer,
|
||||
sink->final_boundary_added, array->len);
|
||||
sink->nbr_attachments, sink->nbr_attachments_left, sink->eos,
|
||||
close_transfer, sink->final_boundary_added, array->len);
|
||||
|
||||
|
||||
if ((bcsink->is_live && (sink->nbr_attachments_left == sink->nbr_attachments))
|
||||
|| (sink->nbr_attachments == 1) || sink->eos || sink->final_boundary_added) {
|
||||
|| (sink->nbr_attachments == 1) || sink->eos
|
||||
|| sink->final_boundary_added) {
|
||||
bcsink->is_live = FALSE;
|
||||
sink->reset_transfer_options = TRUE;
|
||||
sink->final_boundary_added = FALSE;
|
||||
|
|
Loading…
Reference in a new issue