aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--configure.in5
-rw-r--r--dpi/https.c6
-rw-r--r--src/form.cc45
4 files changed, 23 insertions, 35 deletions
diff --git a/ChangeLog b/ChangeLog
index 1f1ecb19..dbc93788 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,8 @@ dillo-2.1
- Tuned input width a bit.
- Resource embed cleanup (forms)
Patches: place (AKA corvid)
++- Switched SSL enabled to configure.in (./configure --enable-ssl)
+ Patch: Jeremy Henty
dw
diff --git a/configure.in b/configure.in
index 2741ce33..8b8ebffc 100644
--- a/configure.in
+++ b/configure.in
@@ -21,6 +21,8 @@ AC_ARG_ENABLE(insure, [ --enable-insure Try to compile and run with Ins
, enable_insure=no)
AC_ARG_ENABLE(ansi, [ --enable-ansi Try to compile and run with ANSI flags],
, enable_ansi=no)
+AC_ARG_ENABLE(ssl, [ --enable-ssl Enable ssl features (eg. https)],
+ , enable_ssl=no)
AC_ARG_ENABLE(ipv6, [ --enable-ipv6 Build with support for IPv6], , )
AC_ARG_ENABLE(cookies,[ --disable-cookies Don't compile support for cookies],
, enable_cookies=yes)
@@ -30,8 +32,6 @@ AC_ARG_ENABLE(jpeg, [ --disable-jpeg Disable support for JPEG images
enable_jpeg=$enableval, enable_jpeg=yes)
AC_ARG_ENABLE(gif, [ --disable-gif Disable support for GIF images],
enable_gif=$enableval, enable_gif=yes)
-AC_ARG_ENABLE(ssl, [ --disable-ssl Disable ssl features (eg. https)],
- enable_ssl=$enableval, enable_ssl=yes)
AC_ARG_ENABLE(threaded-dns,[ --disable-threaded-dns Disable the advantage of a reentrant resolver library],
enable_threaded_dns=$enableval, enable_threaded_dns=yes)
AC_ARG_ENABLE(rtfl, [ --enable-rtfl Build with rtfl messages])
@@ -288,6 +288,7 @@ if test "x$enable_ssl" = "xyes"; then
if test "x$ssl_ok" = "xyes"; then
LIBSSL_LIBS="-lcrypto -lssl"
+ AC_MSG_WARN([*** Enabling ssl support. THIS IS ALPHA CODE!***])
else
AC_MSG_WARN([*** No libssl found. Disabling ssl support.***])
fi
diff --git a/dpi/https.c b/dpi/https.c
index 00ceb0c1..2f2ac930 100644
--- a/dpi/https.c
+++ b/dpi/https.c
@@ -68,8 +68,6 @@
#define MSG(...) printf("[https dpi]: " __VA_ARGS__)
-#define ENABLE_SSL
-#undef ENABLE_SSL
#ifdef ENABLE_SSL
#include <openssl/ssl.h>
@@ -663,8 +661,8 @@ static void no_ssl_support(void)
"<b>}</b>\n\n"
" <b>*** Dillo's prototype plugin for https support"
" is disabled now ***</b>\n\n"
- " If you want to test this <b>alpha</b> support code, just remove\n"
- " line 72 from dpi/https.c, recompile and reinstall.\n\n"
+ " If you want to test this <b>alpha</b> support code, just\n"
+ " reconfigure with --enable-ssl, recompile and reinstall.\n\n"
" (beware that this https support is very limited now)\n\n"
" To use https and SSL, you must have \n"
" the OpenSSL development libraries installed. Check your\n"
diff --git a/src/form.cc b/src/form.cc
index 430f74b1..6f7979be 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -401,6 +401,7 @@ static int Html_input_get_size(DilloHtml *html, const char *attrbuf)
void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
{
DilloHtmlInputType inp_type;
+ Resource *resource = NULL;
Embed *embed = NULL;
char *value, *name, *type, *init_str;
const char *attrbuf, *label;
@@ -429,13 +430,11 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
inp_type = DILLO_HTML_INPUT_PASSWORD;
attrbuf = a_Html_get_attr(html, tag, tagsize, "size");
int size = Html_input_get_size(html, attrbuf);
- EntryResource *entryResource = factory->createEntryResource (size, true);
- embed = new Embed (entryResource);
+ resource = factory->createEntryResource (size, true);
init_str = value;
} else if (!dStrcasecmp(type, "checkbox")) {
inp_type = DILLO_HTML_INPUT_CHECKBOX;
- CheckButtonResource *check_b_r=factory->createCheckButtonResource(false);
- embed = new Embed (check_b_r);
+ resource = factory->createCheckButtonResource(false);
init_val = (a_Html_get_attr(html, tag, tagsize, "checked") != NULL);
init_str = (value) ? value : dStrdup("on");
} else if (!dStrcasecmp(type, "radio")) {
@@ -444,8 +443,7 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
DilloHtmlInput *input = Html_get_radio_input(html, name);
if (input)
rb_r = (RadioButtonResource*) input->embed->getResource();
- rb_r = factory->createRadioButtonResource(rb_r, false);
- embed = new Embed (rb_r);
+ resource = factory->createRadioButtonResource(rb_r, false);
init_val = (a_Html_get_attr(html, tag, tagsize, "checked") != NULL);
init_str = value;
} else if (!dStrcasecmp(type, "hidden")) {
@@ -454,16 +452,12 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
} else if (!dStrcasecmp(type, "submit")) {
inp_type = DILLO_HTML_INPUT_SUBMIT;
init_str = (value) ? value : dStrdup("submit");
- LabelButtonResource *label_b_r =
- factory->createLabelButtonResource(init_str);
- embed = new Embed (label_b_r);
+ resource = factory->createLabelButtonResource(init_str);
// gtk_widget_set_sensitive(widget, FALSE); /* Until end of FORM! */
} else if (!dStrcasecmp(type, "reset")) {
inp_type = DILLO_HTML_INPUT_RESET;
init_str = (value) ? value : dStrdup("Reset");
- LabelButtonResource *label_b_r =
- factory->createLabelButtonResource(init_str);
- embed = new Embed (label_b_r);
+ resource = factory->createLabelButtonResource(init_str);
// gtk_widget_set_sensitive(widget, FALSE); /* Until end of FORM! */
} else if (!dStrcasecmp(type, "image")) {
if (URL_FLAGS(html->base_url) & URL_SpamSafe) {
@@ -472,9 +466,7 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
attrbuf = a_Html_get_attr(html, tag, tagsize, "alt");
label = attrbuf ? attrbuf : value ? value : name ? name : "Submit";
init_str = dStrdup(label);
- LabelButtonResource *label_b_r =
- factory->createLabelButtonResource(init_str);
- embed = new Embed (label_b_r);
+ resource = factory->createLabelButtonResource(init_str);
// gtk_widget_set_sensitive(widget, FALSE); /* Until end of FORM! */
} else {
inp_type = DILLO_HTML_INPUT_IMAGE;
@@ -501,30 +493,29 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
if (valid) {
inp_type = DILLO_HTML_INPUT_FILE;
init_str = dStrdup("File selector");
- LabelButtonResource *lbr=factory->createLabelButtonResource(init_str);
- embed = new Embed (lbr);
+ resource = factory->createLabelButtonResource(init_str);
}
} else if (!dStrcasecmp(type, "button")) {
inp_type = DILLO_HTML_INPUT_BUTTON;
if (value) {
init_str = value;
- LabelButtonResource *label_b_r =
- factory->createLabelButtonResource(init_str);
- embed = new Embed (label_b_r);
+ resource = factory->createLabelButtonResource(init_str);
}
} else if (!dStrcasecmp(type, "text") || !*type) {
/* Text input, which also is the default */
inp_type = DILLO_HTML_INPUT_TEXT;
attrbuf = a_Html_get_attr(html, tag, tagsize, "size");
int size = Html_input_get_size(html, attrbuf);
- EntryResource *entryResource = factory->createEntryResource(size, false);
- embed = new Embed (entryResource);
+ resource = factory->createEntryResource(size, false);
init_str = value;
} else {
/* Unknown input type */
BUG_MSG("Unknown input type: \"%s\"\n", type);
}
+ if (resource)
+ embed = new Embed (resource);
+
if (inp_type != DILLO_HTML_INPUT_UNKNOWN) {
Html_add_input(html, inp_type, embed, name,
(init_str) ? init_str : "", init_val);
@@ -534,10 +525,8 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
inp_type != DILLO_HTML_INPUT_UNKNOWN) {
if (inp_type == DILLO_HTML_INPUT_TEXT ||
inp_type == DILLO_HTML_INPUT_PASSWORD) {
- EntryResource *entryres = (EntryResource*)embed->getResource();
- /* Readonly or not? */
if (a_Html_get_attr(html, tag, tagsize, "readonly"))
- entryres->setEditable(false);
+ ((EntryResource *) resource)->setEditable(false);
// /* Maximum length of the text in the entry */
// if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "maxlength")))
@@ -884,9 +873,8 @@ void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize)
page->setStyle (style);
ResourceFactory *factory = HT2LT(html)->getResourceFactory();
- ComplexButtonResource *complex_b_r =
- factory->createComplexButtonResource(page, true);
- embed = new Embed(complex_b_r);
+ Resource *resource = factory->createComplexButtonResource(page, true);
+ embed = new Embed(resource);
// a_Dw_button_set_sensitive (DW_BUTTON (button), FALSE);
DW2TB(html->dw)->addParbreak (5, style);
@@ -1940,7 +1928,6 @@ static Embed *Html_input_image(DilloHtml *html, const char *tag, int tagsize)
a_Url_free(url);
}
}
-
if (!button)
MSG("Html_input_image: unable to create image submit.\n");
return button;