diff --git a/src/main.c b/src/main.c index 4988bc2..729ac7f 100644 --- a/src/main.c +++ b/src/main.c @@ -1,3 +1,21 @@ +/* main.c + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #include #include "teleport-app.h" diff --git a/src/teleport-app.c b/src/teleport-app.c index 6f4a2ac..ff67e44 100644 --- a/src/teleport-app.c +++ b/src/teleport-app.c @@ -1,3 +1,21 @@ +/* teleport-app.c + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #include #include "teleport-app.h" diff --git a/src/teleport-app.h b/src/teleport-app.h index 96bd2de..45ddda3 100644 --- a/src/teleport-app.h +++ b/src/teleport-app.h @@ -1,3 +1,21 @@ +/* teleport-app.h + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #ifndef __TELEPORT_APP_H #define __TELEPORT_APP_H diff --git a/src/teleport-browser.c b/src/teleport-browser.c index 2a72cb1..a24e386 100644 --- a/src/teleport-browser.c +++ b/src/teleport-browser.c @@ -1,3 +1,21 @@ +/* teleport-browser.c + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #include #include #include diff --git a/src/teleport-browser.h b/src/teleport-browser.h index 714154b..ade4182 100644 --- a/src/teleport-browser.h +++ b/src/teleport-browser.h @@ -1,3 +1,21 @@ +/* teleport-browser.h + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #ifndef __TELEPORT_BROWSER_H #define __TELEPORT_BROWSER_H diff --git a/src/teleport-get.c b/src/teleport-get.c index 7f7e854..d8afdc8 100644 --- a/src/teleport-get.c +++ b/src/teleport-get.c @@ -1,3 +1,21 @@ +/* teleport-get.c + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/src/teleport-get.h b/src/teleport-get.h index 3d42a2e..8e45a41 100644 --- a/src/teleport-get.h +++ b/src/teleport-get.h @@ -1,3 +1,21 @@ +/* teleport-get.h + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #ifndef __TELEPORT_GET_H #define __TELEPORT_GET_H diff --git a/src/teleport-peer.c b/src/teleport-peer.c index 4740e61..5c1cefc 100644 --- a/src/teleport-peer.c +++ b/src/teleport-peer.c @@ -1,3 +1,21 @@ +/* teleport-peer.c + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #include #include "teleport-peer.h" diff --git a/src/teleport-peer.h b/src/teleport-peer.h index 9a820ac..abb6ffd 100644 --- a/src/teleport-peer.h +++ b/src/teleport-peer.h @@ -1,3 +1,21 @@ +/* teleport-peer.h + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #ifndef __TELEPORT_PEER_H #define __TELEPORT_PEER_H diff --git a/src/teleport-publish.c b/src/teleport-publish.c index 4cde514..8c95fef 100644 --- a/src/teleport-publish.c +++ b/src/teleport-publish.c @@ -1,3 +1,21 @@ +/* main.c + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/src/teleport-publish.h b/src/teleport-publish.h index daa1cd2..819a068 100644 --- a/src/teleport-publish.h +++ b/src/teleport-publish.h @@ -1,3 +1,21 @@ +/* teleport-publish.h + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #ifndef __TELEPORT_PUBLISH_H #define __TELEPORT_PUBLISH_H diff --git a/src/teleport-remote-device.c b/src/teleport-remote-device.c index 8262a94..d0e8f1a 100644 --- a/src/teleport-remote-device.c +++ b/src/teleport-remote-device.c @@ -1,20 +1,20 @@ /* teleport-remote-device.c * - * Copyright (C) 2017 Julian Sparber + * Copyright 2017 Julian Sparber * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . - */ +*/ #include #include "teleport-remote-device.h" diff --git a/src/teleport-remote-device.h b/src/teleport-remote-device.h index 6522a56..c0d8d94 100644 --- a/src/teleport-remote-device.h +++ b/src/teleport-remote-device.h @@ -1,20 +1,20 @@ -/* teleport-remote-device.h +/* teleport-remote-device.c * - * Copyright (C) 2017 Julian Sparber + * Copyright 2017 Julian Sparber * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . - */ +*/ #ifndef TELEPORT_REMOTE_DEVICE_H #define TELEPORT_REMOTE_DEVICE_H diff --git a/src/teleport-server.c b/src/teleport-server.c index 5db5c67..7ce9519 100644 --- a/src/teleport-server.c +++ b/src/teleport-server.c @@ -1,8 +1,22 @@ +/* teleport-server.c + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #include -#include -#include -#include -#include #include #include @@ -21,7 +35,6 @@ do_get (SoupServer *server, SoupMessage *msg, const char *path) { GStatBuf st; - printf("paths: %s", path); if (g_stat (path, &st) == -1) { if (errno == EPERM) soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN); @@ -148,8 +161,6 @@ server_callback (SoupServer *server, SoupMessage *msg, soup_message_set_status (msg, SOUP_STATUS_OK); g_print("Handle response\n"); } - - //do_get_response_json (server, msg, "hello world"); } else soup_message_set_status (msg, SOUP_STATUS_NOT_IMPLEMENTED); @@ -188,19 +199,26 @@ teleport_server_add_route (gchar *name, path = g_strdup_printf("/transfer/%s", name); soup_server_add_handler (glob_server, path, server_callback, g_strdup(file_to_send), NULL); - //send notification of available file to the client - //For getting file size - //https://developer.gnome.org/gio/stable/GFile.html#g-file-query-info + + /* send notification of available file to the client */ + /* getting file size */ file = g_file_new_for_path(file_to_send); - //G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, G_FILE_ATTRIBUTE_STANDARD_SIZE - fileInfo = g_file_query_info(file, "standard::display-name,standard::size", G_FILE_QUERY_INFO_NONE, NULL, NULL); + fileInfo = g_file_query_info(file, + "standard::display-name,standard::size", + G_FILE_QUERY_INFO_NONE, + NULL, + NULL); + teleport_get_do_client_notify(g_strdup_printf("http://%s:%d/?token=%s&size=%jd&name=%s\n", destination, port, name, g_file_info_get_size(fileInfo), g_file_info_get_display_name(fileInfo))); + + /* Add timeout of 2 min which removes the route again */ g_timeout_add_seconds (2 * 60, do_server_timeout, path); + g_object_unref(fileInfo); g_object_unref(file); return 0; @@ -230,7 +248,5 @@ teleport_server_run (void) { } g_slist_free (uris); - g_print ("\nWaiting for requests...\n"); - return 0; } diff --git a/src/teleport-server.h b/src/teleport-server.h index e2be4b1..ba474d4 100644 --- a/src/teleport-server.h +++ b/src/teleport-server.h @@ -1,3 +1,21 @@ +/* teleport-server.h + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #ifndef __TELEPORT_SERVER_H #define __TELEPORT_SERVER_H diff --git a/src/teleport-window.c b/src/teleport-window.c index d979109..1781b29 100644 --- a/src/teleport-window.c +++ b/src/teleport-window.c @@ -1,3 +1,21 @@ +/* teleport-window.c + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #include #include "teleport-app.h" diff --git a/src/teleport-window.h b/src/teleport-window.h index 7917618..e346568 100644 --- a/src/teleport-window.h +++ b/src/teleport-window.h @@ -1,3 +1,21 @@ +/* teleport-window.h + * + * Copyright 2017 Julian Sparber + * + * Teleport is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +*/ + #ifndef __TELEPORT_WINDOW_H #define __TELEPORT_WINDOW_H