[mythtv-commits] Ticket #11894: Patch: Prevent Services API from telling clients to allow Keep-Alive

MythTV noreply at mythtv.org
Tue Oct 8 02:56:18 UTC 2013


#11894: Patch: Prevent Services API from telling clients to allow Keep-Alive
-------------------------------------------------+-------------------------
     Reporter:  Bill Meek <keemllib@…>           |      Owner:
         Type:  Patch - Bug Fix                  |     Status:  new
     Priority:  minor                            |  Milestone:  unknown
    Component:  MythTV - Services API - Backend  |    Version:  Master Head
     Severity:  medium                           |   Keywords:
Ticket locked:  0                                |
-------------------------------------------------+-------------------------
 If a Services API client includes the "Conversation" "Keep-Alive"
 header in a request, the response will contain the same header
 information.

 However, the Services API does not support persistent connections.

 This 'patch' returns "Close" if a client requests "Keep-Alive" which
 will prevent TCP RST (resets) when clients try to reuse a connection.

 Not a problem for clients themselves, which can put "Close" in
 their headers. However, libraries they have no control over, should
 receive a "Close" if "Keep-Alive" is sent.

 Tested on: v0.28-pre-325-g326b686. Only with a Services API client,
 not any other users of this code.

 {{{
 diff --git a/mythtv/libs/libmythupnp/httprequest.cpp
 b/mythtv/libs/libmythupnp/httprequest.cpp
 index 2758272..4afbb86 100644
 --- a/mythtv/libs/libmythupnp/httprequest.cpp
 +++ b/mythtv/libs/libmythupnp/httprequest.cpp
 @@ -1028,7 +1028,7 @@ bool HTTPRequest::GetKeepAlive()
      if ( sConnection == "close" )
          bKeepAlive = false;
      else if (sConnection == "keep-alive")
 -        bKeepAlive = true;
 +        bKeepAlive = false;

     return bKeepAlive;
  }
 }}}

--
Ticket URL: <http://code.mythtv.org/trac/ticket/11894>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list