[refactor] add prefix to public functions of teleport-server
This commit is contained in:
@@ -168,7 +168,7 @@ teleport_app_activate (GApplication *app) {
|
||||
|
||||
create_finished_notification ("USER", 2000, "FILENAME", value);
|
||||
*/
|
||||
run_http_server();
|
||||
teleport_server_run();
|
||||
teleport_publish_run ((gchar *) g_get_host_name());
|
||||
teleport_browser_run_avahi_service(peerList);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include <libsoup/soup.h>
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
#include "teleport-get.h"
|
||||
#include "teleport-server.h"
|
||||
#include "teleport-get.h"
|
||||
#include "teleport-app.h"
|
||||
|
||||
static int port;
|
||||
@@ -147,7 +147,11 @@ do_get (SoupServer *server, SoupMessage *msg, const char *path)
|
||||
soup_message_set_status (msg, SOUP_STATUS_OK);
|
||||
}
|
||||
|
||||
static void handle_incoming_file(const char *hash, const char *filename, const int size, const char *origin) {
|
||||
static void
|
||||
handle_incoming_file(const char *hash,
|
||||
const char *filename,
|
||||
const int size,
|
||||
const char *origin) {
|
||||
GVariantBuilder *builder;
|
||||
GVariant *value;
|
||||
|
||||
@@ -241,7 +245,10 @@ server_callback (SoupServer *server, SoupMessage *msg,
|
||||
g_print (" -> %d %s\n\n", msg->status_code, msg->reason_phrase);
|
||||
}
|
||||
|
||||
int addRouteToServer(char *name, char *file_to_send, char *destination) {
|
||||
int
|
||||
teleport_server_add_route (gchar *name,
|
||||
gchar *file_to_send,
|
||||
gchar *destination) {
|
||||
GFile *file;
|
||||
GFileInfo *fileInfo;
|
||||
soup_server_add_handler (glob_server, g_strdup_printf("/transfer/%s", name),
|
||||
@@ -263,7 +270,8 @@ int addRouteToServer(char *name, char *file_to_send, char *destination) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern int run_http_server(void) {
|
||||
int
|
||||
teleport_server_run (void) {
|
||||
GSList *uris, *u;
|
||||
char *str;
|
||||
//GTlsCertificate *cert;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#ifndef __TELEPORT_SERVER_H
|
||||
#define __TELEPORT_SERVER_H
|
||||
|
||||
|
||||
extern int run_http_server(void);
|
||||
extern int addRouteToServer(char *, char *, char *);
|
||||
int teleport_server_run (void);
|
||||
int teleport_server_add_route (gchar *,
|
||||
gchar *,
|
||||
gchar *);
|
||||
|
||||
#endif /* __TELEPORT_SERVER_H */
|
||||
|
||||
@@ -78,7 +78,7 @@ open_file_picker(GtkButton *btn, Peer *device) {
|
||||
filename = gtk_file_chooser_get_filename (chooser);
|
||||
g_print("Choosen file is %s\n", filename);
|
||||
gtk_widget_destroy (dialog);
|
||||
addRouteToServer(g_compute_checksum_for_string (G_CHECKSUM_SHA256, filename, -1), filename, device->ip);
|
||||
teleport_server_add_route (g_compute_checksum_for_string (G_CHECKSUM_SHA256, filename, -1), filename, device->ip);
|
||||
g_free (filename);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user