mirror of
				https://github.com/usmannasir/cyberpanel.git
				synced 2025-11-03 11:55:57 +01:00 
			
		
		
		
	
		
			
	
	
		
			45 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			45 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| 
								 | 
							
								/*****************************************************************************
							 | 
						||
| 
								 | 
							
								*    Open LiteSpeed is an open source HTTP server.                           *
							 | 
						||
| 
								 | 
							
								*    Copyright (C) 2013 - 2015  LiteSpeed Technologies, Inc.                 *
							 | 
						||
| 
								 | 
							
								*                                                                            *
							 | 
						||
| 
								 | 
							
								*    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 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.                            *
							 | 
						||
| 
								 | 
							
								*                                                                            *
							 | 
						||
| 
								 | 
							
								*    You should have received a copy of the GNU General Public License       *
							 | 
						||
| 
								 | 
							
								*    along with this program. If not, see http://www.gnu.org/licenses/.      *
							 | 
						||
| 
								 | 
							
								*****************************************************************************/
							 | 
						||
| 
								 | 
							
								#include "../include/ls.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define MNAME       hellohandler
							 | 
						||
| 
								 | 
							
								lsi_module_t MNAME;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								static char resp_buf[] = "Hello module handler.\r\n";
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								static int begin_process(const lsi_session_t *session)
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    g_api->set_status_code(session, 200);
							 | 
						||
| 
								 | 
							
								    g_api->set_resp_header(session, LSI_RSPHDR_CONTENT_TYPE, NULL, 0,
							 | 
						||
| 
								 | 
							
								                           "text/html", 9, LSI_HEADEROP_SET);
							 | 
						||
| 
								 | 
							
								    g_api->append_resp_body(session, resp_buf, sizeof(resp_buf) - 1);
							 | 
						||
| 
								 | 
							
								    g_api->end_resp(session);
							 | 
						||
| 
								 | 
							
								    return 0;
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * Define a handler, need to provide a struct _handler_st object, in which
							 | 
						||
| 
								 | 
							
								 * the first function pointer should not be NULL
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								static lsi_reqhdlr_t myhandler = { begin_process, NULL, NULL, NULL };
							 | 
						||
| 
								 | 
							
								lsi_module_t MNAME = { LSI_MODULE_SIGNATURE, NULL, &myhandler, NULL };
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 |