2023-06-09 Fred Gleason <fredg@paravelsystems.com>

* Removed the '#define RD_DEFAULT_MAX_POST_LENGTH' statement from
	'lib/rd.h'.
	* Added a '#define RD_MAX_POST_LENGTH' statement in 'lib/rd.h'.
	* Removed the 'RDSystem::maxPostLength()' and
	'RDSystem::setMaxPostLength()' methods.
	* Removed the 'Maximum Remote Post Length' control from the
	'System-Wide Settings' dialog in rdadmin(1).

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2023-06-09 11:31:02 -04:00
parent 717ec9cc17
commit 4e88ca5f0c
11 changed files with 25 additions and 74 deletions

View File

@ -24219,3 +24219,11 @@
2023-06-07 Fred Gleason <fredg@paravelsystems.com>
* Incremented the package version to 4.0.0rc4.
* Incremented the Python API version to 4.0.0rc4.
2023-06-09 Fred Gleason <fredg@paravelsystems.com>
* Removed the '#define RD_DEFAULT_MAX_POST_LENGTH' statement from
'lib/rd.h'.
* Added a '#define RD_MAX_POST_LENGTH' statement in 'lib/rd.h'.
* Removed the 'RDSystem::maxPostLength()' and
'RDSystem::setMaxPostLength()' methods.
* Removed the 'Maximum Remote Post Length' control from the
'System-Wide Settings' dialog in rdadmin(1).

View File

@ -264,7 +264,7 @@
/*
* Default Maximum POST Length (bytes)
*/
#define RD_DEFAULT_MAX_POST_LENGTH 10000000
#define RD_MAX_POST_LENGTH 2147483648
/*
* Pause Time for Starting Daemons (secs)

View File

@ -33,8 +33,7 @@
#include <rdformpost.h>
RDFormPost::RDFormPost(RDFormPost::Encoding encoding,int64_t maxsize,
bool auto_delete)
RDFormPost::RDFormPost(RDFormPost::Encoding encoding,bool auto_delete)
{
bool ok=false;
@ -76,7 +75,7 @@ RDFormPost::RDFormPost(RDFormPost::Encoding encoding,int64_t maxsize,
post_error=RDFormPost::ErrorMalformedData;
return;
}
if((maxsize>0)&&(post_content_length>maxsize)) {
if(post_content_length>RD_MAX_POST_LENGTH) {
post_error=RDFormPost::ErrorPostTooLarge;
return;
}

View File

@ -37,8 +37,7 @@ class RDFormPost
enum Encoding {UrlEncoded=0,MultipartEncoded=1,AutoEncoded=2};
enum Error {ErrorOk=0,ErrorNotPost=1,ErrorNoTempDir=2,ErrorMalformedData=3,
ErrorPostTooLarge=4,ErrorInternal=5,ErrorNotInitialized=6};
RDFormPost(RDFormPost::Encoding encoding,int64_t maxsize=0,
bool auto_delete=true);
RDFormPost(RDFormPost::Encoding encoding,bool auto_delete);
~RDFormPost();
RDFormPost::Error error() const;
QHostAddress clientAddress() const;

View File

@ -106,31 +106,6 @@ void RDSystem::setFixDuplicateCartTitles(bool state) const
}
int64_t RDSystem::maxPostLength() const
{
int64_t ret;
QString sql="select `MAX_POST_LENGTH` from `SYSTEM`";
RDSqlQuery *q=new RDSqlQuery(sql);
if(q->first()) {
ret=q->value(0).toLongLong();
}
else {
ret=RD_DEFAULT_MAX_POST_LENGTH;
}
delete q;
return ret;
}
void RDSystem::setMaxPostLength(int64_t bytes) const
{
QString sql=
QString::asprintf("update `SYSTEM` set `MAX_POST_LENGTH`=%ld",bytes);
RDSqlQuery::apply(sql);
}
QString RDSystem::isciXreferencePath() const
{
return GetValue("ISCI_XREFERENCE_PATH").toString();
@ -260,7 +235,6 @@ QString RDSystem::xml() const
xml+=RDXmlField("sampleRate",sampleRate());
xml+=RDXmlField("duplicateTitles",allowDuplicateCartTitles());
xml+=RDXmlField("fixDuplicateTitles",fixDuplicateCartTitles());
xml+=RDXmlField("maxPostLength",maxPostLength());
xml+=RDXmlField("isciXreferencePath",isciXreferencePath());
xml+=RDXmlField("tempCartGroup",tempCartGroup());
xml+=RDXmlField("longDateFormat",longDateFormat());

View File

@ -36,8 +36,6 @@ class RDSystem
void setAllowDuplicateCartTitles(bool state) const;
bool fixDuplicateCartTitles() const;
void setFixDuplicateCartTitles(bool state) const;
int64_t maxPostLength() const;
void setMaxPostLength(int64_t bytes) const;
QString isciXreferencePath() const;
void setIsciXreferencePath(const QString &str) const;
QString originEmailAddress() const;

View File

@ -129,21 +129,6 @@ EditSystem::EditSystem(QWidget *parent)
edit_notification_address_label->
setAlignment(Qt::AlignRight|Qt::AlignVCenter);
//
// Maximum POST Size
//
edit_maxpost_spin=new QSpinBox(this);
edit_maxpost_spin->setRange(1,1000);
edit_maxpost_label=
new QLabel(tr("Maximum Remote Post Length:"),this);
edit_maxpost_label->setFont(labelFont());
edit_maxpost_label->
setAlignment(Qt::AlignRight|Qt::AlignVCenter);
edit_maxpost_unit_label=new QLabel(tr("Mbytes"),this);
edit_maxpost_unit_label->setFont(labelFont());
edit_maxpost_unit_label->
setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
//
// Temporary Cart Group
//
@ -269,7 +254,6 @@ EditSystem::EditSystem(QWidget *parent)
edit_fix_duplicate_carts_box->
setChecked(edit_system->fixDuplicateCartTitles());
duplicatesCheckedData(edit_system->allowDuplicateCartTitles());
edit_maxpost_spin->setValue(edit_system->maxPostLength()/1000000);
edit_isci_path_edit->setText(edit_system->isciXreferencePath());
edit_origin_email_addr_edit->setText(edit_system->originEmailAddress());
edit_notification_address_edit->
@ -316,7 +300,7 @@ EditSystem::~EditSystem()
QSize EditSystem::sizeHint() const
{
return QSize(500,428+y_pos);
return QSize(500,406+y_pos);
}
@ -514,7 +498,6 @@ void EditSystem::okData()
edit_system->
setFixDuplicateCartTitles(edit_fix_duplicate_carts_box->isChecked());
edit_system->setSampleRate(edit_sample_rate_box->currentText().toUInt());
edit_system->setMaxPostLength(edit_maxpost_spin->value()*1000000);
edit_system->setIsciXreferencePath(edit_isci_path_edit->text());
edit_system->setOriginEmailAddress(edit_origin_email_addr_edit->text());
edit_system->
@ -589,17 +572,13 @@ void EditSystem::resizeEvent(QResizeEvent *e)
edit_notification_address_edit->setGeometry(250,164,150,20);
edit_notification_address_label->setGeometry(10,164,235,20);
edit_maxpost_spin->setGeometry(250,186,60,20);
edit_maxpost_label->setGeometry(10,186,235,20);
edit_maxpost_unit_label->setGeometry(315,186,60,20);
edit_temp_cart_group_box->setGeometry(250,185,140,20);
edit_temp_cart_group_label->setGeometry(10,185,235,20);
edit_temp_cart_group_box->setGeometry(250,207,140,20);
edit_temp_cart_group_label->setGeometry(10,207,235,20);
edit_rss_processor_label->setGeometry(10,207,235,20);
edit_rss_processor_box->setGeometry(250,207,200,20);
edit_rss_processor_label->setGeometry(10,229,235,20);
edit_rss_processor_box->setGeometry(250,229,200,20);
edit_datetime_group->setGeometry(10,251,size().width()-20,100);
edit_datetime_group->setGeometry(10,229,size().width()-20,100);
edit_datetime_test_button->setGeometry(5,22,80,35);
edit_datetime_defaults_button->setGeometry(5,60,80,35);
edit_long_date_label->setGeometry(110,27,120,20);
@ -609,9 +588,9 @@ void EditSystem::resizeEvent(QResizeEvent *e)
edit_time_label->setGeometry(110,71,120,20);
edit_time_box->setGeometry(235,71,edit_time_box->sizeHint().width(),20);
edit_duplicate_hidden_label->setGeometry(15,351,size().width()-30,50);
edit_duplicate_view->setGeometry(10,399,size().width()-20,215);
edit_save_button->setGeometry(size().width()-85,619,70,25);
edit_duplicate_hidden_label->setGeometry(15,329,size().width()-30,50);
edit_duplicate_view->setGeometry(10,377,size().width()-20,215);
edit_save_button->setGeometry(size().width()-85,597,70,25);
edit_encoders_button->setGeometry(10,size().height()-60,120,50);
edit_ok_button->setGeometry(size().width()-180,size().height()-60,80,50);

View File

@ -2,7 +2,7 @@
//
// Edit Rivendell System-wide Settings.
//
// (C) Copyright 2009-2021 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2009-2023 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -73,9 +73,6 @@ class EditSystem : public RDDialog
QCheckBox *edit_duplicate_carts_box;
QCheckBox *edit_fix_duplicate_carts_box;
QLabel *edit_fix_duplicate_carts_label;
QLabel *edit_maxpost_label;
QSpinBox *edit_maxpost_spin;
QLabel *edit_maxpost_unit_label;
QLabel *edit_isci_path_label;
QLineEdit *edit_isci_path_edit;
QLabel *edit_origin_email_addr_label;

View File

@ -1524,8 +1524,7 @@ bool MainObject::CreateNewDb(QString *err_msg) const
RD_DEFAULT_SAMPLE_RATE)+
"`DUP_CART_TITLES` enum('N','Y') not null default 'Y',"+
"`FIX_DUP_CART_TITLES` enum('N','Y') not null default 'Y',"+
QString::asprintf("`MAX_POST_LENGTH` int unsigned default %u,",
RD_DEFAULT_MAX_POST_LENGTH)+
"`MAX_POST_LENGTH` int unsigned default 10000000,"+
"`ISCI_XREFERENCE_PATH` char(255),"+
"`TEMP_CART_GROUP` char(10),"+
"`SHOW_USER_LIST` enum('N','Y') not null default 'Y',"+

View File

@ -5025,8 +5025,7 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg)
sql=QString("alter table `SYSTEM` ")+
"add column `MAX_POST_LENGTH` "+
QString::asprintf("int unsigned default %u after `DUP_CART_TITLES`",
RD_DEFAULT_MAX_POST_LENGTH);
"int unsigned default 10000000 after `DUP_CART_TITLES`";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}

View File

@ -113,8 +113,7 @@ Xport::Xport(QObject *parent)
//
// Generate Post
//
xport_post=new RDFormPost(RDFormPost::AutoEncoded,
rda->system()->maxPostLength(),true);
xport_post=new RDFormPost(RDFormPost::AutoEncoded,true);
if(xport_post->error()!=RDFormPost::ErrorOk) {
XmlExit(xport_post->errorString(xport_post->error()),400,"rdxport.cpp",
LINE_NUMBER);