Selaa lähdekoodia

xhttp: added supported version

Daniel-Constantin Mierla 15 vuotta sitten
vanhempi
commit
7a67e04c7c
3 muutettua tiedostoa jossa 6 lisäystä ja 4 poistoa
  1. 3 3
      modules/xhttp/README
  2. 1 1
      modules/xhttp/doc/xhttp_admin.xml
  3. 2 0
      modules/xhttp/xhttp_mod.c

+ 3 - 3
modules/xhttp/README

@@ -56,9 +56,9 @@ Chapter 1. Admin Guide
 
 
 1. Overview
 1. Overview
 
 
-   This module provides a basic HTTP server functionaly inside SIP server.
-   SIP and HTTP are very similar protocols, practically the SIP parser can
-   handle easy HTTP requests just by adding a fake Via header.
+   This module provides a basic HTTP/1.0 server functionaly inside SIP
+   server. SIP and HTTP are very similar protocols, practically the SIP
+   parser can handle easy HTTP requests just by adding a fake Via header.
 
 
    The xmlrpc module uses the same concept. xHTTP module offers a generic
    The xmlrpc module uses the same concept. xHTTP module offers a generic
    HTTP handling way, by calling event_route[xhttp:request] in your
    HTTP handling way, by calling event_route[xhttp:request] in your

+ 1 - 1
modules/xhttp/doc/xhttp_admin.xml

@@ -16,7 +16,7 @@
 	<section>
 	<section>
 	<title>Overview</title>
 	<title>Overview</title>
 	<para>
 	<para>
-		This module provides a basic HTTP server functionaly inside SIP
+		This module provides a basic HTTP/1.0 server functionaly inside SIP
 		server. SIP and HTTP are very similar protocols, practically the
 		server. SIP and HTTP are very similar protocols, practically the
 		SIP parser can handle easy HTTP requests just by adding a fake
 		SIP parser can handle easy HTTP requests just by adding a fake
 		Via header.
 		Via header.

+ 2 - 0
modules/xhttp/xhttp_mod.c

@@ -292,6 +292,8 @@ static int xhttp_handler(sip_msg_t* msg)
 		return NONSIP_MSG_PASS;
 		return NONSIP_MSG_PASS;
 	}
 	}
 
 
+	/* we support HTTP/1.0 - fix it for replies */
+	msg->first_line.u.request.version.s[HTTP_VERSION_LEN] = '0';
 	if(xhttp_url_match!=NULL)
 	if(xhttp_url_match!=NULL)
 	{
 	{
 		c = msg->first_line.u.request.uri.s[msg->first_line.u.request.uri.len];
 		c = msg->first_line.u.request.uri.s[msg->first_line.u.request.uri.len];