From 142292d716f0240f0cd50b8c17daa284d782cec8 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sun, 9 Nov 2003 06:17:26 +0000 Subject: [PATCH] Se borran archivos obsoletos. --- Server/include/plaqui/server/request.h | 100 ------------- .../include/plaqui/server/serverconnection.h | 92 ------------ Server/src/controlserver.cpp | 2 +- Server/src/request.cpp | 139 ------------------ Server/src/serverconnection.cpp | 57 ------- 5 files changed, 1 insertion(+), 389 deletions(-) delete mode 100644 Server/include/plaqui/server/request.h delete mode 100644 Server/include/plaqui/server/serverconnection.h delete mode 100644 Server/src/request.cpp delete mode 100644 Server/src/serverconnection.cpp diff --git a/Server/include/plaqui/server/request.h b/Server/include/plaqui/server/request.h deleted file mode 100644 index d20b85f..0000000 --- a/Server/include/plaqui/server/request.h +++ /dev/null @@ -1,100 +0,0 @@ -// vim: set noexpandtab tabstop=4 shiftwidth=4: -//---------------------------------------------------------------------------- -// PlaQui -//---------------------------------------------------------------------------- -// This file is part of PlaQui. -// -// PlaQui is free software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the Free Software -// Foundation; either version 2 of the License, or (at your option) any later -// version. -// -// PlaQui 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. -// -// You should have received a copy of the GNU General Public License along -// with PlaQui; if not, write to the Free Software Foundation, Inc., 59 Temple -// Place, Suite 330, Boston, MA 02111-1307 USA -//---------------------------------------------------------------------------- -// Creado: dom oct 19 16:46:00 ART 2003 -// Autores: Leandro Lucarella -//---------------------------------------------------------------------------- -// -// $Id$ -// - -#ifndef PLAQUI_REQUEST_H -#define PLAQUI_REQUEST_H - -#include -#include - -namespace PlaQui { - -namespace Server { - - /// Conexión. - class Request: public std::map { - - protected: - - /// Caracteres dígitos para URIs (RFC 2396). - static const std::string CHARS_DIGIT; - - /// Caracteres alfabéticos en minúsculas para URIs (RFC 2396). - static const std::string CHARS_LOWALPHA; - - /// Caracteres alfabéticos en mayúsculas para URIs (RFC 2396). - static const std::string CHARS_UPALPHA; - - /// Caracteres alfabéticos para URIs (RFC 2396). - static const std::string CHARS_ALPHA; - - /// Caracteres alfabnuméricos para URIs (RFC 2396). - static const std::string CHARS_ALPHANUM; - - /// Caracteres reservados para URIs (RFC 2396). - static const std::string CHARS_RESERVED; - - /// Caracteres de marca para URIs (RFC 2396). - static const std::string CHARS_MARK; - - /// Caracteres no reservados para URIs (RFC 2396). - static const std::string CHARS_UNRESERVED; - - /// Caracteres no hexa para URIs (RFC 2396). - static const std::string CHARS_HEX; - - public: - - /** - * Destructor. - */ - virtual ~Request(void); - - /** - * Agrega variables con un request HTTP. - * - * \param req Petición HTTP (POST o GET). - * \param host Host remoto. - * \param port Puerto remoto. - */ - void set_request(const std::string& req, const std::string& host, - unsigned port); - - /** - * Procesa una cabecera para obtener nuevas "variables". - * - * \param header Cabecera HTTP. - */ - void parse_header(const std::string& header); - - }; - -} - -} - -#endif // PLAQUI_REQUEST_H diff --git a/Server/include/plaqui/server/serverconnection.h b/Server/include/plaqui/server/serverconnection.h deleted file mode 100644 index 1444343..0000000 --- a/Server/include/plaqui/server/serverconnection.h +++ /dev/null @@ -1,92 +0,0 @@ -// vim: set noexpandtab tabstop=4 shiftwidth=4: -//---------------------------------------------------------------------------- -// PlaQui -//---------------------------------------------------------------------------- -// This file is part of PlaQui. -// -// PlaQui is free software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the Free Software -// Foundation; either version 2 of the License, or (at your option) any later -// version. -// -// PlaQui 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. -// -// You should have received a copy of the GNU General Public License along -// with PlaQui; if not, write to the Free Software Foundation, Inc., 59 Temple -// Place, Suite 330, Boston, MA 02111-1307 USA -//---------------------------------------------------------------------------- -// Creado: Tue Oct 21 20:43:04 ART 2003 -// Autores: Leandro Lucarella -//---------------------------------------------------------------------------- -// -// $Id$ -// - -#ifndef PLAQUI_SERVERCONNECTION_H -#define PLAQUI_SERVERCONNECTION_H - -#include "plaqui/server/connection.h" -#include -#include - -namespace PlaQui { - -namespace Server { - - /// Conexión de un servidor. - class ServerConnection: public Connection { - - // Tipos. - - public: - - /// Tipo de señal para indicar que se recibió un comando. - // FIXME - poner un tipo Command que sea padre de todos los - // comandos. - typedef SigC::Signal1 SignalCommandReceived; - - // Atributos. - - private: - - /// Señal que indica que se recibió un comando. - SignalCommandReceived command_received; - - // Métodos. - - public: - - /** - * Destructor. - */ - virtual ~ServerConnection(void); - - /** - * Constructor. - * - * \param socket Descriptor de socket a usar en la conexión. - */ - ServerConnection(const sockbuf::sockdesc& sd); - - /** - * Constructor. - * - * \param type Tipo de socket a usar. - */ - ServerConnection(sockbuf::type type); - - /** - * Obtiene la señal que avisa que se recibió un comando. - */ - SignalCommandReceived& signal_command_received(void); - - }; - -} - -} - -#endif // PLAQUI_SERVERCONNECTION_H diff --git a/Server/src/controlserver.cpp b/Server/src/controlserver.cpp index 133f36e..7a4cedc 100644 --- a/Server/src/controlserver.cpp +++ b/Server/src/controlserver.cpp @@ -138,7 +138,7 @@ Accept-Ranges: bytes socket << "Content-Type: text/html; charset=iso-8859-1" << endl; response_xml << "" << endl; response_xml << " " << endl; - response_xml << " PlaQui v0.1" << endl; + response_xml << " PlaQui v0.4" << endl; response_xml << " " << endl; response_xml << " " << endl; response_xml << "

PlaQui

" << endl; diff --git a/Server/src/request.cpp b/Server/src/request.cpp deleted file mode 100644 index f40c9f9..0000000 --- a/Server/src/request.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// vim: set noexpandtab tabstop=4 shiftwidth=4: -//---------------------------------------------------------------------------- -// PlaQui -//---------------------------------------------------------------------------- -// This file is part of PlaQui. -// -// PlaQui is free software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the Free Software -// Foundation; either version 2 of the License, or (at your option) any later -// version. -// -// PlaQui 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. -// -// You should have received a copy of the GNU General Public License along -// with PlaQui; if not, write to the Free Software Foundation, Inc., 59 Temple -// Place, Suite 330, Boston, MA 02111-1307 USA -//---------------------------------------------------------------------------- -// Creado: dom oct 19 16:41:15 ART 2003 -// Autores: Leandro Lucarella -//---------------------------------------------------------------------------- -// -// $Id$ -// - -#include "plaqui/server/request.h" -#include "plaqui/server/string.h" -#include -#include -#include -#ifdef DEBUG -# include -#endif // DEBUG - -const std::string -PlaQui::Server::Request::CHARS_DIGIT = "0123456789"; - -const std::string -PlaQui::Server::Request::CHARS_LOWALPHA = "abcdefghijklmnopqrstuvwxyz"; - -const std::string -PlaQui::Server::Request::CHARS_UPALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - -const std::string -PlaQui::Server::Request::CHARS_ALPHA = CHARS_LOWALPHA + CHARS_UPALPHA; - -const std::string -PlaQui::Server::Request::CHARS_ALPHANUM = CHARS_DIGIT + CHARS_ALPHA; - -const std::string -PlaQui::Server::Request::CHARS_RESERVED = ";/?:@&=+$,"; - -const std::string -PlaQui::Server::Request::CHARS_MARK = "-_.!~*'()"; - -const std::string -PlaQui::Server::Request::CHARS_UNRESERVED = CHARS_ALPHANUM + CHARS_MARK; - -const std::string -PlaQui::Server::Request::CHARS_HEX = CHARS_DIGIT + std::string("abcdefABCDEF"); - -PlaQui::Server::Request::~Request(void) { -} - -void PlaQui::Server::Request::set_request(const std::string& req, - const std::string& host, unsigned port) { -#ifdef DEBUG - std::cerr << __FILE__ << ": req = " << req << " | host = " << host - << " | port = " << port << std::endl; -#endif // DEBUG - String request(req); - (*this)["REMOTE_HOST"] = host; - std::stringstream ss; - ss << port; - (*this)["REMOTE_PORT"] = ss.str(); - // Parseo el GET de forma rudimentaria. - if (request.length() < 3) { - // FIXME - poner excepciones lindas. - throw "HTTP/1.1 501 Method Not Implemented"; - } - // Averiguo método. - std::string::size_type pos = request.find_first_of(String::SPACE_CHARS); - String method = request.substr(0, pos); - if ((method.to_upper() == "GET") || (method.to_upper() == "POST")) { - (*this)["REQUEST_METHOD"] = method; - } else { - // FIXME - poner excepciones lindas. - throw "HTTP/1.1 501 Method Not Implemented"; - } - // Si tiene sólo el método, no es válido. - request = request.substr(pos + 1); - request.trim(); - if (!request.length()) { - // FIXME - poner excepciones lindas. - throw "HTTP/1.1 400 Bad Request"; - } - // Si tiene más espacios, tengo la URI y el protocolo (o un error). - pos = request.find_first_of(String::SPACE_CHARS); - if (pos != std::string::npos) { - // Si el resto es un protocolo válido, agrego más variables. - String protocol = request.substr(pos + 1); - protocol = protocol.trim(); - if ((String(protocol).to_upper() == "HTTP/1.0") - || (String(protocol).to_upper() == "HTTP/1.1")) { - (*this)["SERVER_PROTOCOL"] = protocol; - // Si no es un error. - } else { - // FIXME - poner excepciones lindas. - throw "HTTP/1.1 400 Bad Request"; - } - request = request.substr(0, pos); - } - // Agrego la URI y sus derivados. - if (!request.length() || (request[0] != '/')) { - // FIXME || request.find_first_not_of(";/?:@&=+$,")) { - // FIXME - poner excepciones lindas. - throw "HTTP/1.1 400 Bad Request"; - } - (*this)["REQUEST_URI"] = request; - // Si tiene un query string. - pos = request.find("?"); - if (pos != std::string::npos) { - (*this)["QUERY_STRING"] = request.substr(pos + 1); - // No tiene query string. - } else { - (*this)["QUERY_STRING"] = ""; - } - (*this)["SCRIPT_NAME"] = request.substr(0, pos); -} - -void PlaQui::Server::Request::parse_header(const std::string& header) { -#ifdef DEBUG - std::cerr << __FILE__ << ": header = " << header << std::endl; -#endif // DEBUG - -} - diff --git a/Server/src/serverconnection.cpp b/Server/src/serverconnection.cpp deleted file mode 100644 index 6cbe0f3..0000000 --- a/Server/src/serverconnection.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// vim: set noexpandtab tabstop=4 shiftwidth=4: -//---------------------------------------------------------------------------- -// PlaQui -//---------------------------------------------------------------------------- -// This file is part of PlaQui. -// -// PlaQui is free software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the Free Software -// Foundation; either version 2 of the License, or (at your option) any later -// version. -// -// PlaQui 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. -// -// You should have received a copy of the GNU General Public License along -// with PlaQui; if not, write to the Free Software Foundation, Inc., 59 Temple -// Place, Suite 330, Boston, MA 02111-1307 USA -//---------------------------------------------------------------------------- -// Creado: Wed Oct 22 00:06:06 ART 2003 -// Autores: Leandro Lucarella -//---------------------------------------------------------------------------- -// -// $Id$ -// - -#include "plaqui/server/serverconnection.h" -#include -#ifdef DEBUG -# include -#endif // DEBUG - -PlaQui::Server::ServerConnection::~ServerConnection(void) { -#ifdef DEBUG - std::cerr << __FILE__ << ": destructor." << std::endl; -#endif // DEBUG -} - -PlaQui::Server::ServerConnection::ServerConnection(const sockbuf::sockdesc& sd): - Connection(sd) { -#ifdef DEBUG - std::cerr << __FILE__ << ": sd = " << sd.sock << std::endl; -#endif // DEBUG -} - -PlaQui::Server::ServerConnection::ServerConnection(sockbuf::type type): - Connection(type) { -#ifdef DEBUG - std::cerr << __FILE__ << ": type = " << type << std::endl; -#endif // DEBUG -} - -PlaQui::Server::ServerConnection::SignalCommandReceived& -PlaQui::Server::ServerConnection::signal_command_received(void) { - return command_received; -} -- 2.43.0