瀏覽代碼

xhttp: added supported version

Daniel-Constantin Mierla 15 年之前
父節點
當前提交
7a67e04c7c
共有 3 個文件被更改,包括 6 次插入4 次删除
  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
 
-   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
    HTTP handling way, by calling event_route[xhttp:request] in your

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

@@ -16,7 +16,7 @@
 	<section>
 	<title>Overview</title>
 	<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
 		SIP parser can handle easy HTTP requests just by adding a fake
 		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;
 	}
 
+	/* 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)
 	{
 		c = msg->first_line.u.request.uri.s[msg->first_line.u.request.uri.len];