diff options
Diffstat (limited to 'plugins/HTTPServer/src')
| -rw-r--r-- | plugins/HTTPServer/src/Glob.h | 13 | ||||
| -rw-r--r-- | plugins/HTTPServer/src/HttpUser.cpp | 8 | ||||
| -rw-r--r-- | plugins/HTTPServer/src/Version.h | 14 | ||||
| -rw-r--r-- | plugins/HTTPServer/src/m_HTTPServer.h | 105 | ||||
| -rw-r--r-- | plugins/HTTPServer/src/main.cpp | 21 | 
5 files changed, 30 insertions, 131 deletions
diff --git a/plugins/HTTPServer/src/Glob.h b/plugins/HTTPServer/src/Glob.h index e9503f07be..f64d28d950 100644 --- a/plugins/HTTPServer/src/Glob.h +++ b/plugins/HTTPServer/src/Glob.h @@ -22,29 +22,23 @@  #include <windows.h>
  #include <commctrl.h>
 -#include <process.h>
  #include <time.h>
 -#include <stdio.h>
  #include <string>
 -#include <win2k.h>
  using namespace std;
 +#include <win2k.h>
  #include <newpluginapi.h>
  #include <m_database.h>
  #include <m_clist.h>
 -#include <m_skin.h>
  #include <m_langpack.h>
  #include <m_clui.h>
 -#include <m_options.h>
 -#include <m_system.h>
 -#include <m_history.h>
  #include <m_userinfo.h>
  #include <m_netlib.h>
  #include <m_message.h>
  #include <m_popup.h>
  #include <m_protosvc.h>
 -#include "m_HTTPServer.h"
 +#include <m_HTTPServer.h>
  #include "FileShareNode.h"
  #include "HttpUser.h"
 @@ -52,6 +46,7 @@ using namespace std;  #include "MimeHandling.h"
  #include "resource.h"
  #include "IndexCreation.h"
 +#include "Version.h"
  #define SD_RECEIVE      0x00
 @@ -90,6 +85,4 @@ extern bool bLimitOnlyWhenOnline;  extern void* (*MirandaMalloc)(size_t);
  extern void (*MirandaFree)(void*);
 -extern char * pszVersion;
 -
  #endif
\ No newline at end of file diff --git a/plugins/HTTPServer/src/HttpUser.cpp b/plugins/HTTPServer/src/HttpUser.cpp index fc0f24be3f..475765f495 100644 --- a/plugins/HTTPServer/src/HttpUser.cpp +++ b/plugins/HTTPServer/src/HttpUser.cpp @@ -250,7 +250,7 @@ void CLHttpUser::SendError(int iErrorCode, const char * pszError, const char * p  	    "</BODY></HTML>\n"
  	    "\r\n"
  	    "\r\n",
 -	    iErrorCode, pszError, szCurTime, pszVersion, iErrorCode, pszError, pszError, pszDescription, pszVersion);
 +	    iErrorCode, pszError, szCurTime, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), iErrorCode, pszError, pszError, pszDescription, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM));
  	Netlib_Send(hConnection, szBuf, dwBytesToWrite, 0);
  }
 @@ -301,7 +301,7 @@ void CLHttpUser::SendRedir(int iErrorCode, const char * pszError, const char * p  	    "</BODY></HTML>\n"
  	    "\r\n"
  	    "\r\n",
 -	    iErrorCode, pszError, szCurrTime, pszVersion, pszRedirect, iErrorCode, pszError, pszError, pszDescription, pszVersion);
 +	    iErrorCode, pszError, szCurrTime, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), pszRedirect, iErrorCode, pszError, pszError, pszDescription, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM));
  	Netlib_Send(hConnection, szBuff, dwBytesToWrite, 0);
  }
 @@ -618,7 +618,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) {  				dwBytesToWrite = _snprintf(szBuf, sizeof(szBuf), szHttpPartial ,
  				    szCurTime ,
 -				    pszVersion,
 +				    PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
  				    szETag ,
  				    dwDataToSend ,
  				    pszGetMimeType(pszRealPath),
 @@ -640,7 +640,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) {  				dwBytesToWrite = _snprintf(szBuf, sizeof(szBuf), szHttpOk ,
  				    szCurTime ,
 -				    pszVersion,
 +				    PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
  				    szETag ,
  				    nDataSize ,
  				    pszGetMimeType(pszRealPath),
 diff --git a/plugins/HTTPServer/src/Version.h b/plugins/HTTPServer/src/Version.h new file mode 100644 index 0000000000..c736349026 --- /dev/null +++ b/plugins/HTTPServer/src/Version.h @@ -0,0 +1,14 @@ +#define __MAJOR_VERSION				0
 +#define __MINOR_VERSION				1
 +#define __RELEASE_NUM				2
 +#define __BUILD_NUM					2
 +
 +#define __FILEVERSION_STRING		__MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
 +
 +#define __PLUGIN_NAME				"HTTPServer"
 +#define __FILENAME					"HTTPServer.dll"
 +#define __DESCRIPTION 				"HTTP Web Server plugin for Miranda."
 +#define __AUTHOR					"Kennet Nielsen, modified by Vampik, Houdini"
 +#define __AUTHOREMAIL				""
 +#define __AUTHORWEB					"http://miranda-ng.org/"
 +#define __COPYRIGHT					"© 2003-2009 Kennet Nielsen, Vampik, Houdini"
 diff --git a/plugins/HTTPServer/src/m_HTTPServer.h b/plugins/HTTPServer/src/m_HTTPServer.h deleted file mode 100644 index 6cb6549ee0..0000000000 --- a/plugins/HTTPServer/src/m_HTTPServer.h +++ /dev/null @@ -1,105 +0,0 @@ -//This file is part of HTTPServer a Miranda IM plugin
 -//Copyright (C)2002 Kennet Nielsen
 -//
 -//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 the Free Software Foundation; either
 -//version 2 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.
 -//
 -//You should have received a copy of the GNU General Public License
 -//along with this program; if not, write to the Free Software
 -//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 -
 -
 -#ifndef M_HTTP_SERVER_H
 -#define M_HTTP_SERVER_H
 -
 -
 -#define OPT_SEND_LINK 0x1
 -
 -
 -typedef struct {
 -	DWORD lStructSize;  // Set to sizeof(STFileShareInfo)
 -	char * pszSrvPath;  // Server path
 -	DWORD dwMaxSrvPath; // Buffer allocated for Server path only used when information is requested from HTTP server.
 -	char * pszRealPath; // Real path can be relative or complete
 -	DWORD dwMaxRealPath;// Buffer allocated for Real path only used when information is requested from HTTP server.
 -	DWORD dwAllowedIP;   // The IP address which is allowed to access this share
 -	DWORD dwAllowedMask; // A mask which is applied to IP address to allow other IP addresses
 -	int nMaxDownloads;  // The maximum number of download which can be made on this share.
 -	DWORD dwOptions;	  // Use OPT_SEND_LINK to open a message window with the link to file
 -} STFileShareInfo, * LPSTFileShareInfo;
 -
 -// dwMaxSrvPath Specifies the size, in chars, of the buffer pointed to by pszSrvPath.
 -// The buffer must be large enough to store the path and file name string,
 -// including the terminating null character.
 -
 -
 -/////////////////////////////////////////////
 -///   Service MS_HTTP_ADD_CHANGE_REMOVE   ///
 -/////////////////////////////////////////////
 -//
 -// wParam = (WPARAM)0
 -// lParam = (LPARAM)LPSTFileShareInfo;
 -// Server path is the key when working with FileShareInfo.
 -// Two files can not be shared with the same "Server path" in the HTTP server.
 -// If the server path does not exists it will be added.
 -// If it does exists the action depends on what real path is.
 -// If real path is empty the entity will be removed else it
 -// will just be updated with the new settings.
 -
 -//
 -// returns 0 on success, nonzero on failure
 -#define MS_HTTP_ADD_CHANGE_REMOVE		"HTTPServer/AddChangeRemove"
 -
 -
 -/////////////////////////////////////////////
 -//////    Service MS_HTTP_GET_SHARE    //////
 -/////////////////////////////////////////////
 -//
 -// wParam = (WPARAM)0;
 -// lParam = (LPARAM)LPSTFileShareInfo;
 -// Returns the information for a share
 -// Server path must be set the the share you wish information for.
 -//
 -// returns 0 on success, nonzero on failure
 -
 -#define MS_HTTP_GET_SHARE	"HTTPServer/GetShare"
 -
 -
 -
 -/////////////////////////////////////////////
 -///  Service MS_HTTP_ACCEPT_CONNECTIONS   ///
 -/////////////////////////////////////////////
 -//
 -// wParam = (WPARAM)boolean(true/false);
 -// lParam = (LPARAM)0;
 -// Toggles the HTTP server state if wParam is FALSE
 -// Force enable HTTP server if wParam is TRUE
 -// returns 0 on success, nonzero on failure
 -
 -#define MS_HTTP_ACCEPT_CONNECTIONS	"HTTPServer/AcceptConnections"
 -
 -/////////////////////////////////////////////
 -////   Service MS_HTTP_GET_ALL_SHARES   /////
 -/////////////////////////////////////////////
 -//
 -// wParam = (WPARAM)0;
 -// lParam = (LPARAM)&LPSTFileShareInfo;
 -// Returns an array of all currently shared files in the HTTP Server
 -// LPSTFileShareInfo points to the first share.
 -// You must free the memory returned by using the miranda MS_SYSTEM_GET_MMI
 -// and calling MM_INTERFACE->free( LPSTFileShareInfo )
 -//
 -// returns the count of shares in the buffer pointed to by LPSTFileShareInfo
 -
 -#define MS_HTTP_GET_ALL_SHARES	"HTTPServer/GetAllShares"
 -
 -
 -
 -#endif
 diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index a9824e51d2..d4c1fdd011 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -84,21 +84,18 @@ bool bShutdownInProgress = false;  int hLangpack = 0;
 -char* pszVersion = "0.1.2.2";
 -
  PLUGININFOEX pluginInfo = {
  	sizeof(PLUGININFOEX),
 -	MODULE,
 -	PLUGIN_MAKE_VERSION(0, 1, 2, 2),
 -	"HTTP Server\r\n"
 -	"HTTP Web Server plugin for Miranda",
 -	"Kennet Nielsen, modified by Vampik, Houdini",
 -	"",
 -	"© 2003-2009 Kennet Nielsen, Vampik, Houdini",
 -	"http://addons.miranda-im.org/details.php?action=viewfile&id=2304",
 +	__PLUGIN_NAME,
 +	PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
 +	__DESCRIPTION,
 +	__AUTHOR,
 +	__AUTHOREMAIL,
 +	__COPYRIGHT,
 +	__AUTHORWEB,
  	UNICODE_AWARE,
 -	// {67848B07-83D2-49e9-8844-7E3DE268E304}
 -	{ 0x67848b07, 0x83d2, 0x49e9, { 0x88, 0x44, 0x7e, 0x3d, 0xe2, 0x68, 0xe3, 0x4 } }
 +	// {67848B07-83D2-49E9-8844-7E3DE268E304}
 +	{0x67848b07, 0x83d2, 0x49e9, {0x88, 0x44, 0x7e, 0x3d, 0xe2, 0x68, 0xe3, 0x4}}
  };
  | 
