Repository: trafficserver Updated Branches: refs/heads/master 7d9385577 -> fbd482250
Remove unused ProtoSM.h Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/fbd48225 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/fbd48225 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/fbd48225 Branch: refs/heads/master Commit: fbd4822503ba1d0d777c8a9dbd0b7cda2e6084c9 Parents: 7d93855 Author: James Peach <[email protected]> Authored: Sun Dec 6 17:04:53 2015 -0800 Committer: James Peach <[email protected]> Committed: Sun Dec 6 17:04:53 2015 -0800 ---------------------------------------------------------------------- proxy/ProtoSM.h | 158 --------------------------------------------------- 1 file changed, 158 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbd48225/proxy/ProtoSM.h ---------------------------------------------------------------------- diff --git a/proxy/ProtoSM.h b/proxy/ProtoSM.h deleted file mode 100644 index 848e37e..0000000 --- a/proxy/ProtoSM.h +++ /dev/null @@ -1,158 +0,0 @@ -/** @file - - A brief file description - - @section license License - - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/**************************************************************************** - - ProtoSM.h - - Description: - Common elements for protocol state machines - - - ****************************************************************************/ - -#ifndef _PROTO_SM_H_ -#define _PROTO_SM_H_ - -template <class VCTentry, int max_entries> struct ProtoVCTable { -public: - ProtoVCTable(); - VCTentry vc_table[max_entries]; - - VCTentry *new_entry(); - VCTentry *find_entry(VConnection *); - VCTentry *find_entry(VIO *); - void remove_entry(VCTentry *); - void cleanup_entry(VCTentry *); - void cleanup_all(); - bool is_table_clear(); -}; - -template <class VCTentry, int max_entries> inline ProtoVCTable<VCTentry, max_entries>::ProtoVCTable() -{ - memset(&vc_table, 0, sizeof(vc_table)); -} - -template <class VCTentry, int max_entries> -inline VCTentry * -ProtoVCTable<VCTentry, max_entries>::new_entry() -{ - for (int i = 0; i < max_entries; i++) { - if (vc_table[i].vc == NULL) { - return vc_table + i; - } - } - - ink_release_assert(0); - return NULL; -} - -template <class VCTentry, int max_entries> -inline VCTentry * -ProtoVCTable<VCTentry, max_entries>::find_entry(VConnection *vc) -{ - for (int i = 0; i < max_entries; i++) { - if (vc_table[i].vc == vc) { - return vc_table + i; - } - } - - return NULL; -} - -template <class VCTentry, int max_entries> -inline VCTentry * -ProtoVCTable<VCTentry, max_entries>::find_entry(VIO *vio) -{ - for (int i = 0; i < max_entries; i++) { - if (vc_table[i].read_vio == vio || vc_table[i].write_vio == vio) { - ink_assert(vc_table[i].vc != NULL); - return vc_table + i; - } - } - - return NULL; -} - -// bool ProtoVCTable::remove_entry(HttpVCEntry* e) -// -// Deallocates all buffers from the associated -// entry and re-initializes it's other fields -// for reuse -// -template <class VCTentry, int max_entries> -inline void -ProtoVCTable<VCTentry, max_entries>::remove_entry(VCTentry *e) -{ - ink_assert(e->vc == NULL || e->in_tunnel); - if (e->read_buffer) { - free_MIOBuffer(e->read_buffer); - } - if (e->write_buffer) { - free_MIOBuffer(e->write_buffer); - } - memset(e, 0, sizeof(VCTentry)); -} - -// void ProtoVCTable::cleanup_entry(HttpVCEntry* e) -// -// Closes the associate vc for the entry, -// and the call remove_entry -// -template <class VCTentry, int max_entries> -inline void -ProtoVCTable<VCTentry, max_entries>::cleanup_entry(VCTentry *e) -{ - ink_assert(e->vc); - if (e->in_tunnel == false) { - e->vc->do_io_close(); - e->vc = NULL; - } - remove_entry(e); -} - -template <class VCTentry, int max_entries> -inline void -ProtoVCTable<VCTentry, max_entries>::cleanup_all() -{ - for (int i = 0; i < max_entries; i++) { - if (vc_table[i].vc != NULL) { - cleanup_entry(vc_table + i); - } - } -} - - -template <class VCTentry, int max_entries> -inline bool -ProtoVCTable<VCTentry, max_entries>::is_table_clear() -{ - for (int i = 0; i < max_entries; i++) { - if (vc_table[i].vc != NULL) { - return false; - } - } - return true; -} - -#endif
