Skip to content

Commit 03da5ce

Browse files
committed
optional keep-alive
1 parent 5384647 commit 03da5ce

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/dlna/clients/DLNAControlPoint.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ class DLNAControlPoint : public IControlPoint {
221221

222222
void setTransports(IHttpRequest& http, IUDPService& udp) {
223223
p_http = &http;
224+
p_http->setConnection(DLNA_REQUEST_KEEP_ALIVE ? CON_KEEP_ALIVE : CON_CLOSE);
224225
p_udp = &udp;
225226
}
226227

src/dlna_config.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
#define DLNA_HTTP_REQUEST_TIMEOUT_MS 6000
2626
#endif
2727

28+
/// Keep the session open for multiple requests
29+
#ifndef DLNA_REQUEST_KEEP_ALIVE
30+
#define DLNA_REQUEST_KEEP_ALIVE false
31+
#endif
32+
2833
/// Define XML parse buffer size
2934
#ifndef XML_PARSER_BUFFER_SIZE
3035
#define XML_PARSER_BUFFER_SIZE 512

0 commit comments

Comments
 (0)