unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* virtual host support
@ 2003-02-27 16:50 Jose Roberto B. de A. Monteiro
  2003-02-27 20:22 ` Thien-Thi Nguyen
  2003-02-28 22:56 ` Kevin Ryde
  0 siblings, 2 replies; 6+ messages in thread
From: Jose Roberto B. de A. Monteiro @ 2003-02-27 16:50 UTC (permalink / raw)


Hello there,

In guile-www package: in http:request procedure, I am sending a patch
to support virtual hosts retrieving.

The patch is bellow.

In cases of a single host supporting many other virtual hosts, the
previous http:request retrieves the main host page.

Regards,

Jose Roberto Monteiro

===File ~/work/guile/guile-1.7.0/guile-www.diff=============
Common subdirectories: guile-www.orig/CVS and guile-www/CVS
Common subdirectories: guile-www.orig/contrib and guile-www/contrib
Common subdirectories: guile-www.orig/doc and guile-www/doc
Common subdirectories: guile-www.orig/examples and guile-www/examples
diff -u guile-www.orig/http.scm guile-www/http.scm
--- guile-www.orig/http.scm	Fri Apr 26 22:57:28 2002
+++ guile-www/http.scm	Thu Feb 27 13:43:16 2003
@@ -216,7 +216,7 @@
 	(tcp-port (or (url:port url) 80))
 	(path     (format #f "/~A" (or (url:path url) ""))))
     (let ((sock (http:open host tcp-port))
-	  (request (format #f "~A ~A ~A" method path http:version))
+	  (request (format #f "~A ~A ~A\r\nHost: ~A" method path http:version (url:host url)))
 	  (headers (if (pair? args) (car args) '()))
 	  (body    (if (and (pair? args) (pair? (cdr args)))
 		       (cadr args)
============================================================


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: virtual host support
  2003-02-27 16:50 virtual host support Jose Roberto B. de A. Monteiro
@ 2003-02-27 20:22 ` Thien-Thi Nguyen
  2003-02-28 22:56 ` Kevin Ryde
  1 sibling, 0 replies; 6+ messages in thread
From: Thien-Thi Nguyen @ 2003-02-27 20:22 UTC (permalink / raw)
  Cc: bug-guile

   From: "Jose Roberto B. de A. Monteiro" <betoes@igbt.sel.eesc.usp.br>
   Date: Thu, 27 Feb 2003 13:50:39 -0300

   In guile-www package: in http:request procedure, I am sending a patch
   to support virtual hosts retrieving.

thanks for the patch.  currently low-bandwidth, will probably take a
look at it in a week or so, after having completed a (residential) move.

thi


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: virtual host support
  2003-02-27 16:50 virtual host support Jose Roberto B. de A. Monteiro
  2003-02-27 20:22 ` Thien-Thi Nguyen
@ 2003-02-28 22:56 ` Kevin Ryde
  1 sibling, 0 replies; 6+ messages in thread
From: Kevin Ryde @ 2003-02-28 22:56 UTC (permalink / raw)
  Cc: Jose Roberto B. de A. Monteiro

"Jose Roberto B. de A. Monteiro" <betoes@igbt.sel.eesc.usp.br> writes:
>
> -	  (request (format #f "~A ~A ~A" method path http:version))
> +	  (request (format #f "~A ~A ~A\r\nHost: ~A" method path http:version (url:host url)))

Perhaps the url:port should be included there too, at least if it's
not 80.


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: virtual host support
@ 2003-03-09 15:04 Jose Roberto B. de A. Monteiro
  2003-03-10 17:49 ` Paul Jarc
  0 siblings, 1 reply; 6+ messages in thread
From: Jose Roberto B. de A. Monteiro @ 2003-03-09 15:04 UTC (permalink / raw)
  Cc: Kevin Ryde


"Kevin Ryde" wrote:
> "Jose Roberto B. de A. Monteiro" <betoes@bogus.example.com> writes:
> >
> > -       (request (format #f "~A ~A ~A" method path http:version))
> > +       (request (format #f "~A ~A ~A\r\nHost: ~A" method path http:version 
> >(url:host url)))
>
> Perhaps the url:port should be included there too, at least if it's
> not 80.

url:port is used in tcp-port variable, which is an arg to http:open:

(define-public (http:request method url . args)
  (let ...
	(tcp-port (or (url:port url) 80))
       ...
    (let ((sock (http:open host tcp-port))
       ...

The port was sent to make the connection, then it makes the request "GET ...".

Thanks...




_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: virtual host support
  2003-03-09 15:04 Jose Roberto B. de A. Monteiro
@ 2003-03-10 17:49 ` Paul Jarc
  2003-03-11 22:43   ` Kevin Ryde
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Jarc @ 2003-03-10 17:49 UTC (permalink / raw)
  Cc: Kevin Ryde

"Jose Roberto B. de A. Monteiro" <betoes@igbt.sel.eesc.usp.br> wrote:
> "Kevin Ryde" wrote:
>> "Jose Roberto B. de A. Monteiro" <betoes@bogus.example.com> writes:
>>>  -       (request (format #f "~A ~A ~A" method path http:version))
>>>  +       (request (format #f "~A ~A ~A\r\nHost: ~A" method path http:version
>>> (url:host url)))
>>
>> Perhaps the url:port should be included there too, at least if it's
>> not 80.

I agree.  I'd include it even if it is 80, for the sake of code
simplicity.

> The port was sent to make the connection, then it makes the request
> "GET ...".

Depending on how the server is configured, it might be convenient for
it to have the port in the Host: field as well.  It's better to send
information that is not needed than to not send information that is
needed.


paul


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: virtual host support
  2003-03-10 17:49 ` Paul Jarc
@ 2003-03-11 22:43   ` Kevin Ryde
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Ryde @ 2003-03-11 22:43 UTC (permalink / raw)
  Cc: Jose Roberto B. de A. Monteiro

prj@po.cwru.edu (Paul Jarc) writes:
>
> Depending on how the server is configured, it might be convenient for
> it to have the port in the Host: field as well.

In case it takes the Host field at face value.

> It's better to send
> information that is not needed than to not send information that is
> needed.

Oh, well, the main reason would be that the rfc says that's how it
should be. :)


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-03-11 22:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-27 16:50 virtual host support Jose Roberto B. de A. Monteiro
2003-02-27 20:22 ` Thien-Thi Nguyen
2003-02-28 22:56 ` Kevin Ryde
  -- strict thread matches above, loose matches on Subject: below --
2003-03-09 15:04 Jose Roberto B. de A. Monteiro
2003-03-10 17:49 ` Paul Jarc
2003-03-11 22:43   ` Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).