1999-10-10
1999-10-10 17:25:33 by Henrik Grubbström (Grubba) <grubba@grubba.org>
-
60a912a1c67fe1d3098bc9205e81580210d7e922
(32 lines)
(+22/-10)
[
Show
| Annotate
]
Branch: 5.2
Improved the HTTP => HTTPS redirect.
Rev: server/base_server/roxen.pike:1.335
1:
/*
- * $Id: roxen.pike,v 1.334 1999/10/10 10:37:53 per Exp $
+ * $Id: roxen.pike,v 1.335 1999/10/10 17:25:33 grubba Exp $
*
* The Roxen Challenger main program.
*
7:
*/
// ABS and suicide systems contributed freely by Francesco Chemolli
- constant cvs_version="$Id: roxen.pike,v 1.334 1999/10/10 10:37:53 per Exp $";
+ constant cvs_version="$Id: roxen.pike,v 1.335 1999/10/10 17:25:33 grubba Exp $";
object backend_thread;
object argcache;
27:
inherit "language";
inherit "supports";
+ #define SSL3_DEBUG
+
/*
* Version information
*/
607:
{
if ( (sizeof(header) >= 2) &&
(lower_case(header[0]) == "host") )
- prefix = "https://" + (header[1]/":")[0] - " ";
+ prefix = "https://" + header[1] - " ";
}
}
if (prefix) {
622:
/* This case is most unlikely to occur,
* but better safe than sorry...
*/
- prefix = "https://localhost:" + port;
+ string ip = (f->query_address(1)/" ")[0];
+ prefix = "https://" + ip + ":" + port;
} else if (prefix[..4] == "http:") {
/* Broken MyWorldLocation -- fix. */
prefix = "https:" + prefix[5..];
801: Inside #if constant(SSL.sslfile)
return sslfile[s];
}
+ mixed `[]=(string s, mixed val)
+ {
+ return sslfile[s] = val;
+ }
+
mixed `->(string s)
{
return sslfile[s];
}
-
+ mixed `->=(string s, mixed val)
+ {
+ return sslfile[s] = val;
+ }
+
void destroy()
{
-
+ if (sslfile) {
sslfile->close();
}
-
+ }
void create(object q, object ctx)
{
1006: Inside #if constant(SSL.sslfile)
if ( (my_fd->current_write_state->seq_num == 0)
&& search(lower_case(data), "http"))
{
- #if 0
- object raw_fd = Stdio.File();
- raw_fd->assign(my_fd);
- #else /* !0 */
+
object raw_fd = my_fd->socket;
- #endif /* 0 */
+ my_fd->socket = 0;
/* Redirect to a https-url */
// my_fd->set_close_callback(0);