Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Julian Sparber
teleport
Commits
15a467ee
Commit
15a467ee
authored
Dec 17, 2020
by
Julian Sparber
Browse files
teleport-server: remove file path once started downloading
parent
e017fac6
Pipeline
#239602
passed with stage
in 1 minute and 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/teleport-server.c
View file @
15a467ee
...
...
@@ -45,17 +45,17 @@ static void
finished_cb
(
TeleportFile
*
file
,
SoupMessage
*
msg
)
{
/* TODO: remove file from send_files hash table */
/*
teleport_file_set_stat
us
(file, TELEPORT_FILE_
COMPLETED); */
teleport_file_set_progress
(
file
,
100
);
teleport_file_set_progress
(
file
,
1
.
0
);
teleport_file_set_stat
e
(
file
,
TELEPORT_FILE_
STATE_FINISH
);
g_object_unref
(
file
);
}
static
void
start_sending_cb
(
TeleportFile
*
file
,
SoupMessage
*
msg
)
{
/* teleport_file_set_status (file, TELEPORT_FILE_STARTED); */
teleport_file_set_progress
(
file
,
0
);
teleport_file_set_state
(
file
,
TELEPORT_FILE_STATE_TRANSFER
);
}
static
void
...
...
@@ -80,11 +80,12 @@ file_request_cb (TeleportServer *self,
if
(
msg
->
method
==
SOUP_METHOD_GET
)
{
GMappedFile
*
mapping
;
SoupBuffer
*
buffer
=
NULL
;
gchar
*
key
;
TeleportFile
*
file
;
gchar
*
lookup_key
=
NULL
;
g_autofree
gchar
*
key
=
NULL
;
TeleportFile
*
file
=
NULL
;
key
=
g_strrstr
(
path
,
"/"
)
+
1
;
file
=
g_hash_table_
lookup
(
self
->
send_files
,
key
);
lookup_
key
=
g_strrstr
(
path
,
"/"
)
+
1
;
g_hash_table_
steal_extended
(
self
->
send_files
,
lookup_key
,
(
gpointer
*
)
&
key
,
(
gpointer
*
)
&
file
);
if
(
!
TELEPORT_IS_FILE
(
file
))
{
soup_message_set_status
(
msg
,
SOUP_STATUS_NOT_FOUND
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment