[sr-dev] git:master: xhttp: added supported version

Daniel-Constantin Mierla miconda at gmail.com
Wed May 26 11:59:32 CEST 2010


Module: sip-router
Branch: master
Commit: 7a67e04c7cd6c18f66f62305aa620fb6f632f12e
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7a67e04c7cd6c18f66f62305aa620fb6f632f12e

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Wed May 26 11:50:00 2010 +0200

xhttp: added supported version

---

 modules/xhttp/README              |    6 +++---
 modules/xhttp/doc/xhttp_admin.xml |    2 +-
 modules/xhttp/xhttp_mod.c         |    2 ++
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/xhttp/README b/modules/xhttp/README
index 6a7aa2e..1ae565e 100644
--- a/modules/xhttp/README
+++ b/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
diff --git a/modules/xhttp/doc/xhttp_admin.xml b/modules/xhttp/doc/xhttp_admin.xml
index 3e1b2dc..395a450 100644
--- a/modules/xhttp/doc/xhttp_admin.xml
+++ b/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.
diff --git a/modules/xhttp/xhttp_mod.c b/modules/xhttp/xhttp_mod.c
index 48beb1b..0492457 100644
--- a/modules/xhttp/xhttp_mod.c
+++ b/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];




More information about the sr-dev mailing list