Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions proxy/ControlMatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,6 @@ struct RequestData {

virtual sockaddr const *get_client_ip() = 0;

enum RD_Type {
RD_NULL,
RD_HTTP,
RD_CONGEST_ENTRY,
};

virtual RD_Type
data_type(void)
{
return RD_NULL;
}
};

class HttpRequestData : public RequestData
Expand Down
16 changes: 10 additions & 6 deletions proxy/congest/Congestion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,16 +256,20 @@ CongestionControlRecord::UpdateMatch(CongestionControlRule *pRule, RequestData *
*/
if (pRule->record == 0 || pRule->record->rank < rank || (pRule->record->line_num > line_num && pRule->record->rank == rank)) {
if (rank > 0) {
if (rdata->data_type() == RequestData::RD_CONGEST_ENTRY) {
CongestionEntry* entry = dynamic_cast<CongestionEntry*>(rdata);
if (entry) {
// Enforce the same port and prefix
if (port != 0 && port != ((CongestionEntry *)rdata)->pRecord->port)
if (port != 0 && port != entry->pRecord->port)
return;
if (prefix != NULL && ((CongestionEntry *)rdata)->pRecord->prefix == NULL)
if (prefix != NULL && entry->pRecord->prefix == NULL)
return;
if (prefix != NULL && strncmp(prefix, ((CongestionEntry *)rdata)->pRecord->prefix, prefix_len))
if (prefix != NULL && strncmp(prefix, entry->pRecord->prefix, prefix_len))
return;
} else if (!this->CheckModifiers((HttpRequestData *)rdata)) {
return;
} else {
HttpRequestData* h = dynamic_cast<HttpRequestData*>(rdata);
if (h && !this->CheckModifiers(h)) {
return;
}
}
}
pRule->record = this;
Expand Down
5 changes: 0 additions & 5 deletions proxy/congest/Congestion.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,6 @@ struct CongestionEntry : public RequestData {
{
return NULL;
}
virtual RD_Type
data_type(void)
{
return RD_CONGEST_ENTRY;
}

/* print the entry into the congested list output buffer */
int sprint(char *buf, int buflen, int format = 0);
Expand Down